query-732b446f4f0d978fe469788ec409c86f

rq turtle/ttl

Consultes SPARQL útilsConsulta general per comarques

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 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 ?idescat ?ine ?articleca ?articlees

WHERE
{

{
  SELECT ?item
WHERE {
#  VALUES ?comarques { wd:Q12778 wd:Q12752 wd:Q12762 } # SEL GIR PLE

 # VALUES ?comarques {   wd:Q6904 wd:Q10932 } #AEM GAR
# VALUES ?comarques { wd:Q10930 wd:Q12793 wd:Q15345 wd:Q15346}
# VALUES ?comarques { wd:Q15345}
#  VALUES ?comarques {  wd:Q4895313 } #Lluçanès
#  VALUES ?comarques { wd:Q12733 wd:Q15352 wd:Q12734 wd:Q9035550 } #4 comarques centrals
#  VALUES ?comarques { wd:Q5705 }
#  VALUES ?comarques { wd:Q12600 wd:Q14303 wd:Q13948 }
#  VALUES ?comarques { wd:Q15351 wd:Q15362 wd:Q15355 wd:Q15348 wd:Q15354} #a+b penedès, bcn, baix llog, garraf
#   VALUES ?comarques {wd:Q15360 wd:Q15365 wd:Q15361 wd:Q15368 wd:Q15377 wd:Q12729 wd:Q12732 } #Tarragonès, Alt Camp, Baix Camp, Conca de Barberà, Priorat, Urgell i Garrigues
#  VALUES ?comarques { wd:Q15367 wd:Q15374 wd:Q15376 wd:Q12727 wd:Q12726  wd:Q12728 wd:Q15364 wd:Q12787} #Montsià, Ribera d'Ebre, Terra Alta, Segrià, Noguera, Cerdanya, Pla d'Urgell, Baix Ebre
 VALUES ?comarques { wd:Q12720 wd:Q12723 wd:Q12719 wd:Q12602 wd:Q12704} # Alt Urgell, Pallars Jussà, Pallars Sobirà, Aran, Alta Ribagorça  
 ?item wdt:P131* ?comarques;
       } } 
 VALUES ?que { wd:Q3055118 } #ESP
#       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 }
  OPTIONAL { ?item wdt:P4335 ?idescat  }
  OPTIONAL { ?item wdt:P772 ?ine }
 {?item wdt:P4335 ?idescat }
# MINUS {?item wdt:P31 wd:Q3055118 } 
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE]". }


#OPTIONAL {    ?articleca schema:about ?item;       schema:inLanguage "ca";       schema:isPartOf <https://ca.wikipedia.org/>.   }
 # OPTIONAL {     ?articlees schema:about ?item;       schema:inLanguage "es";       schema:isPartOf <https://es.wikipedia.org/>.   }
  }

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v1("?comarques") v5("?coor"):::projected v7("?idescat"):::projected v8("?ine"):::projected v2("?item"):::projected v4("?muni") v6("?municat") v3("?que"):::projected a1((" ")) c9(["bd:serviceParam"]):::iri c11(["#91;AUTO_LANGUAGE#93;"]):::literal bind0[/VALUES ?comarques/] bind0-->v1 bind00(["wd:Q12720"]) bind00 --> bind0 bind01(["wd:Q12723"]) bind01 --> bind0 bind02(["wd:Q12719"]) bind02 --> bind0 bind03(["wd:Q12602"]) bind03 --> bind0 bind04(["wd:Q12704"]) bind04 --> bind0 v2 --"p:direct/P131"--> v1 bind1[/VALUES ?que/] bind1-->v3 bind10(["wd:Q3055118"]) bind10 --> bind1 v2 --"p:P31"--> a1 a1 --"p:statement/P31"--> v3 subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v2 -."p:direct/P131".-> v4 end subgraph optional1["(optional)"] style optional1 fill:#bbf,stroke-dasharray: 5 5; v2 -."p:direct/P625".-> v5 end subgraph optional2["(optional)"] style optional2 fill:#bbf,stroke-dasharray: 5 5; v2 -."p:direct/P1376".-> v6 end subgraph optional3["(optional)"] style optional3 fill:#bbf,stroke-dasharray: 5 5; v2 -."p:direct/P4335".-> v7 end subgraph optional4["(optional)"] style optional4 fill:#bbf,stroke-dasharray: 5 5; v2 -."p:direct/P772".-> v8 end v2 --"p:direct/P4335"--> v7 subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c9 --"wikibase:language"--> c11 end