query-0eb7002ccb6b9c582026b42e29b0ebce

rq turtle/ttl

llocs amb coordenades referenciades al NomenclĂ tor SELECT ?item ?itemLabel ?inst ?instLabel ?mun ?munLabel ?idescat ?lat ?lon WHERE { ?item wdt:P17 wd:Q29. ?item p:P625 ?coordinate. ?coordinate prov:wasDerivedFrom ?ref. ?ref pr:P248 wd:Q11938912. ?coordinate psv:P625 ?coordinate_node. ?coordinate_node wikibase:geoLatitude ?lat. ?coordinate_node wikibase:geoLongitude ?lon. OPTIONAL {?item wdt:P31 ?inst} OPTIONAL {?item wdt:P131* ?mun. ?mun wdt:P31 wd:Q33146843} OPTIONAL {?mun wdt:P4335 ?idescat} SERVICE wikibase:label { bd:serviceParam wikibase:language "ca,oc,en,es,fr". } }

Use at

PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX psv: <http://www.wikidata.org/prop/statement/value/>
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#>
# llocs amb coordenades referenciades al NomenclĂ tor
SELECT ?item ?itemLabel ?inst ?instLabel ?mun ?munLabel ?idescat ?lat ?lon
WHERE {
  ?item wdt:P17 wd:Q29.
  ?item p:P625 ?coordinate.
  ?coordinate prov:wasDerivedFrom ?ref.
  ?ref pr:P248 wd:Q11938912.
  ?coordinate psv:P625 ?coordinate_node.
  ?coordinate_node wikibase:geoLatitude ?lat.
  ?coordinate_node wikibase:geoLongitude ?lon.
  OPTIONAL {?item wdt:P31 ?inst}
  OPTIONAL {?item wdt:P131* ?mun.
            ?mun wdt:P31 wd:Q33146843}
  OPTIONAL {?mun wdt:P4335 ?idescat}
  SERVICE wikibase:label { bd:serviceParam wikibase:language "ca,oc,en,es,fr". }
}

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v2("?coordinate") v4("?coordinate_node") v9("?idescat"):::projected v7("?inst"):::projected v1("?item"):::projected v5("?lat"):::projected v6("?lon"):::projected v8("?mun"):::projected v3("?ref") c12(["wd:Q33146843"]):::iri c6(["wd:Q11938912"]):::iri c17(["ca,oc,en,es,fr"]):::literal c2(["wd:Q29"]):::iri c15(["bd:serviceParam"]):::iri v1 --"p:direct/P17"--> c2 v1 --"p:P625"--> v2 v2 --"prov:wasDerivedFrom"--> v3 v3 --"p:reference/P248"--> c6 v2 --"p:statement/value/P625"--> v4 v4 --"wikibase:geoLatitude"--> v5 v4 --"wikibase:geoLongitude"--> v6 subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v1 -."p:direct/P31".-> v7 end subgraph optional1["(optional)"] style optional1 fill:#bbf,stroke-dasharray: 5 5; v1 -."p:direct/P131".-> v8 v8 --"p:direct/P31"--> c12 end subgraph optional2["(optional)"] style optional2 fill:#bbf,stroke-dasharray: 5 5; v8 -."p:direct/P4335".-> v9 end subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c15 --"wikibase:language"--> c17 end