Wikidata:Bar/Archive/2020/02

From Wikidata
Jump to navigation Jump to search
This page is an archive. Please do not modify it. Use the current page, even to continue an old discussion.

Premi strega

Buongiorno a tutti, Volevo dirvi che stavo giocando un po' con Wikidata Query Service ed ho creato una query per estrarre i dati riguardanti i vincitori del premio Strega.

SELECT ?item ?title ?autoreLabel ?pubblicazione ?data_premio_strega ?genreLabel ?casa_editriceLabel ?itemLabel WHERE {
  ?item  wdt:P166 wd:Q731542. #premio ricevuto è premio strega
  SERVICE wikibase:label { bd:serviceParam wikibase:language "en". }
  FILTER ( ?istanza != wd:Q5 ) #non è un umano (il premio su wikidata è assegnato sia ai libri vincitori che agli autori). Ci deve essere un modo migliore di selezionare solo i libri ma non l'ho trovato
  FILTER ( ?tipopremio = wd:Q731542 ) #il premio è premio strega (questo l'ho dovuto inserire altrimenti ricevevo tutti i premi
  OPTIONAL { ?item p:P166 ?premio . ?premio pq:P585 ?data_premio_strega ; ps:P166 ?tipopremio } #questo artifizio serve per estrarre solo il dato di anno di assegnazione del premio (che spesso è diverso dalla data di pubblicazione)
  
  OPTIONAL { ?item wdt:P577 ?pubblicazione. } #anno di pubblicazione
  OPTIONAL { ?item wdt:P31 ?istanza. }  #l'istanza su cui fare la query
  OPTIONAL { ?item wdt:P50 ?autore. }  #nome dell'autore
  OPTIONAL { ?item wdt:P136 ?genre. }  #genere del libro
  OPTIONAL { ?item wdt:P123 ?casa_editrice. } #casa editrice
  OPTIONAL { ?item wdt:P1476 ?title } #titolo originale
}

 ORDER BY ?data_premio_strega #ordinato per data di assegnazione del premio (non per data di pubblicazione)
Try it!

Se avete consigli da darmi, sarei felicissimo.

Luckyz (talk) 10:22, 27 January 2020 (UTC)

@Luckyz:

SELECT
  ?item ?itemLabel 
  (GROUP_CONCAT(DISTINCT ?autoreLabel; separator=", ") as ?autoreLabel_ )
  (MIN(YEAR(?pubblicazione)) as ?pubblicazione_ ) 
  (MIN(YEAR(?data_premio_strega)) as ?data_premio_strega_ ) 
  (GROUP_CONCAT(DISTINCT ?genreLabel; separator=", ") as ?genreLabel_ ) 
  (GROUP_CONCAT(DISTINCT ?casa_editriceLabel; separator=", ") as ?casa_editriceLabel_ ) 
WHERE
{
    BIND( wd:Q731542 as ?tipopremio )
    ?item  wdt:P166 ?tipopremio. MINUS { ?item wdt:P31 wd:Q5 } 
#alternativa2:  ?item  wdt:P166 ?tipopremio . hint:Prior hint:runFirst true . ?item  wdt:P31/wdt:P279* wd:Q47461344 . 
#alternativa:   ?autore p:P166 ?st . ?st pq:P1686 ?item ; ps:P166 ?tipopremio . ?autore wdt:P31 wd:Q5 .
    OPTIONAL { ?item p:P166 ?premio . ?premio pq:P585 ?data_premio_strega ; ps:P166 ?tipopremio } 
    OPTIONAL { ?item wdt:P577 ?pubblicazione. } 
    OPTIONAL { ?item wdt:P50 ?autore }  #nome dell'autore
    OPTIONAL { ?item wdt:P136 ?genre }  #genere del libro
    OPTIONAL { ?item wdt:P123 ?casa_editrice } #casa editrice
    SERVICE wikibase:label { bd:serviceParam wikibase:language "it,[AUTO_LANGUAGE],en" .
                           # necessario per GROUP BY/GROUP_CONCAT: 
                           ?item rdfs:label ?itemLabel .
                           ?autore rdfs:label ?autoreLabel .
                           ?genre rdfs:label ?genreLabel .
                           ?casa_editrice rdfs:label ?casa_editriceLabel . 
                           }
}
GROUP BY ?item ?itemLabel 
ORDER BY ?data_premio_strega

Try it!

Nice query. I did a few tweaks above. "GROUP BY" avoids multiple lines due to multiple values for some properties, notably genre (P136) and publisher (P123).

If you have questions in Italian about the changes, I can try to answer them in English. BTW there is Wikidata:Request_a_query with some specialists commenting. --- Jura 12:36, 28 January 2020 (UTC)

Super! Thanks --Luckyz (talk) 13:03, 28 January 2020 (UTC)


History of the books

Hi, do you think it might be right to use the two items for "History of the book": Q15873402 and Q998434?--Alessandra Boccone (talk) 07:29, 4 February 2020 (UTC)

Questo bar è in italiano. Ho unito i due elementi fino dove è possibile (dopo aver notato che la wikipedia in inglese aveva creato un redirect dall'uno all'altro). Non è stato possibile completare l'Help:Merge/it perché nella wikipedia in finlandese esistono due voci distinte: w:fi:Kirjahistoria (invenzione della stampa) e w:fi:Kirjojen historia (disciplina accademica). --Luckyz (talk) 08:05, 4 February 2020 (UTC)

Additional interface for edit conflicts on talk pages

Sorry, for writing this text in English. If you could help to translate it, it would be appreciated.

You might know the new interface for edit conflicts (currently a beta feature). Now, Wikimedia Germany is designing an additional interface to solve edit conflicts on talk pages. This interface is shown to you when you write on a discussion page and another person writes a discussion post in the same line and saves it before you do. With this additional editing conflict interface you can adjust the order of the comments and edit your comment. We are inviting everyone to have a look at the planned feature. Let us know what you think on our central feedback page! -- For the Technical Wishes Team: Max Klemm (WMDE) 14:15, 26 February 2020 (UTC)