query-a60815bc396441b20c4d472f47a3e115
In oslo
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 bd: <http://www.bigdata.com/rdf#>
SELECT DISTINCT ?item ?itemLabel ?nativeLabel ?territory ?territoryLabel ?location ?locationLabel WHERE {
?item wdt:P31/(wdt:P279*) wd:Q16970.
?item wdt:P17 wd:Q20.
?item wdt:P131 / wdt:P131? wd:Q5245991.
OPTIONAL { ?item wdt:P131 ?territory }
OPTIONAL { ?item wdt:P276 ?location }
OPTIONAL { ?item wdt:P1705 ?nativeLabel }
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en,en" }
}
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v1("?item"):::projected
v3("?location"):::projected
v4("?nativeLabel"):::projected
v2("?territory"):::projected
a1((" "))
a2((" "))
c13(["#91;AUTO_LANGUAGE#93;,en,en"]):::literal
c5(["wd:Q20"]):::iri
c7(["wd:Q5245991"]):::iri
c11(["bd:serviceParam"]):::iri
c3(["wd:Q16970"]):::iri
v1 --"wdt:P31"--> a1
a1 --"wdt:P279"--> c3
v1 --"wdt:P17"--> c5
v1 --"wdt:P131"--> a2
subgraph union0[" Union "]
subgraph union0l[" "]
style union0l fill:#abf,stroke-dasharray: 3 3;
a2 --"wdt:P131"--> c7
end
subgraph union0r[" "]
style union0r fill:#abf,stroke-dasharray: 3 3;
end
union0r <== or ==> union0l
end
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v1 -."wdt:P131".-> v2
end
subgraph optional1["(optional)"]
style optional1 fill:#bbf,stroke-dasharray: 5 5;
v1 -."wdt:P276".-> v3
end
subgraph optional2["(optional)"]
style optional2 fill:#bbf,stroke-dasharray: 5 5;
v1 -."wdt:P1705".-> v4
end
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c11 --"wikibase:language"--> c13
end