User:Alexmar983/Queries

From Wikidata
Jump to navigation Jump to search

Manca P17[edit]

#defaultView:Map
SELECT ?item ?itemLabel ?itemDescription ?coord
WHERE {
  wd:Q2044 wdt:P625 ?center
  SERVICE wikibase:around {
  ?item wdt:P625 ?coord .
  bd:serviceParam wikibase:center ?center .
  bd:serviceParam wikibase:radius "30" . }
  MINUS {?item wdt:P17 ?country}
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],it,en". }
}
Try it!

Manca P31 e P131[edit]

#defaultView:Map
SELECT ?item ?itemLabel ?coord
WHERE {
  wd:Q157762 wdt:P625 ?center
  SERVICE wikibase:around {
  ?item wdt:P625 ?coord .
  bd:serviceParam wikibase:center ?center .
  bd:serviceParam wikibase:radius "130" . }
  MINUS { ?item wdt:P131 ?adm . }
  MINUS { ?item wdt:P31 ?inst . }
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],it,en". }
}
Try it!


Provincia di Pistoia[edit]

Mappa di tutto ciò che è in Province of Pistoia (Q16245) in base alla located in the administrative territorial entity (P131); mostra in blu gli elementi che hanno Google Maps Customer ID (P3749) e in arancione quelli che non ce l'hanno (con possibilità di visualizzare solo gli uni o gli altri); modificando "gmp" in "geo" nella riga con BIND si può applicare alla GeoNames ID (P1566).

#defaultView:Map
SELECT ?item ?itemLabel ?itemDescription ?coord ?gmp ?gkg ?geo ?ind ?com ?wlm ?layer
WHERE {
  ?item (wdt:P131)* wd:Q16245 . 
  MINUS { ?item wdt:P31 wd:Q1134686 . }
  ?item wdt:P625 ?coord . 
  OPTIONAL {?item wdt:P3749 ?gmp}
  OPTIONAL {?item wdt:P2671 ?gkg}
  OPTIONAL {?item wdt:P1566 ?geo}
  OPTIONAL {?item wdt:P969 ?ind}
  OPTIONAL {?item wdt:P373 ?com}
  OPTIONAL {?item wdt:P2186 ?wlm}
  BIND(IF(BOUND(?gmp),'gmp exists','no gmp exists') AS ?layer)
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],it,en". }
}
Try it!

Mappa di tutto ciò che è in Province of Pistoia (Q16245) in base alla located in the administrative territorial entity (P131); mostra in colori diversi gli elementi che hanno sia Google Maps Customer ID (P3749) sia Commons category (P373), quelli che hanno solo una delle due e quelli che non le hanno entrambe (con possibilità di visualizzare solo gli uni o gli altri); ho escluso frazione (Q1134686) e commune of Italy (Q747074) perché non hanno mai un Google Maps Customer ID (P3749).

#defaultView:Map
SELECT ?item ?itemLabel ?itemDescription ?coord ?gmp ?gkg ?ind ?com ?wlm ?layer
WHERE {
  ?item (wdt:P131)* wd:Q16245 . 
  MINUS { { ?item wdt:P31 wd:Q1134686 . } UNION { ?item wdt:P31 wd:Q747074 . } }
  ?item wdt:P625 ?coord . 
  OPTIONAL {?item wdt:P3749 ?gmp}
  OPTIONAL {?item wdt:P2671 ?gkg}
  OPTIONAL {?item wdt:P969 ?ind}
  OPTIONAL {?item wdt:P373 ?com}
  OPTIONAL {?item wdt:P2186 ?wlm}
  BIND(IF(BOUND(?gmp) && BOUND(?com),"gmp & com exist",IF(BOUND(?com),"com exists",IF(BOUND(?gmp),"gmp exists","none"))) AS ?layer)
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],it,en". }
}
Try it!

Mappa di tutto ciò che è in un raggio di 15 km attorno alla Q55652098, che mi pare all'incirca al centro della Province of Pistoia (Q16245) (salvo la zona più a nord), ma è privo di located in the administrative territorial entity (P131); ho escluso human settlement (Q486972) perché sono le tipiche frazioni di ceb.wiki. ✓ Done

#defaultView:Map
SELECT ?item ?itemLabel ?coord
WHERE {
  wd:Q55652098 wdt:P625 ?center
  SERVICE wikibase:around {
  ?item wdt:P625 ?coord .
  bd:serviceParam wikibase:center ?center .
  bd:serviceParam wikibase:radius "15" . }
  MINUS { ?item wdt:P131 ?adm . }
  MINUS { ?item wdt:P31 wd:Q486972 . }
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],it,en". }
}
Try it!


#defaultView:Map
SELECT ?item ?itemLabel ?coord
WHERE { 
  ?item wdt:P131 ?sub1 . 
  ?sub1 (wdt:P131)* wd:Q2028 .
  ?item wdt:P625 ?coord .
  { ?sitelink schema:about ?item . ?sitelink schema:inLanguage "it" }
  SERVICE wikibase:label { bd:serviceParam wikibase:language "it,en" . }
 }
Try it!

Portogallo[edit]

Musei e siti archeologici in Portogallo con/senza Google Maps Customer ID (P3749) e TripAdvisor ID (P3134)

#defaultView:Map
SELECT ?item ?itemLabel ?itemDescription ?inst ?coord ?img ?com ?gmp ?tra ?layer
WHERE {
  ?item wdt:P17 wd:Q45 . 
  ?item wdt:P31 ?inst .
  { ?item (wdt:P31/wdt:P279*) wd:Q33506 . } UNION { ?item wdt:P31 wd:Q839954 . }
  ?item wdt:P625 ?coord . 
  OPTIONAL {?item wdt:P18 ?img}
  OPTIONAL {?item wdt:P373 ?com}
  OPTIONAL {?item wdt:P3749 ?gmp}
  OPTIONAL {?item wdt:P3134 ?tra}
  BIND(IF(BOUND(?gmp) && BOUND(?tra),"gmp & tra exist",IF(BOUND(?tra),"tra exists",IF(BOUND(?gmp),"gmp exists","none"))) AS ?layer)
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],it,en". }
}
Try it!

Fontanelle[edit]

#defaultView:Map
SELECT ?fountain ?fountainLabel ?inst ?instLabel ?coord ?img ?com ?layer
WHERE {
  ?fountain wdt:P31 wd:Q1630622 . 
  ?fountain wdt:P17 wd:Q38 . 
  #?fountain (wdt:P131)* wd:Q1273 . 
  ?fountain wdt:P625 ?coord . 
  OPTIONAL {?fountain wdt:P18 ?img}
  OPTIONAL {?fountain wdt:P373 ?com}
  BIND(IF(BOUND(?img) && BOUND(?com),"img & com exist",IF(BOUND(?com),"com exists",IF(BOUND(?img),"img exists","none"))) AS ?layer)
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],it,en". }
}
Try it!