query-115c345222b7f80fb9f86210d1916687

rq turtle/ttl

Categories de nascuts o relacionats amb comarques, estats, comunitats, províncies, etc.

Només agafa una selecció de llocs que se suposa que majoritàriament hem de tenir.

SELECT DISTINCT ?tipus ?tipusLabel ?lloc ?llocLabel ?cat ?categoria WHERE { VALUES ?tipus {wd:Q937876 wd:Q766277 wd:Q15089 wd:Q6465 wd:Q5107 wd:Q3624078 wd:Q10742 wd:Q35657 wd:Q1221156 wd:Q697390} ?lloc wdt:P31 ?tipus. OPTIONAL { ?lloc wdt:P1464|wdt:P1792 ?cat. OPTIONAL { ?categoria schema:about ?cat. ?categoria schema:isPartOf https://ca.wikipedia.org/. } } SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],ca,en,es" . } } ORDER BY ?tipusLabel ?llocLabel

Use at

PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX schema: <http://schema.org/>
PREFIX bd: <http://www.bigdata.com/rdf#>
# Categories de nascuts o relacionats amb comarques, estats, comunitats, províncies, etc.
# Només agafa una selecció de llocs que se suposa que majoritàriament hem de tenir.
SELECT DISTINCT ?tipus ?tipusLabel ?lloc ?llocLabel ?cat ?categoria
WHERE {
    VALUES ?tipus {wd:Q937876 wd:Q766277 wd:Q15089 wd:Q6465 wd:Q5107 wd:Q3624078 wd:Q10742 wd:Q35657 wd:Q1221156 wd:Q697390}
    ?lloc wdt:P31 ?tipus.
  OPTIONAL {
    ?lloc wdt:P1464|wdt:P1792 ?cat.
  OPTIONAL {
    ?categoria schema:about ?cat.
    ?categoria schema:isPartOf <https://ca.wikipedia.org/>.
  }
  }
SERVICE wikibase:label {
bd:serviceParam wikibase:language "[AUTO_LANGUAGE],ca,en,es" . } 
}
ORDER BY ?tipusLabel ?llocLabel

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v5("?cat"):::projected v6("?categoria"):::projected v4("?lloc"):::projected v2("?llocLabel"):::projected v3("?tipus"):::projected v1("?tipusLabel"):::projected c8(["bd:serviceParam"]):::iri c6([https://ca.wikipedia.org/]):::iri c10(["#91;AUTO_LANGUAGE#93;,ca,en,es"]):::literal bind0[/VALUES ?tipus/] bind0-->v3 bind00(["wd:Q937876"]) bind00 --> bind0 bind01(["wd:Q766277"]) bind01 --> bind0 bind02(["wd:Q15089"]) bind02 --> bind0 bind03(["wd:Q6465"]) bind03 --> bind0 bind04(["wd:Q5107"]) bind04 --> bind0 bind05(["wd:Q3624078"]) bind05 --> bind0 bind06(["wd:Q10742"]) bind06 --> bind0 bind07(["wd:Q35657"]) bind07 --> bind0 bind08(["wd:Q1221156"]) bind08 --> bind0 bind09(["wd:Q697390"]) bind09 --> bind0 v4 --"wdt:P31"--> v3 subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; subgraph union0[" Union "] subgraph union0l[" "] style union0l fill:#abf,stroke-dasharray: 3 3; v4 -."wdt:P1792".-> v5 end subgraph union0r[" "] style union0r fill:#abf,stroke-dasharray: 3 3; v4 --"wdt:P1464"--> v5 end union0r <== or ==> union0l end subgraph optional1["(optional)"] style optional1 fill:#bbf,stroke-dasharray: 5 5; v6 -."schema:about".-> v5 v6 --"schema:isPartOf"--> c6 end end subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c8 --"wikibase:language"--> c10 end