query-61e04f1a523edd197e374c747c14b4bd
Map of botanical gardens, botanical museums, and herbariaNeeds improving to capture sub-types
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"}
SELECT DISTINCT ?museum ?museumLabel (SAMPLE(?coords) AS ?coords) (SAMPLE(?image) AS ?image) ?url ?layer WHERE {
VALUES ?type {wd:Q181916 wd:Q167346 wd:Q26959050 wd:Q272231}
?museum wdt:P31 ?type ; 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;
v8("?coords"):::projected
v8("?image"):::projected
v1("?layer"):::projected
v3("?museum"):::projected
v7("?museumLabel"):::projected
v2("?type")
v6("?url"):::projected
c6(["bd:serviceParam"]):::iri
c8(["#91;AUTO_LANGUAGE#93;,en"]):::literal
bind0[/VALUES ?type/]
bind0-->v2
bind00(["wd:Q181916"])
bind00 --> bind0
bind01(["wd:Q167346"])
bind01 --> bind0
bind02(["wd:Q26959050"])
bind02 --> bind0
bind03(["wd:Q272231"])
bind03 --> bind0
v3 --"wdt:P31"--> v2
v3 --"wdt:P625"--> v8
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v3 -."wdt:P18".-> v8
end
subgraph optional1["(optional)"]
style optional1 fill:#bbf,stroke-dasharray: 5 5;
v3 -."wdt:P856".-> v6
end
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c6 --"wikibase:language"--> c8
v3 --"rdfs:label"--> v7
v2 --"rdfs:label"--> v1
end
bind3[/"sample(?coords)"/]
v8 --o bind3
bind3 --as--o v8
bind4[/"sample(?image)"/]
v8 --o bind4
bind4 --as--o v8