query-431c12645c8e48155bbee8840ebeed5b
TODO
Use at
- https://query.wikidata.org/sparql
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 rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX bd: <http://www.bigdata.com/rdf#>
#defaultView:Map
SELECT
?item
?itemLabel
?deathPlaceLabel
?coords
(if(BOUND(?linkfr), concat('[[', substr(str(?linkfr),31,500), '|', ?itemLabel, ']]'), ?itemLabel)
as ?title)
(concat('décès en ',
if (BOUND(?death), str(YEAR(?death)), '- date inconnue -'),
' à ',
?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)]]'), ''),
if (BOUND(?linkno), concat(' [[:no:', substr(str(?linkno),31,500), '|(no)]]'), '')
)
as ?description)
('1000' as ?randomise)
?linkfr
?linkde
?linken
?linkes
?linkno
?layer
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". ?gender rdfs:label ?genderLabel}
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/> .
}
OPTIONAL {
?linkno schema:about ?item .
?linkno schema:isPartOf <https://no.wikipedia.org/> .
}
BIND(?genderLabel AS ?layer )
}
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v3("?coords"):::projected
v5("?death"):::projected
v2("?deathPlace")
v15("?description")
v4("?gender")
v6("?genderLabel")
v7("?image"):::projected
v1("?item"):::projected
v13("?layer"):::projected
v9("?linkde"):::projected
v10("?linken"):::projected
v11("?linkes"):::projected
v8("?linkfr"):::projected
v12("?linkno"):::projected
v16("?randomise")
v14("?title")
c17([https://de.wikipedia.org/]):::iri
c2(["wd:Q259745"]):::iri
c16([https://fr.wikipedia.org/]):::iri
c18([https://en.wikipedia.org/]):::iri
c9(["bd:serviceParam"]):::iri
c20([https://no.wikipedia.org/]):::iri
c19([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
v4 --"rdfs:label"--> v6
end
subgraph optional2["(optional)"]
style optional2 fill:#bbf,stroke-dasharray: 5 5;
v1 -."wdt:P18".-> v7
end
subgraph optional3["(optional)"]
style optional3 fill:#bbf,stroke-dasharray: 5 5;
v8 -."schema:about".-> v1
v8 --"schema:isPartOf"--> c16
end
subgraph optional4["(optional)"]
style optional4 fill:#bbf,stroke-dasharray: 5 5;
v9 -."schema:about".-> v1
v9 --"schema:isPartOf"--> c17
end
subgraph optional5["(optional)"]
style optional5 fill:#bbf,stroke-dasharray: 5 5;
v10 -."schema:about".-> v1
v10 --"schema:isPartOf"--> c18
end
subgraph optional6["(optional)"]
style optional6 fill:#bbf,stroke-dasharray: 5 5;
v11 -."schema:about".-> v1
v11 --"schema:isPartOf"--> c19
end
subgraph optional7["(optional)"]
style optional7 fill:#bbf,stroke-dasharray: 5 5;
v12 -."schema:about".-> v1
v12 --"schema:isPartOf"--> c20
end
bind0[/"?genderLabel"/]
v6 --o bind0
bind0 --as--o v13
bind1[/"if(bound(?linkfr),concat('#91;#91;',substring(str(?linkfr),'31^^xsd:integer','500^^xsd:integer'),'|',?itemLabel,'#93;#93;'),?itemLabel)"/]
v8 --o bind1
null --o bind1
bind1 --as--o v14
bind2[/"concat('décès en ',if(bound(?death),str(year-from-dateTime(?death)),'- date inconnue -'),' à ',?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;'),''),if(bound(?linkno),concat(' #91;#91;:no:',substring(str(?linkno),'31^^xsd:integer','500^^xsd:integer'),'|(no)#93;#93;'),''))"/]
v5 --o bind2
null --o bind2
v7 --o bind2
v10 --o bind2
v9 --o bind2
v11 --o bind2
v12 --o bind2
bind2 --as--o v15
bind3[/"'1000'"/]
bind3 --as--o v16