User:Epìdosis/Queries/Exp


SPARQL edit

 
Punti da trattare


  1. SELECT, WHERE, tripla modello, prefissi, punteggiatura, maiuscole, autocompletamento, uso del #
  2. SERVICE wikibase:label
  3. ORDER BY, ORDER BY ASC, ORDER BY DESC
  4. LIMIT
  5. condizioni aggiuntive
  6. DISTINCT
  7. MINUS
  8. UNION
  9. OPTIONAL
  10. ricorsività con *

poi ...

  1. rank (classificazione)
  2. qualificatori
  3. riferimenti
  4. sitelink
  5. COUNT
  6. HAVING
  7. REGEX
  8. FILTER

ecc.

Treccani (base) edit

SELECT ?item ?treccani
WHERE {
  ?item wdt:P3365 ?treccani .
}
Try it!

Treccani (con etichette) edit

SERVICE wikibase:label
SELECT ?item ?itemLabel ?treccani
WHERE {
  ?item wdt:P3365 ?treccani .
  SERVICE wikibase:label { bd:serviceParam wikibase:language "it,en" . }
}
Try it!

Treccani (con etichette, ordinato) edit

ORDER BY
ORDER BY ASC
ORDER BY DESC
SELECT ?item ?itemLabel ?treccani
WHERE {
  ?item wdt:P3365 ?treccani .
  SERVICE wikibase:label { bd:serviceParam wikibase:language "it,en" . }
}
ORDER BY DESC(?treccani)
Try it!


Treccani (con etichette, limitato) edit

LIMIT
SELECT ?item ?itemLabel ?treccani
WHERE {
  ?item wdt:P3365 ?treccani .
  SERVICE wikibase:label { bd:serviceParam wikibase:language "it,en" . }
}
LIMIT 1000
Try it!

Treccani (persone italiane) edit

più condizioni
SELECT ?person ?personLabel ?treccani
WHERE {
  ?person wdt:P3365 ?treccani .
  ?person wdt:P31 wd:Q5 .
  ?person wdt:P27 wd:Q38 .
  SERVICE wikibase:label { bd:serviceParam wikibase:language "it,en" . }
}
LIMIT 1000
Try it!

Treccani (persone non italiane) edit

MINUS
SELECT ?person ?personLabel ?treccani
WHERE {
  ?person wdt:P3365 ?treccani .
  ?person wdt:P31 wd:Q5 .
  MINUS { ?person wdt:P27 wd:Q38 . }
  SERVICE wikibase:label { bd:serviceParam wikibase:language "it,en" . }
}
Try it!

