So my Wikidata list-generating bot Listeria has become popular in certain circles, creating and updating lists of artworks, species, or ORCID ID holders. With the introduction of the Wikidata SPARQL service, Wikidata queries are becoming more mainstream, and lists are a logical next step.
At the same time, many Wikipedians lack an awareness of Wikidata, and hesitate to go there and edit. Micro-contributions are a way for people to improve Wikidata without much fuzz, but are “hidden” in external tools.
So I added a little bit of code to Listeria. The output now contains a few minor extras, like class names for table cells. These are then used by JavaScript code to allow adding and editing of information in Listeria table cells, right on Wikipedia. Label, description (where unavoidable), item links, dates, coordinates, strings, and images are supported. Simply add
importScriptURI("//www.wikidata.org/w/index.php?title=User:Magnus_Manske/wd_edit.js&action=raw&ctype=text/javascript");
to your common.js page on Wikipedia, hover over a Listeria-generated table cell, and you will see add/edit options. Clicking on those will open a dialog to find/enter a value, validated through Wikidata itself. Clicking OK adds this information to Wikidata. Done! (Because of the table being static wikitext, your addition will only show after the next Listeria update, but it is already on Wikidata proper.)
The JavaScript code is adaptable, meaning it could be used to let people edit Wikidata-based infoboxes etc. Of course, it would be much more effective to have this enables for all Wikipedia users, and with more Listeria lists around. But for now, I am content with this being a demo, which may inspire “official” functionality be the WMF, in a few years’ time.
13 Comments
I wonder – is it possible to also edit the TITLE of the column? I’ve just installed the script and can edit the cells, but not the heading. For example, in this article (at the time of writing) https://en.wikipedia.org/wiki/List_of_paintings_by_Jacob_van_Ruisdael The column “collection” is in lowercase but it should have a capital “C”. Equally, I’d like to change “Inception” to “Date” which is more normal on Wikipedia. Is this possible?
If you edit the source of the article, see the template parameter at the top saying
|columns=P18,label:Article,P571,P195,P217
By default, the column titles are the property labels, in this case, P571=’inception’. Alter this to
|columns=P18,label:Article,P571:Date,P195,P217
to override the default column title. Detailed instructions here:
https://en.wikipedia.org/wiki/Template:Wikidata_list
Hi WittyLama,
the issue is that lowercase for labels is a convention on wikidata: https://www.wikidata.org/wiki/Help:Label#Capitalization so best thing is that Magnus add the capitalization to his bot rather than making change on wikidata.
BTW, good job Magnus, thanks for your help spreading wikidata to wikipedia!
Thanks Magnus, Sylvain.
I’ve made the change suggested – https://en.wikipedia.org/w/index.php?title=List_of_paintings_by_Jacob_van_Ruisdael&type=revision&diff=680078660&oldid=680074155 I see no difference yet, so I assume the bot will change it the next time it updates?
Good idea Sylvain. Magnus – can you alter the bot to ensure that the first letter of the first word in each label is always capitalised?
@Wittylama The list is updated once every 24h. You can click on “manually update” at the top of the list to force the update now.
I did auto-capitalisation in the beginning, but someone asked me to not do that, because, reasons. Don’t want to get in a capitalisation war 😉
I’ve done the “manual update” now. That worked, thanks. I thought that button meant that I would be “manually” overriding the update system… I suggest changing the label to “refresh table” or something similar.
As for the capitalisation… it’s the Manual of Style that table column headings be in sentence-case (i.e. first letter capitalised) https://en.wikipedia.org/wiki/Wikipedia:Manual_of_Style/Tables#Captions_and_headers If someone doesn’t agree with that they should take it to the discussion page. Otherwise I’d have to manually override the title each time just to change the first letter!
Wonderful to see this override in the query line for the properties (otherwise known as column headings). Great idea to do it this way! I understand about the capitalization – it’s not always desired. The more tuning you can do in the bot setup the better.
Could we please have this functionality in Spanish? https://es.wikipedia.org/w/index.php?title=Plantilla:Wikidata_list&action=edit&redlink=1
@Jane done.
…and used!
I’d love to see this working in el.wikipedia. Please?
You are a god!
@Geraki: I have added el to the daily update cycle.