query-17f3b7694f3bfb7a4ec19cd197256ce6
Museums without country (P17) but with coordinate location (P625), located in the administrative territorial entity (P131) and inception (P571)
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 ?museum ?museumLabel ?inception ?located_in_the_administrative_territorial_entity ?coordinate_location WHERE {
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
?museum (wdt:P31/(wdt:P279*)) wd:Q33506.
FILTER(NOT EXISTS { ?museum wdt:P17 ?country. })
OPTIONAL { ?museum wdt:P571 ?inception. }
OPTIONAL { ?museum wdt:P131 ?located_in_the_administrative_territorial_entity. }
OPTIONAL { ?museum wdt:P625 ?coordinate_location. }
}
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v5("?coordinate_location"):::projected
v2("?country")
v3("?inception"):::projected
v4("?located_in_the_administrative_territorial_entity"):::projected
v1("?museum"):::projected
a1((" "))
c3(["bd:serviceParam"]):::iri
c8(["wd:Q33506"]):::iri
c5(["#91;AUTO_LANGUAGE#93;,en"]):::literal
f0[["not "]]
subgraph f0e0["Exists Clause"]
e0v1 --"wdt:P17"--> e0v2
e0v2("?country"):::projected
e0v1("?museum"):::projected
end
f0--EXISTS--> f0e0
f0 --> v1
f0 --> c1
f0 --> v2
v1 --"wdt:P17"--> v2
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c3 --"wikibase:language"--> c5
end
v1 --"wdt:P31"--> a1
a1 --"wdt:P279"--> c8
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v1 -."wdt:P571".-> v3
end
subgraph optional1["(optional)"]
style optional1 fill:#bbf,stroke-dasharray: 5 5;
v1 -."wdt:P131".-> v4
end
subgraph optional2["(optional)"]
style optional2 fill:#bbf,stroke-dasharray: 5 5;
v1 -."wdt:P625".-> v5
end