query-4cad2f4f6cfca6c70894c89a31cc63e6
Map of of bathing waters with/without an image in WikidataWikishootMewith link
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{"hide":["?coord"], "layer": "?layer"}
SELECT ?node ?nodeLabel ?nodeDescription ?WikiShootMe ?bathIdentifier ?layer ?article ?countryLabel (SAMPLE(?coord) AS ?coord) (SAMPLE(?img) AS ?img) (SAMPLE(?web) AS ?web) WHERE {
{
{ ?node wdt:P6104 wd:Q106774536. }
UNION
{ ?node wdt:P6104 wd:Q107096245. }
}
OPTIONAL { ?node wdt:P18 ?img. }
OPTIONAL { ?node wdt:P17 ?country. }
OPTIONAL { ?node wdt:P856 ?web. }
OPTIONAL { ?node wdt:P9161 ?bathIdentifier }
?node wdt:P625 ?coord.
OPTIONAL {
?article schema:about ?node;
schema:inLanguage "en".
}
BIND(IF(BOUND(?img), "Picture", "Missing picture") AS ?layer)
BIND(URI(CONCAT("https://wikishootme.toolforge.org/#q=", REPLACE(STR(?node), "http://www.wikidata.org/entity/", ""))) AS ?WikiShootMe)
SERVICE wikibase:label { bd:serviceParam wikibase:language "en,sv". }
}
GROUP BY ?node ?nodeLabel ?nodeDescription ?bathIdentifier ?article ?countryLabel ?layer ?WikiShootMe
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v9("?WikiShootMe"):::projected
v7("?article"):::projected
v5("?bathIdentifier"):::projected
v10("?coord"):::projected
v3("?country")
v10("?img"):::projected
v8("?layer"):::projected
v1("?node"):::projected
v10("?web"):::projected
c15(["en,sv"]):::literal
c11(["en"]):::literal
c2(["wd:Q106774536"]):::iri
c13(["bd:serviceParam"]):::iri
c3(["wd:Q107096245"]):::iri
subgraph union0[" Union "]
subgraph union0l[" "]
style union0l fill:#abf,stroke-dasharray: 3 3;
v1 --"wdt:P6104"--> c3
end
subgraph union0r[" "]
style union0r fill:#abf,stroke-dasharray: 3 3;
v1 --"wdt:P6104"--> c2
end
union0r <== or ==> union0l
end
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v1 -."wdt:P18".-> v10
end
subgraph optional1["(optional)"]
style optional1 fill:#bbf,stroke-dasharray: 5 5;
v1 -."wdt:P17".-> v3
end
subgraph optional2["(optional)"]
style optional2 fill:#bbf,stroke-dasharray: 5 5;
v1 -."wdt:P856".-> v10
end
subgraph optional3["(optional)"]
style optional3 fill:#bbf,stroke-dasharray: 5 5;
v1 -."wdt:P9161".-> v5
end
v1 --"wdt:P625"--> v10
subgraph optional4["(optional)"]
style optional4 fill:#bbf,stroke-dasharray: 5 5;
v7 -."schema:about".-> v1
v7 --"schema:inLanguage"--> c11
end
bind0[/"if(bound(?img),'Picture','Missing picture')"/]
v10 --o bind0
bind0 --as--o v8
bind1[/"concat('https://wikishootme.toolforge.org/#q=',replace(str(?node),'http://www.wikidata.org/entity/',''))"/]
v1 --o bind1
bind1 --as--o v9
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c13 --"wikibase:language"--> c15
end
bind5[/"sample(?coord)"/]
v10 --o bind5
bind5 --as--o v10
bind6[/"sample(?img)"/]
v10 --o bind6
bind6 --as--o v10
bind7[/"sample(?web)"/]
v10 --o bind7
bind7 --as--o v10