Progetto:Coordinamento/Categorie/Progetto filtro categorie

Da Wikipedia, l'enciclopedia libera.
Vai alla navigazione Vai alla ricerca

Questa pagina è dedicata a raccontare i passi, le evoluzioni, le richieste di pareri, e quanto altro accadrà nel progetto di implementazione del filtro per le wikicategorie.

Nell'ambito di una discussione è nata l’idea di provare a usare le proprietà, disponibili in wikidata, delle voci di wikipedia come base per un filtro liberamente impostabile dal lettore di wikipedia per agevolare l’individuazione delle voci rilevanti, rispetto ai suoi interessi, all’interno di una categoria.

Sfruttando il bando indetto da WMIT per le proposte dal mondo dei volontari è stato richiesto il finanziamento per un progetto di sviluppo dello strumento ipotizzato nella suddetta discussione.

La call, attivata a seguito del bando, ha portato ad individuare come «promettente» la proposta formulata da Wiki-Valley. La proposta è stata positivamente accolta dalla comunità e Wikimedia Italia sta finalizzando le formalità per l'accordo con i proponenti.

Impostazione del perimetro[modifica wikitesto]

La fase di sviluppo finanziata con il bando si propone di produrre un prototipo del filtro che possa funzionare su alcuni tipologie di dati di più facile gestione (ad esempio non considereremo filtri basate sulle coordinate geografiche) e per avere poi una reale possibilità di valutazione "sul campo" si vogliono individuare dei casi d'uso a priori (categoria e tipo di filtro) che possono poi essere messi alla prova. Nel periodo dal 4 al 10 novembre sarà possibile suggerire tali casi d'uso nella pagina di discussione. Wiki Valley e Wikimedia Italia sceglieranno, cercando di mantenere quante più proposte possibili, quelle che nel loro insieme costistuiscono un gruppo abbastanza ampio per avere un prototipo flessibile ma sufficentemente ristretto da rientrare nel budget del progetto.

Il beta-beta-beta prototipo[modifica wikitesto]

Il beta-beta-beta prototipo del futuro filtro è ora disponibile (ndr: chi volesse provarlo deve per ora prima abilitarlo modificando il proprio vector.js copiando la stringa da Utente:Ysogo/vector.js).

Il filtro è per ora disponibile solo nelle categorie Categoria:Velocisti italiani e Categoria:Ostacolisti italiani dove permette di filtrare le voci per sesso, luogo e anno di nascita. Impostando uno o più parametri e avviando la ricerca con l'apposito bottone, l'elenco di voci mostrate si riduce eliminando tutte quelle che non rispettano il filtro. Se una delle informazioni di filtro non fosse disponibile in wikidata, il filtro considera la voce inclusa nella selezione ma la marca con una piccola i colorata nell'elenco. Vi invito a provare lo strumento pur in questa forma embrionale e condividere le vostre impresssioni.

Inoltre vorremmo organizzare il 31 gennaio alle ore 21:00 un video incontro tra quanti sono interessati e i rappresentanti del gruppo di sviluppo dello strumento in modo che possiate riferirgli pareri ed eventuali aspettative.

Segnalo qua, non so se c'é una pagina più adatta: la paginazione cancella il filtro, mentre per quanto riguarda il mostrare le voci con informazioni di filtro mancante sono un po' dubbioso, in alcuni casi potrebbe aver senso, in altri no, sarebbe bello se fosse selezionabile. --ValterVB (msg) 09:48, 13 gen 2022 (CET)[rispondi]
Corretto segnalare qui. Entrambe le cose che hai segnalato sono in lavoro per la beta-beta, questa come beta-beta-beta vuole offrire un primo assaggio per farci capire in che direzione si stanno muovendo con i lavori. Per la precisione non sara' necessario paginare poiche' la prossima versione farà filtro anche sulle voci delle successive pagine mentre per l'ON/OFF dell'opzione per includere gli incerti sarà impostabile a piacere nel quadrato dei criteri.--Ysogo (msg) 18:21, 13 gen 2022 (CET)[rispondi]
In alternativa, il filtro non potrebbe prendere le informazioni dal template bio invece che da Wikidata (nel caso in cui ivi fossero mancanti)? --Mastrocom </> void ClickToInbox(); 19:56, 13 gen 2022 (CET)[rispondi]
Ni, per ora stiamo provando il filtro sulle categorie di persone ma la previsione è di poterlo usare anche per altri generi di categorie (vedi la pagina di discussione di questa stessa pagina) e, pur non essendo direttamente impegnato nello sviluppo, credo che sia poco efficace prevedere il parsing di tutti i possibili template delle varie voci in cui man mano si incapperebbe, credo che sia più efficace portare in wikidata le informazioni mancanti e disponibili nel template sfruttando le apposite categorie di servizio (Categoria:Proprietà assenti su Wikidata)--Ysogo (msg) 20:31, 13 gen 2022 (CET)[rispondi]
Aggiungo una richiesta: avere la possibilità di linkare la categoria con i filtri già preimpostati. Utile in fase di discussione o nei progetti. --ValterVB (msg) 10:42, 6 feb 2022 (CET)[rispondi]

...test the gadget ?[modifica wikitesto]

When log in, go to

  1. Speciale:Preferenze > Gadgets
  2. Check the line "Filtro categorie (BETA)."
  3. Save
  4. Go to a categorie page that has the Template:Category filters like Categoria:Film_commedia_drammatica

...add a filter interface on a category page ?[modifica wikitesto]

add the Template:Category filters to a cateogy page

Example :

{{Category filters
|filters=P21, P19, P569
}}

Property types[modifica wikitesto]

Property types Examples

WikiData Property

and a filtro

SubType Number of values possible Best OOUI input Already integrated

on interface Filtro Categories

translated into SPARQL ?
small cat (=<200 articles) big cats > 200 articles)
Time Date of birth

Property:P569


Categoria:Ostacolisti italiani

with year precision Unlimited NumberInputWidget
with day precision Day < 31

Month < 12

Year Unlimited

Three linked :

DropdownWidget or NumberInputWidget (Day)

DropdownWidget (Month)

NumberInputWidget (Year)

Sélecteur DateInputWidget


ToggleSwitchWidget "Plage" (+infobulle "Rechercher entre deux dates"

Jour-Mois-Année

(Jour-Mois-Année) si plage activée

Time index

Property:P4895

with hour precision
Item (Wikibase entity id) Sex or Gender

Property:P21

Categoria:Ostacolisti italiani

5 or less CheckboxInputWidget
MenuTagMultiselectWidget (inputPosition: outline, allowArbitrary: false)
Approved by (Property:P790)

Place of birth

6 to Unlimited MenuTagMultiselectWidget

(tagLimit: 1)

Text Monolingual text (one different string for each language) name in native language

P1559

Categoria:Premi Nobel nel 1921

Unlimited TextInputWidget (and search for the Italian language)
String (independant from language) Namespace

Property:P2307

P246

Categoria:Elementi_chimici

Unlimited TextInputWidget
Quantity (quantity) Death rate Unlimited NumberInputWidget

To integrate later

  • External identifier (string) (expert mode)
  • ?Globe coordinate (globe coordinate)

Testing categories[modifica wikitesto]

See biggest (most used) categories

See pages using the Template:Category filters

small categories < 200 articles < middle categories < 50 000 Max pages checked : < big categories

Category elementi tested can we see results after one filter (Max pages checked : 5000) (Max pages checked : 50 000)
Persone viventi‏‎ 240,182 ❌for "Padova" in the place of birth. only 4 results (too low), load for 35 seconds 93 / 50 000
Persone senza secolo 72,667 ❌ok 62 for "Roma" in the place of birth. (too low) 572 /50 000
middle categories > 200 articles and < Max pages checked : 50 000
Calciatori italiani 2015 ✔️"Roma" in the place of birth
Film commedia drammatica 2026 ✔️"Francia" in the country
small categories < 200 articles
Ostacolisti italiani 101 ✔️

Configuration :

Bucket size : 100

Max pages checked : 50 000 after 2022-12-10 5000 (before 2022-12-10)

Speed : 100 pages checked per second so for 50 000 pages <=>500 secondes <=> 8 min 20 s

To test : 250 000 pages

Filters values[modifica wikitesto]

text with autocomplete place of birth (P19) Date of birth P569
without optimisation propose all articles from wikipedia
medium opimisation propose only values of the property
best opimisation only values that pages of the categories matches

TODO 2023[modifica wikitesto]

Below is the todo list about bug/features for 2023:

#⃣️-> Priority 1 is highest, 100 is lowest priority. Put highest prority tasks at the top of the table and done tasks at the bottom.

#⃣️

or done ✔️

task Worker Worked days / Working days (estimation)
? BUG https://i.gyazo.com/f95bdfc9e3d3d814755669832ed04e55.mp4 on Categoria:Persone_senza_secolo
5 On large categories warn the user that some requests can overload the server.
Done For string filters, search with partial strings (e.g. search "Albert" and it will find Albert Einstein) Seb 0.5
15 UI/UX Personal configuration page (e.g. Utente:Name/config-filtro.json) with a toggle Personal/General

if json exists then display toggle on category page. public conf will be replaced by person one of just added ? What structure of the Json file ? 1 day for 1st draft

1
20 Indirect item request : be able to use indirect items in requests like "The user enters Birth place = Italy, then return articles whose the birth place is located (P17/P131) in Italy" 2
25 Add a new syntax for dates : P585[precision=day] to specify when we to display the widget DateInputWidget Seb 1
30 UX For input type "range" between 2 numbers like year of birth, display by default the minimum and maximum numbers. And make users test. Check if it's better to Add an indication of minimum/maximum value in the label instead of the input box.

Note : To Translate + Specify in small categories the min/max date inside the category

Mathis

Seb

1
35 Specific short list for the gender : male, female, other, and a supplementary dropdown when the users clicks on "other"

Syntax for the editors: P21[complete-list]

Seb
40 UX When pressing Enter button, launch the research Seb
45 Split by letter and sort by alphabetic order also in large categories all results are shown whatever their 1st letter example : Categoria:Scopritori di asteroidi with place of birth "Londra" : Todo add 1st letter in the result display with JS

Note : Difficult, I need a lot of examples - Seb does search how to obtain the information of the sortkey – a pre-requisite is to obtain the sortkey (specified in the wikitext, either in the category declaration either in DEFAULTSORT parser function) : preliminary research shows that the sortkey seems to be available in the [request] but seems not to be displayed (MW bug or misuse of the API?), then this information must be transfered through the SPARQL query, and we will be able to retrieve it in JS, then we can display the header of the pages.

See Discussioni_progetto:Coordinamento/Categorie/Progetto_filtro_categorie#Ordinamento/Sorting

Mathis +1
50 Proposed items must belongs only to list of page that belongs to the categorie for example : place of birth must show only list of birth places of people of the cateogry and not all the wikidate items. (ON 2022-10-01 it's too long for large categories)

Add middle-size categories which would react like small categories, like preloaded lists (e.g. place of birth limited to items in the category) example for place of birth : Check if it takes a long time for big categories or display a progress bar for some fields...

60 Subcategory inclusions, Search in "n" level subcategories

Possible but we could encounter performance issues. Sébastien will try.

With performance limit on "n"

WV : will need a powerful SPARQL engine.

Seb 1
85 Add a search for qualifiers properties, e.g. P54/P1129 (number of appearances in some sport team)
90 Delay the loading of all/authorised values (level 3) for a given property (getAuthorisedValues): currently the UI is displayed when this result arrives from Wikidata, but the UI should be displayed and when this result arrives then update the widget (but what if the user has already typed something?)
95 For perfomance tests : Refactor the current implementation into a function to be able to switch between the two strategies :
  • for small categories get all data and filter locally
  • for middle and big one do the SPARQL query 100 by 100 (Bucket size)
100 2022-01-32 only for advanced users
  • Link to SPARQL request : example ? Response - Do
  • Link to the Query Builder ?
  • ❓2022-01-05 : two choices for WMIT :
    1. put a link to SPARQL under the intro sentence «Questa categoria contiene le 101 … »
    2. after the first 200 results, put two buttons « Open 200 other results » et « open SPARQL query » and « open Query Builder query »
    • Can we pre-fill the Query Builder query with the current query from the Wikipedia category, to continue the search in a more powerful way ?
      YES: [1] - but you have to decode how to do these URLs

Done tasks[modifica wikitesto]

Below is the todo list about bug/features as used in 2022 (phase 2 🆕)

#⃣️-> Priority 1 is highest, 100 is lowest priority. Put highest prority tasks at the top of the table and done tasks at the bottom.

#⃣️

or done ✔️

Tâches Worker Worked days /

Working days (estimation)

✔️ Very rare case !

For pages that miss a property, display another icon for those which has nos link to wikidata. Example : page Campionato_europeo_individuale_femminile_di_scacchi_2022 (on 2022-10-02) Categoria:Tornei e campionati di scacchi.

+ add legend at the bottom

Note : Seb to integrate the new icon

Mathis

Seb

0.3
✔️ For large categories, Use the progress bar to show loading process Note :
// https://doc.wikimedia.org/oojs-ui/master/js/#!/api/OO.ui.ProgressBarWidget
// new OO.ui.ProgressBarWidget( { progress: 33 } )

/*
1. Récupérer le texte contenu dans l'ID id="category-filter-spinner-text".
2. Séparer le texte en deux avec comme séparateur le "/" (Résultats chargés/Résultats Max)
3. Faire une rêgle de trois afin de ramener les "Résultats chargés" sur un %
4. Changer la valeur du "progress" de l'OOUI par le %
5. Répéter en boucle les étaptes 2 à 4 jusqu'à avoir un progress de 100

Append dans #category-filter-advanced ?
$( '#category-filter-advanced' ).append(
*/
Mathis

Seb

0.75
✔️ Autocompletion for filter textAs per WV suggestion in TO DO (e.g. with P19 Birth place). The final result has to be a Wikidata item, but implement in a manner we can use local-WPIT autocompletion in a first time... and perhaps switch to Wikidata autocompletion in a second time.

Autocompletion will be based on all the pages of Wikipedia and not only places, for example. When using SPARQL autocompletion needs 30 seconds between each letter and possibly it could trigger a time out. There are different strategies depending of server resources and one of the possible strategy is to have server side program pre-compiling lists.

Implémentation autocomplétion : https://it.wikipedia.org/w/rest.php/v1/search/title?q=maint ou https://it.wikipedia.org/w/api.php?action=opensearch&format=json&formatversion=2&search=maint&namespace=0&limit=10

Done (2022-08-05) for the first autocomplete based on Wikipedia.

✔️ for small categories add a toggle on filter interface to display or not items that miss at leat one condition. See Categoria:Ostacolisti_italiani
✔️ Code automation/rewriting

fetch the translations of the item without writing them hard.

Automate so that new properties can be added if their type is already specified.

Add a new property in https://it.wikipedia.org/wiki/Utente:Seb35/common.js

✔️ Add a new type of property easy if the type of the property already exists. Please propose new type properties and Seb will code it. There are 15 different type or properties. https://www.wikidata.org/wiki/Special:ListDatatypes

Voir https://it.wikipedia.org/wiki/Utente:Nicolas_NALLET

[feature] Implement other Wikidata types and possibly subtypes (e.g. for the type Time, we can have a precision to the year or the day, it could be decided by the editor who specify the filters (?))

✔️ Pagination :

If there are more than 200 articles (not tested for the moment), you should probably avoid making a general query on the whole category (it can be very long to query for several thousand pages), we can perhaps be to make the first query on the 200 articles displayed then put a button "Query on the whole category (can be long)" so that the user is warned.

=>Added on 2022-08-05 the splitting of the global request into small requests with a limit (e.g. 100), I added a counter to see the calculation being carried out, but we can also (easily) add the start (e.g. letter H) by modifying getSPARQLResultsWithProgressBar. ~ Seb 2022-08-05


Discussion Mathis/Seb 2022-01-05 : make the request on the first 200 pages, then display a loader, and successively load 200 by 200 the rest of the results until the end. Experiment if 200 is the right number for the speed, try to increase this number. If possible in the SPARQL query, provide the ability to directly access a letter (e.g. 'Z').

The switch between different behaviors could be done by reading, when loading the page, the message “There are X articles displayed out of a total of Y” (selector #mw-pages > p).

    • Should we put the partial results after the sure results at the end?
✔️ Can we show the loading percentage status of a page because is very long for categories having 9000 items like : https://it.wikipedia.org/wiki/Categoria:Calciatori_italiani
  • done ~ Seb 2022-08-05
✔️ Can we create a gadget to facilitate the testing of the functionality. as
✔️ For Wikipedia articles missing the Wikidata link or those missing a criterion, there is now a “?” to indicate that this article may or may not answer the query. Currently (2021-12-10 10:00), as soon as a single criterion is missing on a Wikidata item, the article is marked as follows.
  • To be improved: it would be necessary that these « ? » only appear if the user searches on a criterion on which the article is effectively unknown: for example (given that all the sexes/genders are known) if the user searches for "sex/gender" then there is no will have none « ? », on the other hand (given that there are 3 articles whose date of birth is not known) if the user searches for "date of birth" then there will be 3 « ? ».
    2022-01-05 : Mathis is looking for a better design. Done on 2022-01-05(à proposer à WMIT). Mais utiliser OOUI
    2022-01-07 : the tooltips (?) are now only displayed if the page does not have a requested property in a filter: e.g. we have 4 pages whose place of birth is missing, but if we just ask for the gender then no page has the (?) because we always know it, and if we ask for women born in Bologna we have 2 pages + 3 pages with (?). I clarified the tooltip messages: there is a "page without Wikidata" tooltip that always displays (but it's probably rare) and a "page without searched property" tooltip that displays when needed.
    2022-08-17 works only on small categories

UI[modifica wikitesto]

  • ✅ [bug] With the current design of the search box with position:sticky, when one open the DevTools in the bottom or more generally on small-height screen (or if there are a lot of search filters), one cannot scroll to see the bottom of the search box.

Performance[modifica wikitesto]

  • ✅[feature] Implement one-time request for large categories (at the contrairy of current implementation of preloaded values for the whole category)