query-eec71dfafab619b91b9b8e66c2b8378a
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 ?located_inLabel ?coord ?geoshape (GROUP_CONCAT(?adjacent_to_label;SEPARATOR=', ') AS ?adjacents) ?said_to_be_same_as ?said_to_be_same_asLabel WHERE
{
?item wdt:P31 wd:Q27971968.
OPTIONAL { ?item wdt:P460 ?said_to_be_same_as }
OPTIONAL { ?item wdt:P131 ?located_in }
OPTIONAL { ?item wdt:P625 ?coord }
OPTIONAL { ?item wdt:P3896 ?geoshape }
OPTIONAL { ?item wdt:P47 ?adjacent_to . ?adjacent_to rdfs:label ?adjacent_to_label . FILTER(LANG(?adjacent_to_label)='en') }
filter not exists {?item wdt:P576 [] . }
SERVICE wikibase:label { bd:serviceParam wikibase:language "en" }
}
GROUP BY ?item ?itemLabel ?located_inLabel ?coord ?geoshape ?said_to_be_same_as ?said_to_be_same_asLabel
ORDER BY ?itemLabel ?located_inLabel
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v9("?adjacent_to")
v4("?adjacent_to_label"):::projected
v10("?adjacents")
v7("?coord"):::projected
v8("?geoshape"):::projected
v3("?item"):::projected
v1("?itemLabel"):::projected
v6("?located_in")
v2("?located_inLabel"):::projected
v5("?said_to_be_same_as"):::projected
a1((" "))
c2(["en"]):::literal
c4(["wd:Q27971968"]):::iri
c12(["bd:serviceParam"]):::iri
f0[["not "]]
subgraph f0e0["Exists Clause"]
e0v1 --"wdt:P576"--> e0a1
e0v1("?item"):::projected
e0a1((" ")):::projected
end
f0--EXISTS--> f0e0
f0 --> v3
f0 --> c1
f0 --> a1
v3 --"wdt:P576"--> a1
v3 --"wdt:P31"--> c4
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v3 -."wdt:P460".-> v5
end
subgraph optional1["(optional)"]
style optional1 fill:#bbf,stroke-dasharray: 5 5;
v3 -."wdt:P131".-> v6
end
subgraph optional2["(optional)"]
style optional2 fill:#bbf,stroke-dasharray: 5 5;
v3 -."wdt:P625".-> v7
end
subgraph optional3["(optional)"]
style optional3 fill:#bbf,stroke-dasharray: 5 5;
v3 -."wdt:P3896".-> v8
end
subgraph optional4["(optional)"]
style optional4 fill:#bbf,stroke-dasharray: 5 5;
v3 -."wdt:P47".-> v9
v9 --"rdfs:label"--> v4
end
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c12 --"wikibase:language"--> c2
end
bind2[/"?adjacent_to_label"/]
v4 --o bind2
bind2 --as--o v10