query-1f60b239386923ea1543d0607123f69c
A map of all lighthouses in Sweden
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#>
#title:Lighthouses in Sweden
#defaultView:Map
SELECT DISTINCT ?item ?name ?coor ?image ?character ?focal_height ?lysvidd ?admiralty
WHERE
{
?item wdt:P31 wd:Q39715 .
?item wdt:P17 wd:Q34 .
OPTIONAL { ?item wdt:P18 ?image }
OPTIONAL { ?item wdt:P625 ?coor }
OPTIONAL { ?item wdt:P1448 ?name }
OPTIONAL { ?item wdt:P1030 ?character }
OPTIONAL { ?item wdt:P2923 ?foc }
OPTIONAL { ?item wdt:P2929 ?lys }
OPTIONAL { ?item wdt:P3562 ?admiralty }
BIND(CONCAT("Lyshöjd: ", str(?foc), " m") AS ?focal_height)
BIND(CONCAT("Lysvidd: ", str(?lys), " NM") AS ?lysvidd)
SERVICE wikibase:label { bd:serviceParam wikibase:language "sv,en" }
}
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v8("?admiralty"):::projected
v5("?character"):::projected
v3("?coor"):::projected
v6("?foc")
v9("?focal_height"):::projected
v2("?image"):::projected
v1("?item"):::projected
v7("?lys")
v10("?lysvidd"):::projected
v4("?name"):::projected
c4(["wd:Q34"]):::iri
c13(["bd:serviceParam"]):::iri
c15(["sv,en"]):::literal
c2(["wd:Q39715"]):::iri
v1 --"wdt:P31"--> c2
v1 --"wdt:P17"--> c4
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v1 -."wdt:P18".-> v2
end
subgraph optional1["(optional)"]
style optional1 fill:#bbf,stroke-dasharray: 5 5;
v1 -."wdt:P625".-> v3
end
subgraph optional2["(optional)"]
style optional2 fill:#bbf,stroke-dasharray: 5 5;
v1 -."wdt:P1448".-> v4
end
subgraph optional3["(optional)"]
style optional3 fill:#bbf,stroke-dasharray: 5 5;
v1 -."wdt:P1030".-> v5
end
subgraph optional4["(optional)"]
style optional4 fill:#bbf,stroke-dasharray: 5 5;
v1 -."wdt:P2923".-> v6
end
subgraph optional5["(optional)"]
style optional5 fill:#bbf,stroke-dasharray: 5 5;
v1 -."wdt:P2929".-> v7
end
subgraph optional6["(optional)"]
style optional6 fill:#bbf,stroke-dasharray: 5 5;
v1 -."wdt:P3562".-> v8
end
bind0[/"concat('Lyshöjd: ',str(?foc),' m')"/]
v6 --o bind0
bind0 --as--o v9
bind1[/"concat('Lysvidd: ',str(?lys),' NM')"/]
v7 --o bind1
bind1 --as--o v10
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c13 --"wikibase:language"--> c15
end