query-bffd32511271c5ac12db91fa17375abe
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 rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT ?item ?itemLabel (group_concat(distinct ?countryLabel;separator="; ") as ?countries) (group_concat(distinct ?personLabel;separator="; ") as ?people) ?start ?end ?point_in_time
WHERE
{
?item wdt:P31 wd:Q178561 .
optional {?item wdt:P710 ?country . filter not exists {?country wdt:P31 wd:Q5. } }
optional {?item wdt:P710 ?person . ?person wdt:P31 wd:Q5 . }
optional {?item wdt:P580 ?start . }
optional {?item wdt:P580 ?end . }
optional {?item wdt:P585 ?point_in_time . }
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en".
?country rdfs:label ?countryLabel .
?person rdfs:label ?personLabel .
?item rdfs:label ?itemLabel .
?gender rdfs:label ?genderLabel .}
} group by ?item ?itemLabel ?start ?end ?point_in_time
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v12("?countries")
v1("?country")
v7("?countryLabel"):::projected
v5("?end"):::projected
v10("?gender")
v11("?genderLabel")
v2("?item"):::projected
v9("?itemLabel"):::projected
v13("?people")
v3("?person")
v8("?personLabel"):::projected
v6("?point_in_time"):::projected
v4("?start"):::projected
c8(["bd:serviceParam"]):::iri
c2(["wd:Q5"]):::iri
c3(["wd:Q178561"]):::iri
c10(["#91;AUTO_LANGUAGE#93;,en"]):::literal
v2 --"wdt:P31"--> c3
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v2 -."wdt:P710".-> v1
end
subgraph optional1["(optional)"]
style optional1 fill:#bbf,stroke-dasharray: 5 5;
v2 -."wdt:P710".-> v3
v3 --"wdt:P31"--> c2
end
subgraph optional2["(optional)"]
style optional2 fill:#bbf,stroke-dasharray: 5 5;
v2 -."wdt:P580".-> v4
end
subgraph optional3["(optional)"]
style optional3 fill:#bbf,stroke-dasharray: 5 5;
v2 -."wdt:P580".-> v5
end
subgraph optional4["(optional)"]
style optional4 fill:#bbf,stroke-dasharray: 5 5;
v2 -."wdt:P585".-> v6
end
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c8 --"wikibase:language"--> c10
v1 --"rdfs:label"--> v7
v3 --"rdfs:label"--> v8
v2 --"rdfs:label"--> v9
v10 --"rdfs:label"--> v11
end
bind2[/"?countryLabel"/]
v7 --o bind2
bind2 --as--o v12
bind3[/"?personLabel"/]
v8 --o bind3
bind3 --as--o v13