query-eb9b36c1a63b17c28f9a841ecb94bd94
TODO
Use at
- https://query.wikidata.org/sparql
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX ps: <http://www.wikidata.org/prop/statement/>
PREFIX prov: <http://www.w3.org/ns/prov#>
PREFIX pr: <http://www.wikidata.org/prop/reference/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX bd: <http://www.bigdata.com/rdf#>
#defaultView:Map
SELECT ?item ?itemLabel ?coord1 ?layer WHERE
{
{ ?item wdt:P777 ?sockenkod .
?item p:P625 ?coord1stm . ?coord1stm prov:wasDerivedFrom ?ref1 . ?ref1 pr:P143 ?imp1 . ?coord1stm ps:P625 ?coord1 .
?item p:P625 ?coord2stm . ?coord2stm ps:P625 ?coord2 .
FILTER(?coord1<?coord2)
} UNION
{ ?item wdt:P777 ?sockenkod .
?item p:P625 ?coord1stm . ?coord1stm prov:wasDerivedFrom ?ref1 . ?ref1 pr:P143 ?imp1 . ?coord1stm ps:P625 ?coord1 .
?item p:P625 ?coord2stm . ?coord2stm ps:P625 ?coord2 .
FILTER(?coord1>?coord2)
}
?imp1 rdfs:label ?lab1 . FILTER(lang(?lab1)='sv')
BIND(str(?lab1) AS ?layer)
SERVICE wikibase:label { bd:serviceParam wikibase:language "sv". }
}
ORDER BY ?itemLabel
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v3("?coord1"):::projected
v7("?coord1stm")
v4("?coord2")
v10("?coord2stm")
v9("?imp1")
v5("?item"):::projected
v1("?itemLabel"):::projected
v2("?lab1")
v11("?layer"):::projected
v8("?ref1")
v6("?sockenkod")
c1(["sv"]):::literal
c9(["bd:serviceParam"]):::iri
f0[["?lab1 = 'sv'"]]
f0 --> v2
subgraph union0[" Union "]
subgraph union0l[" "]
style union0l fill:#abf,stroke-dasharray: 3 3;
f1[["?coord1 > ?coord2"]]
f1 --> v3
f1 --> v4
v5 --"p:direct/P777"--> v6
v5 --"p:P625"--> v7
v7 --"prov:wasDerivedFrom"--> v8
v8 --"p:reference/P143"--> v9
v7 --"p:statement/P625"--> v3
v5 --"p:P625"--> v10
v10 --"p:statement/P625"--> v4
end
subgraph union0r[" "]
style union0r fill:#abf,stroke-dasharray: 3 3;
f2[["?coord1 < ?coord2"]]
f2 --> v3
f2 --> v4
v5 --"p:direct/P777"--> v6
v5 --"p:P625"--> v7
v7 --"prov:wasDerivedFrom"--> v8
v8 --"p:reference/P143"--> v9
v7 --"p:statement/P625"--> v3
v5 --"p:P625"--> v10
v10 --"p:statement/P625"--> v4
end
union0r <== or ==> union0l
end
v9 --"rdfs:label"--> v2
bind3[/"str(?lab1)"/]
v2 --o bind3
bind3 --as--o v11
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c9 --"wikibase:language"--> c1
end