query-497448622fdd07cebc740d3bb90b83b9

rq turtle/ttl

TODO

Use at

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#>
#cementiris i fars de Catalunya (mostra innecessàriament redundant de UNION i ?layer)
SELECT DISTINCT ?item ?municipi ?itemLabel ?municipiLabel ?coord ?layer
  WHERE {
    {?item wdt:P17 wd:Q29.
    ?item wdt:P31/wdt:P279* wd:Q39614.
    ?item wdt:P131* ?municipi.
    ?municipi wdt:P31 wd:Q33146843.
    OPTIONAL {?item wdt:P625 ?coord}
    VALUES ?layer {"1"}
    }
    UNION
    {?item wdt:P17 wd:Q29.
    ?item wdt:P31/wdt:P279* wd:Q39715.
    ?item wdt:P131* ?municipi.
    ?municipi wdt:P31 wd:Q33146843.
    OPTIONAL {?item wdt:P625 ?coord}
    VALUES ?layer {"2"}
    }
    SERVICE wikibase:label {
        bd:serviceParam wikibase:language "ca" .
        }
  }
#defaultView:Map

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v3("?coord"):::projected v1("?item"):::projected v5("?layer"):::projected v2("?municipi"):::projected a1((" ")) a2((" ")) c7(["wd:Q33146843"]):::iri c2(["wd:Q29"]):::iri c11(["bd:serviceParam"]):::iri c9(["wd:Q39715"]):::iri c5(["wd:Q39614"]):::iri c13(["ca"]):::literal subgraph union0[" Union "] subgraph union0l[" "] style union0l fill:#abf,stroke-dasharray: 3 3; v1 --"wdt:P17"--> c2 v1 --"wdt:P31"--> a2 a2 --"wdt:P279"--> c9 v1 --"wdt:P131"--> v2 v2 --"wdt:P31"--> c7 subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v1 -."wdt:P625".-> v3 end bind0[/VALUES ?layer/] bind0-->v5 bind00(["2"]) bind00 --> bind0 end subgraph union0r[" "] style union0r fill:#abf,stroke-dasharray: 3 3; v1 --"wdt:P17"--> c2 v1 --"wdt:P31"--> a1 a1 --"wdt:P279"--> c5 v1 --"wdt:P131"--> v2 v2 --"wdt:P31"--> c7 subgraph optional1["(optional)"] style optional1 fill:#bbf,stroke-dasharray: 5 5; v1 -."wdt:P625".-> v3 end bind1[/VALUES ?layer/] bind1-->v5 bind10(["1"]) bind10 --> bind1 end union0r <== or ==> union0l end subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c11 --"wikibase:language"--> c13 end