query-882d5b74126f2efe8d591dfc5c23dc71
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#>
#defaultView:Map{"hide": "?coords"}
#mappa dei musei
SELECT DISTINCT ?museum ?museumLabel (SAMPLE(?coords) AS ?coords) #(SAMPLE(?image) AS ?image)
?url ?layer WHERE {
?museum wdt:P31 ?type .?type wdt:P279? wd:Q33506. ?museum wdt:P625 ?coords
#OPTIONAL {?museum wdt:P18 ?image}
OPTIONAL {?museum wdt:P856 ?url}
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en".
?museum rdfs:label ?museumLabel. ?type rdfs:label ?layer }
} GROUP BY ?museum ?museumLabel ?url ?layer
ORDER BY UCASE(?layer)
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v7("?coords"):::projected
v1("?layer"):::projected
v2("?museum"):::projected
v6("?museumLabel"):::projected
v3("?type")
v5("?url"):::projected
c2(["wd:Q33506"]):::iri
c7(["bd:serviceParam"]):::iri
c9(["#91;AUTO_LANGUAGE#93;,en"]):::literal
v2 --"wdt:P31"--> v3
subgraph union0[" Union "]
subgraph union0l[" "]
style union0l fill:#abf,stroke-dasharray: 3 3;
v3 --"wdt:P279"--> c2
end
subgraph union0r[" "]
style union0r fill:#abf,stroke-dasharray: 3 3;
end
union0r <== or ==> union0l
end
v2 --"wdt:P625"--> v7
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v2 -."wdt:P856".-> v5
end
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c7 --"wikibase:language"--> c9
v2 --"rdfs:label"--> v6
v3 --"rdfs:label"--> v1
end
bind1[/"sample(?coords)"/]
v7 --o bind1
bind1 --as--o v7