query-ed8499064eb1bd5fb659bacc5f1726ad

rq turtle/ttl

Map

Use at

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 psv: <http://www.wikidata.org/prop/statement/value/>
PREFIX ps: <http://www.wikidata.org/prop/statement/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX bd: <http://www.bigdata.com/rdf#>
# Items in Poland that have coordinates and an p31 statement. Types are shown in map layers.
# defaultView:Map
SELECT ?item ?coord ?itemLabel ?layer
WHERE
{
    ?item wdt:P17 wd:Q36 .
    ?item p:P625 [ ps:P625 ?coord; psv:P625 ?coordV ] .
    ?item wdt:P31 ?type .
    OPTIONAL { ?type rdfs:label ?layer. FILTER(LANG(?layer) = "en"). }
    SERVICE wikibase:label {
      bd:serviceParam wikibase:language "en" .
    }
}

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v3("?coord"):::projected v4("?coordV") v2("?item"):::projected v1("?layer"):::projected v5("?type") a1((" ")) c10(["bd:serviceParam"]):::iri c1(["en"]):::literal c3(["wd:Q36"]):::iri v2 --"p:direct/P17"--> c3 a1 --"p:statement/P625"--> v3 a1 --"p:statement/value/P625"--> v4 v2 --"p:P625"--> a1 v2 --"p:direct/P31"--> v5 subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v5 -."rdfs:label".-> v1 end subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c10 --"wikibase:language"--> c1 end