query-664cd64295def236c8fbb92ad8aa3c5b
Consulta SPARQL per fer consultes de llocs:
Use at
- https://query.wikidata.org/sparql
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
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 ?itemDescription ?que ?whatLabel ?queLabel ?muniLabel ?coor ?municatLabel
WHERE
{
{
SELECT ?item
WHERE {
?item wdt:P131* wd:Q12752;
} }VALUES ?que { wd:Q3055118 }
# VALUES ?que {wd:Q15303838} #capital municipal
# VALUES ?que {wd:Q121289819 wd:Q15303838} #capital municipal
# VALUES ?que {wd:Q1484611 wd:Q181307 wd:Q11954567} #veïnats...
# VALUES ?que { wd:Q674950 } #urbanització
# VALUES ?que { wd:Q15303838 } #capital municipal
# VALUES ?que { wd:Q486972 wd:Q3055118 wd:Q8776398 wd:Q15303838 wd:Q532 wd:Q3957 wd:Q515 wd:Q11939023 wd:Q674950 wd:Q16557344 wd:Q1484611 wd:Q181307 wd:Q11954567 wd:Q350895}
?item p:P31/ps:P31 ?que.
# ?que wdt:P279* wd:Q486972
# wdt:P31 ?what;
OPTIONAL { ?item wdt:P131 ?muni}
OPTIONAL { ?item wdt:P625 ?coor}
OPTIONAL { ?item wdt:P1376 ?municat }
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE]". }
}
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v4("?coor"):::projected
v1("?item"):::projected
v3("?muni")
v5("?municat")
v2("?que"):::projected
a1((" "))
c8(["bd:serviceParam"]):::iri
c10(["#91;AUTO_LANGUAGE#93;"]):::literal
c2(["wd:Q12752"]):::iri
v1 --"p:direct/P131"--> c2
bind0[/VALUES ?que/]
bind0-->v2
bind00(["wd:Q3055118"])
bind00 --> bind0
v1 --"p:P31"--> a1
a1 --"p:statement/P31"--> v2
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v1 -."p:direct/P131".-> v3
end
subgraph optional1["(optional)"]
style optional1 fill:#bbf,stroke-dasharray: 5 5;
v1 -."p:direct/P625".-> v4
end
subgraph optional2["(optional)"]
style optional2 fill:#bbf,stroke-dasharray: 5 5;
v1 -."p:direct/P1376".-> v5
end
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c8 --"wikibase:language"--> c10
end