query-6f4d00e4e6f15774fc9c68c9b713d944

rq turtle/ttl

TODO

Use at

PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX schema: <http://schema.org/>
PREFIX geof: <http://www.opengis.net/def/function/geosparql/>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT
  ?item
  ?itemLabel
  ?deathPlaceLabel
  (concat(str(geof:latitude(?coords)), ',', str(geof:longitude(?coords))) as ?latlng)
  (if(?gender = wd:Q6581072, '#993300', '#009933') as ?color)
  (if(BOUND(?linkfr), 'circle', '') as ?symbol)
  (if(BOUND(?linkfr), concat('[[', substr(str(?linkfr),31,500),  '|', ?itemLabel, ']]'), ?itemLabel) 
   as ?title)
  (concat(
    'décès en ', 
    str(YEAR(?death)), 
    ' à ', 
    ?deathPlaceLabel, 
    '\n\n', 
    if(BOUND(?image), concat('[[File:', substr(str(?image), 52, 500), '|200px]]'), ''),
    if (BOUND(?linken), concat(' [[:en:', substr(str(?linken),31,500),  '|(en)]]'), ''),
    if (BOUND(?linkde), concat(' [[:de:', substr(str(?linkde),31,500),  '|(de)]]'), ''),
    if (BOUND(?linkes), concat(' [[:es:', substr(str(?linkes),31,500),  '|(es)]]'), '')
  ) 
   as ?description)
  ('1000' as ?randomise)
  ?linkfr
  ?linkde
  ?linken
  ?linkes
WHERE {
  { ?item wdt:P1399 wd:Q259745. }
  UNION
  { ?item wdt:P1595 wd:Q259745. }
  ?item wdt:P20 ?deathPlace.
  ?deathPlace wdt:P625 ?coords.
  OPTIONAL { ?item wdt:P21 ?gender. }
  OPTIONAL { ?item wdt:P570 ?death. }
  SERVICE wikibase:label { bd:serviceParam wikibase:language "fr,en". }
  OPTIONAL { ?item wdt:P18 ?image. }
  OPTIONAL {
    ?linkfr schema:about ?item .
    ?linkfr schema:isPartOf <https://fr.wikipedia.org/> .
  }
  OPTIONAL {
    ?linkde schema:about ?item .
    ?linkde schema:isPartOf <https://de.wikipedia.org/> .
  }  
  OPTIONAL {
    ?linken schema:about ?item .
    ?linken schema:isPartOf <https://en.wikipedia.org/> .
  }
  OPTIONAL {
    ?linkes schema:about ?item .
    ?linkes schema:isPartOf <https://es.wikipedia.org/> .
  }  
}

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v12("?color") v3("?coords"):::projected v5("?death"):::projected v2("?deathPlace") v15("?description") v4("?gender"):::projected v6("?image"):::projected v1("?item"):::projected v11("?latlng") v8("?linkde"):::projected v9("?linken"):::projected v10("?linkes"):::projected v7("?linkfr"):::projected v16("?randomise") v13("?symbol") v14("?title") c16([https://de.wikipedia.org/]):::iri c2(["wd:Q259745"]):::iri c15([https://fr.wikipedia.org/]):::iri c17([https://en.wikipedia.org/]):::iri c9(["bd:serviceParam"]):::iri c18([https://es.wikipedia.org/]):::iri c11(["fr,en"]):::literal subgraph union0[" Union "] subgraph union0l[" "] style union0l fill:#abf,stroke-dasharray: 3 3; v1 --"wdt:P1595"--> c2 end subgraph union0r[" "] style union0r fill:#abf,stroke-dasharray: 3 3; v1 --"wdt:P1399"--> c2 end union0r <== or ==> union0l end v1 --"wdt:P20"--> v2 v2 --"wdt:P625"--> v3 subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v1 -."wdt:P21".-> v4 end subgraph optional1["(optional)"] style optional1 fill:#bbf,stroke-dasharray: 5 5; v1 -."wdt:P570".-> v5 end subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c9 --"wikibase:language"--> c11 end subgraph optional2["(optional)"] style optional2 fill:#bbf,stroke-dasharray: 5 5; v1 -."wdt:P18".-> v6 end subgraph optional3["(optional)"] style optional3 fill:#bbf,stroke-dasharray: 5 5; v7 -."schema:about".-> v1 v7 --"schema:isPartOf"--> c15 end subgraph optional4["(optional)"] style optional4 fill:#bbf,stroke-dasharray: 5 5; v8 -."schema:about".-> v1 v8 --"schema:isPartOf"--> c16 end subgraph optional5["(optional)"] style optional5 fill:#bbf,stroke-dasharray: 5 5; v9 -."schema:about".-> v1 v9 --"schema:isPartOf"--> c17 end subgraph optional6["(optional)"] style optional6 fill:#bbf,stroke-dasharray: 5 5; v10 -."schema:about".-> v1 v10 --"schema:isPartOf"--> c18 end bind0[/"concat(str(http://www.opengis.net/def/function/geosparql/latitude(?coords)),',',str(http://www.opengis.net/def/function/geosparql/longitude(?coords)))"/] v3 --o bind0 bind0 --as--o v11 bind1[/"if(?gender = 'wd:Q6581072','#993300','#009933')"/] v4 --o bind1 bind1 --as--o v12 bind2[/"if(bound(?linkfr),'circle','')"/] v7 --o bind2 bind2 --as--o v13 bind3[/"if(bound(?linkfr),concat('#91;#91;',substring(str(?linkfr),'31^^xsd:integer','500^^xsd:integer'),'|',?itemLabel,'#93;#93;'),?itemLabel)"/] v7 --o bind3 null --o bind3 bind3 --as--o v14 bind4[/"concat('décès en ',str(year-from-dateTime(?death)),' à ',?deathPlaceLabel,' ',if(bound(?image),concat('#91;#91;File:',substring(str(?image),'52^^xsd:integer','500^^xsd:integer'),'|200px#93;#93;'),''),if(bound(?linken),concat(' #91;#91;:en:',substring(str(?linken),'31^^xsd:integer','500^^xsd:integer'),'|(en)#93;#93;'),''),if(bound(?linkde),concat(' #91;#91;:de:',substring(str(?linkde),'31^^xsd:integer','500^^xsd:integer'),'|(de)#93;#93;'),''),if(bound(?linkes),concat(' #91;#91;:es:',substring(str(?linkes),'31^^xsd:integer','500^^xsd:integer'),'|(es)#93;#93;'),''))"/] v5 --o bind4 null --o bind4 v6 --o bind4 v9 --o bind4 v8 --o bind4 v10 --o bind4 bind4 --as--o v15 bind5[/"'1000'"/] bind5 --as--o v16