Open TS404 opened 4 years ago
I'm checking how this can be done. The COVID-19 Wikidata item already exists (https://www.wikidata.org/wiki/Q84263196) and inside it you have different things.
First, you have a series of 'statements' identified by a specific property numner (i.e. 'instance of' P31) and each of them lists a serires of other Wikidata items (i.e. 'disease' Q12136).
Then we have 'identifiers', where we have again properties but that only list one ID (not a Wikidata item).
And at the end we have all the pages on that item in all Wikimedia foundation projects.
My question is: what do you want to be able to edit? Everything? Or just statements and identifiers? This is crucial as we need to think about a way to possibly structure the queries.
Hmm, ideally everything, since being able to edit aliases and descriptions would be useful. However the two highest priority capabilities would be:
Backup option: outputting Quickstatments tables. Relevant issue link.
The QS API and its token system are detailed here (if you are logged into QS)
@magnusmanske, could you confirm what the relevant quickstatements API format is?
I think I've found it:
Will do some tests and then try to implement in [R]
Successful first test (using token code as per my QS userpage)!
https://tools.wmflabs.org/quickstatements/api.php
?action=import
&submit=1
&username=Evolution_and_evolvability
&token=[the token code as per my QS userpage]
&format=v1
&data=Q89093122%09P7347%09%22https:%2F%2Fen.wikiversity.org%2Fwiki%2FTalk:WikiJournal_of_Medicine%2FEpidemiology_of_the_Hepatitis_D_virus%22
&batchname=ts_API_test1
Resulting in this batch being correctly implemented.
The new API almost works (now committed to wikiPackageTesting.R). There seem to currently be some problems with qualifiers submitted via the API. When the exact same submission is made via the API it returns errors, whereas submitted as a table via the website it runs fine:
I've also added a query about this at Wikidata Help_talk:QuickStatements. Next requirement will be proper handling of CREATE and LAST capabilities.
There s a current capability gap in the WikidataR package in that it can only read from, not write to wikidata. This will be a key and valuable feature. I've also added a note at that repo.