-
-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
translation: QS ---> wikibase-edit JSON #64
Comments
could you provide a sample of the QS JSON, with annotation of how it should be interpreted if there is anything non-trivial? (I have not worked with QS much, so I do need some guidance) |
It is not JSON but a simple command language made for the purpose, please see https://www.wikidata.org/wiki/Help:QuickStatements#Command_sequence_syntax |
This is exactly what I'm looking for! I'm developing a WikiCite (a Wikidata project) plugin for the reference management software Zotero, and I would like to provide a way of creating new Wikidata entities from Zotero items. Right now there is this QuickStatements translator that translates a Zotero item into QuickStatements commands. Having a way to translate these QS commands into wikibase-edit JSON, as suggested in this issue, would be ideal. This PHP file, from QuickStatements source code, takes care of converting QS commands into MediaWiki API actions. I wonder if it may be useful to create the JS tool proposed. |
I started experimenting in a separate repo https://github.com/maxlath/quickstatements-to-wikibase-edit :
|
Amazing! This is exactly what I was looking for. I installed it through npm and tried it with a simple set of QS commands returned by Zotero's QuickStatements export translator:
However, I couldn't debug it because I may not have time to implement this new feature immediately, but I have already posted an issue in my plugin's repository to keep track of this and use it as soon as possible. Thanks!! |
@diegodlh could you provide a sample of the input that fails to be converted? |
I finally found the time to look into this more closely today. I submitted a PR that seems to fix it. With this fix, and other time-value-related fixes, I'm using this package in Cita and it seems to work like a charm to convert QuickStatements commands for basic publications (journal articles, etc) into a JSON that wikibase-edit can understand. Thank you!! |
QuickStatements commands can be translated to JSON that is fed to the
wd ee --batch
(or create-entity) commaand by the user. Some commands may need an automated SPARQL query before translation. Still, such a tool would be valuable, if not for the reason that QS needs to be fixed, and no one wants to fix PHP.The text was updated successfully, but these errors were encountered: