query-51359df7e59a2c4f63340e8475da9a72
Troubleshoot wdt:P31*I run this query that works excellent finding museums
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 schema: <http://schema.org/>
PREFIX bd: <http://www.bigdata.com/rdf#>
#defaultView:Map
SELECT ?museum ?museumLabel ?location ?dist ?img ?article ?URL WHERE {
SERVICE wikibase:label { bd:serviceParam wikibase:language "sv,en". }
SERVICE wikibase:around {
?museum wdt:P625 ?location.
bd:serviceParam wikibase:center "[AUTO_COORDINATES]".
bd:serviceParam wikibase:radius "10".
bd:serviceParam wikibase:distance ?dist.
}
?museum wdt:P31 wd:Q33506.
OPTIONAL {?article schema:about ?museum;
schema:inLanguage "sv"}
OPTIONAL{?museum wdt:P18 ?img}
OPTIONAL {?museum wdt:P856 ?URL}
}
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v6("?URL"):::projected
v4("?article"):::projected
v3("?dist"):::projected
v5("?img"):::projected
v2("?location"):::projected
v1("?museum"):::projected
c13(["wd:Q33506"]):::iri
c16(["sv"]):::literal
c2(["bd:serviceParam"]):::iri
c4(["sv,en"]):::literal
c8(["#91;AUTO_COORDINATES#93;"]):::literal
c10(["10"]):::literal
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c2 --"wikibase:language"--> c4
end
subgraph s2["http://wikiba.se/ontology#around"]
style s2 stroke-width:4px;
v1 --"wdt:P625"--> v2
c2 --"wikibase:center"--> c8
c2 --"wikibase:radius"--> c10
c2 --"wikibase:distance"--> v3
end
v1 --"wdt:P31"--> c13
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v4 -."schema:about".-> v1
v4 --"schema:inLanguage"--> c16
end
subgraph optional1["(optional)"]
style optional1 fill:#bbf,stroke-dasharray: 5 5;
v1 -."wdt:P18".-> v5
end
subgraph optional2["(optional)"]
style optional2 fill:#bbf,stroke-dasharray: 5 5;
v1 -."wdt:P856".-> v6
end