query-2053bc8f837ccf010f55d05b24891808
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 ps: <http://www.wikidata.org/prop/statement/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT distinct ?item ?itemLabel (sample(?geo) as ?geo) (group_concat(distinct ?typeLabel;separator=', ') as ?typeLabel) WHERE {
?item p:P31/p:P279* ?statement .
?statement ps:P31 wd:Q42744322.
optional { ?item wdt:P625 ?geo . }
optional {?item wdt:P31 ?type. ?type rdfs:label ?typeLabel . filter(lang(?typeLabel)="en") }
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
} group by ?item ?itemLabel
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v6("?geo"):::projected
v2("?item"):::projected
v3("?statement")
v5("?type")
v6("?typeLabel"):::projected
a1((" "))
c10(["bd:serviceParam"]):::iri
c5(["wd:Q42744322"]):::iri
c12(["#91;AUTO_LANGUAGE#93;,en"]):::literal
v2 --"p:P31"--> a1
a1 --"p:P279"--> v3
v3 --"p:statement/P31"--> c5
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v2 -."p:direct/P625".-> v6
end
subgraph optional1["(optional)"]
style optional1 fill:#bbf,stroke-dasharray: 5 5;
v2 -."p:direct/P31".-> v5
v5 --"rdfs:label"--> v6
end
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c10 --"wikibase:language"--> c12
end
bind2[/"sample(?geo)"/]
v6 --o bind2
bind2 --as--o v6
bind3[/"?typeLabel"/]
v6 --o bind3
bind3 --as--o v6