Treccani (persone dell'Italia unita) edit

UNION
SELECT ?person ?personLabel ?nationLabel ?treccani
WHERE {
  ?person wdt:P3365 ?treccani .
  ?person wdt:P31 wd:Q5 .
  { ?person wdt:P27 wd:Q38 . } UNION { ?person wdt:P27 wd:Q172579 . }
  ?person wdt:P27 ?nation .
  SERVICE wikibase:label { bd:serviceParam wikibase:language "it,en" . }
}
Try it!

Treccani + opz. EI (persone dell'Italia unita) edit

OPTIONAL
SELECT ?person ?personLabel ?nationLabel ?treccani ?ei
WHERE {
  ?person wdt:P3365 ?treccani .
  OPTIONAL { ?person wdt:P4223 ?ei . }
  ?person wdt:P31 wd:Q5 .
  { ?person wdt:P27 wd:Q38 . } UNION { ?person wdt:P27 wd:Q172579 . }
  ?person wdt:P27 ?nation .
  SERVICE wikibase:label { bd:serviceParam wikibase:language "it,en" . }
}
Try it!

Treccani + opz. EI (persone dell'Italia unita nate in Toscana) edit

ricorsivo (*)
SELECT ?person ?personLabel ?nationLabel ?birthplace ?birthplaceLabel ?treccani ?ei
WHERE {
  ?person wdt:P3365 ?treccani .
  OPTIONAL { ?person wdt:P4223 ?ei . }
  ?person wdt:P31 wd:Q5 .
  { ?person wdt:P27 wd:Q38 . } UNION { ?person wdt:P27 wd:Q172579 . }
  ?person wdt:P27 ?nation .
  ?person wdt:P19 ?birthplace .
  ?birthplace wdt:P131* wd:Q1273 .
  SERVICE wikibase:label { bd:serviceParam wikibase:language "it,en" . }
}
Try it!

Treccani + opz. EI (persone dell'Italia unita nate in Toscana su mappa) edit

SELECT ?person ?personLabel ?nationLabel ?birthplace ?birthplaceLabel ?coord ?treccani ?ei
WHERE {
  ?person wdt:P3365 ?treccani .
  OPTIONAL { ?person wdt:P4223 ?ei . }
  ?person wdt:P31 wd:Q5 .
  { ?person wdt:P27 wd:Q38 . } UNION { ?person wdt:P27 wd:Q172579 . }
  ?person wdt:P27 ?nation .
  ?person wdt:P19 ?birthplace .
  ?birthplace wdt:P131* wd:Q1273 .
  ?birthplace wdt:P625 ?coord .
  SERVICE wikibase:label { bd:serviceParam wikibase:language "it,en" . }
}
Try it!

Treccani + opz. EI e immagine (persone dell'Italia unita nate in Toscana con data di nascita) edit

SELECT ?person ?personLabel ?nationLabel ?birthplace ?birthplaceLabel ?birthdate ?image ?treccani ?ei
WHERE {
  ?person wdt:P3365 ?treccani .
  OPTIONAL { ?person wdt:P4223 ?ei . }
  ?person wdt:P31 wd:Q5 .
  { ?person wdt:P27 wd:Q38 . } UNION { ?person wdt:P27 wd:Q172579 . }
  ?person wdt:P27 ?nation .
  ?person wdt:P19 ?birthplace .
  ?birthplace wdt:P131* wd:Q1273 .
  ?person wdt:P569 ?birthdate .
  OPTIONAL { ?person wdt:P18 ?image . }
  SERVICE wikibase:label { bd:serviceParam wikibase:language "it,en" . }
}
Try it!

Vecchio materiale edit

#title:Autori latini presenti in almeno uno tra PHI Latin Texts, Musisque Deoque e DigilibLT
SELECT ?item ?it ?la
 (GROUP_CONCAT(DISTINCT ?phi1; separator=", ") as ?phi)
 (GROUP_CONCAT(DISTINCT ?digilib1; separator=", ") as ?digilib)
 (GROUP_CONCAT(DISTINCT ?mqdq1; separator=", ") as ?mqdq)
 (GROUP_CONCAT(DISTINCT ?dll1; separator=", ") as ?dll)
 (GROUP_CONCAT(DISTINCT ?perseus1; separator=", ") as ?perseus)
 (GROUP_CONCAT(DISTINCT ?corpuscorporum1; separator=", ") as ?corpuscorporum)
 (GROUP_CONCAT(DISTINCT ?viaf1; separator=", ") as ?viaf)
 (GROUP_CONCAT(DISTINCT ?isni1; separator=", ") as ?isni)
WHERE
{
   { ?item wdt:P6941 ?phi1 . } UNION { ?item wdt:P6862 ?digilib1 . } UNION { ?item wdt:P6999 ?mqdq1 . }
   OPTIONAL { ?item wdt:P8122 ?dll1 . }
   OPTIONAL { ?item wdt:P7041 ?perseus1 . }
   OPTIONAL { ?item wdt:P7935 ?corpuscorporum1 . }
   OPTIONAL { ?item wdt:P214 ?viaf1 . }
   OPTIONAL { ?item wdt:P213 ?isni1 . }
   ?item rdfs:label ?it . FILTER(LANG(?it) = 'it') .
   ?item rdfs:label ?la . FILTER(LANG(?la) = 'la') .
}
GROUP BY ?item ?it ?la
ORDER BY ?it
Autori latini presenti in almeno uno tra PHI Latin Texts, Musisque Deoque e DigilibLT