User:Uomovariabile/Queries

From Wikidata
Jump to navigation Jump to search

Varie

[edit]

Controlled vocabularies

[edit]

People

[edit]

WikiCite

[edit]

Graphs

[edit]
# Direttori Scuola di agricoltura di Portici
#defaultView:Graph
SELECT ?item ?itemLabel ?itemPicture ?occupation ?occupationLabel ?institution ?institutionLabel 
WHERE
{
  ?item wdt:P108 wd:Q3953372.
  ?item wdt:P106 ?occupation. 
  OPTIONAL {?item wdt:P18 ?itemPicture .}
  VALUES ?institution { wd:Q3953372 }
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
  }
Try it!
  • Pubblicati da un editore (very cute, I don't remember who do this)
  • Autori delle edizioni pubblicate da Tor Books (modifica della precedente query, preferito)
#Autori delle edizioni pubblicate da Tor Books
#defaultView:Graph
SELECT ?publisher ?publisherLabel ?publisherPicture ?author ?authorLabel ?authorPicture
WHERE 
{
  ?item wdt:P31 wd:Q3331189.
  ?item wdt:P123 wd:Q2647037 .
  ?item wdt:P123 ?publisher.
  OPTIONAL {?publisher wdt:P154 ?publisherPicture.}
  ?item wdt:P50 ?author.
   OPTIONAL {?item wdt:P18 ?itemPicture}
   OPTIONAL {?author wdt:P18 ?authorPicture} .

  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }

}
ORDER BY ?author
Try it!

Maps

[edit]

Map of places of residence of accused witches

Lists

[edit]
SELECT DISTINCT ?item ?itemLabel ?iNAT ?POW ?NCBI ?image
WHERE 
{
  ?item wdt:P31 wd:Q16521.
  ?item wdt:P5037 ?POW.
  ?item wdt:P3151 ?iNAT.
  ?item wdt:P685 ?NCBI. 
  ?item wdt:P18 ?image. 
SERVICE wikibase:label { bd:serviceParam wikibase:language "en". }  
}
LIMIT 20
Try it!
# Item con ID autore Edit16 e senza id autore SBN
SELECT ?item ?itemLabel ?edit16ID ?SBNauthorID 
WHERE
{
  ?item wdt:P5492 ?edit16ID. 
  OPTIONAL {?item wdt:P396 ?SBNauthorID. }
  FILTER(!bound(?SBNauthorID))
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
  }
ORDER BY ?itemLabel
Try it!
  • Lista degli sviluppatori di free software ordinati per anno di nascita e con datore di lavoro quando presente
SELECT DISTINCT ?softwareLabel ?developerLabel ?yearofbirth ?employerLabel

WHERE {
  
  ?software wdt:P31 wd:Q341 .
  ?software wdt:P178 ?developer .
  ?developer wdt:P569 ?dateofbirth .
  OPTIONAL {?developer wdt:P108 ?employer .}
  BIND(YEAR(?dateofbirth) AS ?yearofbirth).
  
  SERVICE wikibase:label {
		bd:serviceParam wikibase:language "en" .
    
}
  }
ORDER BY ?yearofbirth
Try it!
  • Biblioteche in Italia
#Libraries in Italy
#defaultView:Map
SELECT DISTINCT ?library ?libraryLabel ?coor ?image
WHERE
{
	?library wdt:P31/wdt:P279* wd:Q7075 . 
	?library wdt:P17 wd:Q38 .
	OPTIONAL { ?library wdt:P625 ?coor }
	OPTIONAL { ?library wdt:P18 ?image }  
	SERVICE wikibase:label { bd:serviceParam wikibase:language "it,en"  }  
}
ORDER BY ?libraryLabel
Try it!
  • Mappa dei luoghi di nascita degli autori di libri in Wikidata con SHARE id
#defaultView:Map
SELECT ?book ?bookLabel ?authorLabel ?SHAREid ?birthplaceLabel ?coord ?lat ?lon

