query-d54285e07307ff47d98cdc3cbde1a360

rq turtle/ttl

ESP sense coordenades - mapa dels seus municipis SELECT ?item ?itemLabel ?muni ?idescat ?muniLabel ?coor WHERE { ?item wdt:P4335 ?idescat FILTER (STRLEN(?idescat)=13) #només codis de 13 dígits FILTER (STRENDS(?idescat,"00")) MINUS {?item wdt:P625 ?coor2} #només sense coordenades ?item wdt:P131 ?muni. ?muni wdt:P625 ?coor SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". } }

Use at

PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX bd: <http://www.bigdata.com/rdf#>
# ESP sense coordenades - mapa dels seus municipis
SELECT ?item ?itemLabel ?muni ?idescat ?muniLabel ?coor WHERE {
?item wdt:P4335 ?idescat 
     FILTER (STRLEN(?idescat)=13) #només codis de 13 dígits
      FILTER  (STRENDS(?idescat,"00"))
    MINUS  {?item wdt:P625 ?coor2} #només sense coordenades
     ?item wdt:P131 ?muni.
     ?muni wdt:P625 ?coor
      SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v5("?coor"):::projected v3("?coor2") v1("?idescat"):::projected v2("?item"):::projected v4("?muni"):::projected c7(["bd:serviceParam"]):::iri c9(["#91;AUTO_LANGUAGE#93;,en"]):::literal f0[["ends-with(?idescat,'00')"]] f0 --> v1 f1[["string-length(?idescat) = '13^^xsd:integer'"]] f1 --> v1 v2 --"wdt:P4335"--> v1 subgraph minus2["MINUS"] style minus2 stroke-width:6px,fill:pink,stroke:red; v2 --"wdt:P625"--> v3 end v2 --"wdt:P131"--> v4 v4 --"wdt:P625"--> v5 subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c7 --"wikibase:language"--> c9 end