query-6672c26f1e6571e0b10e6286bcbb21fd

rq turtle/ttl

Altres Consultes https://www.idescat.cat/codis/?cin=0&nom=&ambit=a&cic=0&codi=171997&pobi=&pobf=&id=50&n=22&inf=c&t=01-01-2023Per trobar tot l'arbre de poblacions d'un municipi a partir del seu codi: IDESCAT: Per trobar ref:ine a OSM [out:csv("ref:ine",name,place,wikidata)] [bbox:{{bbox}}]; ( node[place=locality ] ; ); out meta ; Correspondències municipals OSM-WD/VP: Per trobar admin-centre amb wikidata diferent de la relació corresponent: rel[wikidata]"admin_level"="8"; // get all relations with wikidata tag in current bounding box and admin_level=8 foreach -> .rel( // process each relation one by one // find out all node members where the wikidata tag does not match the relation's wikidata tag nodewikidata(if: t["wikidata"] != rel.u(t["wikidata"]))->.llista; // if some node members could be found, print the current relation first... rel.rel(if:llista.count(nodes) > 0); out center; // ... followed by all nodes with unmatching wikidata tag .llista out tags; ); Per trobar refs ine o idescat a WD

Use at

PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX ps: <http://www.wikidata.org/prop/statement/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT ?item ?itemLabel ?codi WHERE {
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
  ?item p:P772/ps:P772 ?codi.
        FILTER(STRLEN(?codi) = 11)
  FILTER(SUBSTR(?codi,1,2)="17")
}

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v1("?codi"):::projected v2("?item"):::projected a1((" ")) c6(["bd:serviceParam"]):::iri c8(["#91;AUTO_LANGUAGE#93;,en"]):::literal f0[["substring(?codi,'1^^xsd:integer','2^^xsd:integer') = '17'"]] f0 --> v1 f1[["string-length(?codi) = '11^^xsd:integer'"]] f1 --> v1 subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c6 --"wikibase:language"--> c8 end v2 --"p:P772"--> a1 a1 --"p:statement/P772"--> v1