WHERE {
  
  ?book wdt:P31 wd:Q571 .
  ?book wdt:P50 ?author .
  ?author wdt:P19 ?birthplace .
  ?author wdt:P3987 ?SHAREid .
  OPTIONAL {?birthplace wdt:P625 ?coord. }
   OPTIONAL {
    ?birthplace p:P625 ?statement.
    ?statement psv:P625 ?node.
    ?node wikibase:geoLatitude ?lat.
    ?node wikibase:geoLongitude ?lon.
   }
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
LIMIT 2000
Try it!
#Archeologi italiani con VIAF in Wikidata che non hanno voce in it.wiki
#occupation=archeologo
#paese di cittadinanza = Italia
#VIAF ID
# get DOB for ordering.
# look for articles (sitelinks) in italiano ("it")
# but select items with no such article
PREFIX schema: <http://schema.org/>
SELECT ?item ?itemLabel ?dob WHERE {
  ?item wdt:P106 wd:Q3621491.
  ?item wdt:P27 wd:Q38.
  ?item wdt:P214 ?VIAF_ID.
  OPTIONAL { ?item wdt:P569 ?dob. }
  OPTIONAL {
    ?sitelink schema:about ?item.
    ?sitelink schema:inLanguage "it".
  }
  SERVICE wikibase:label { bd:serviceParam wikibase:language "it,en". }
  FILTER(!BOUND(?sitelink))
}
ORDER BY ?dob
LIMIT 4999
Try it!
  • Dipinti nelle collezioni del Louvre che rappresentano un faro
#defaultView:ImageGrid
SELECT ?item ?itemLabel ?object ?objectLabel ?image
WHERE
{
  ?item wdt:P31/wdt:P279* wd:Q3305213 .  
  ?item wdt:P180 ?object .
  ?collection wdt:P195 wd:Q19675 .
  ?object wdt:P279* wd:Q39715 . 
  
  ?item wdt:P18 ?image .
  SERVICE wikibase:label { bd:serviceParam wikibase:language "en" }
}
Try it!

Journals and papers

[edit]
# Articoli pubblicati nel vol. 53 di Cataloging & Classification Quarterly con autore come stringa
SELECT ?item ?itemLabel ?authorstring ?vol
WHERE
{
  ?item wdt:P1433 wd:Q5051313 . # Pubblicato in Cataloging & Classification Quarterly
  ?item wdt:P478 ?vol .
  FILTER(?vol ="53")
  ?item wdt:P2093 ?authorstring. 
  ?item wdt:P577 ?pubdate .
  MINUS {?item wdt:P50 ?author.} 
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
  }
ORDER BY ?item
Try it!
#...
SELECT ?item ?langLabel ?ACNPid ?ref ?ref2Label
WHERE
{
  wd:Q27718342 p:P407 ?statement; 
                p:P6981 ?statement2.
  wd:Q27718342 rdfs:label ?item.
  FILTER (LANG(?item) = "it").
  ?statement ps:P407 ?lang. 
  ?statement2 ps:P6981 ?ACNPid. 
  ?statement prov:wasDerivedFrom ?refnode.
  OPTIONAL {?refnode pr:P854 ?ref. }
  OPTIONAL {?refnode pr:P248 ?ref2.} 
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
  }
Try it!
  • Conteggio journals
#Conteggio scientific journals
SELECT (COUNT(DISTINCT ?journal) AS ?scientificjournal)
WHERE
{
  ?journal wdt:P31/wdt:P279* wd:Q685935 . #istanza di/sottoclasse di pubblicazione periodica specializzata
  }
Try it!
  • Articoli in Wikidata da Arxiv con classificazione cs.DL
#Articoli con classificazione Arxiv (P820) uguale a '''cs.DL'''
SELECT ?item ?itemLabel ?value ?valueLabel
{
?item wdt:P820 ?value .
FILTER (?value ="cs.DL")
SERVICE wikibase:label { bd:serviceParam wikibase:language "it,en"  }    
}
LIMIT 1000
Try it!
SELECT ?journal ?journalLabel ?openeditionID ?mirabelID
WHERE
{
  ?journal wdt:P31 wd:Q5633421 .
  ?journal wdt:P4741 ?openeditionID .
  OPTIONAL {?journal wdt:P4730 ?mirabelID . }
  FILTER(!bound(?mirabelID))
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
  }
Try it!

Useful examples

[edit]

SPARQL endpoints

[edit]

Wikidata status reports

[edit]

Stuff for librarians

[edit]

Check for...

[edit]