Scribe-Data
Scribe-Data copied to clipboard
Use APIs for CLI get command for translations
Terms
- [X] I have searched open and closed feature requests
- [X] I agree to follow Scribe-Data's Code of Conduct
Description
This issue would add the functionality to get translations for a word from Wikidata using either the MediaWiki API or the Wikidata Query Service. Steps incldue:
- Adding
-dt translationsas an option for the CLI forget (g)command if not done already - Allow for an API like the MediaWiki API or the Wikidata Query Service to be used
- We'd need to write a central query for returning translations of a word given that the Wikidata entity has the same label as the one passed passed and that language of the lexeme is also the one passed
scribe-data get -lang English --word bookor something like this :)
Let's discuss this issue post some other issues being finished π
Contribution
@axif0 will be working on this as a part of Outreachy! πΆπ²
- Adding
-dt translationsas an option for the CLI forget (g)command if not done already
Is translations under -dt? I mean our needs are scribe-data get -t language english -dt nouns.
Weren't we saying:
scribe-data get -l English -dt translations
I don't think we need to split translations up based on the current data types. If you get translations, it should be all of them.
Thank you so much for the quick clarification...
Very welcome! :)
As a further step here, @axif0, do we want to save the results of the translations for the user? Checking on what you think would be best for this functionality :)
do we want to save the results of the translations for the user?
Small addition that what should be the output index name? Where should we save it? Along with that, also should we modify the cmd like scribe-data get -t language english -dt nouns -w book ? It just give us only english noun`s translations details for book?
To finalize this, @axif0, let's export a file in the same way that we do for other processes :) We don't need to have the output of the file exported to the terminal π
Via a discussion with @axif0, we need to change over the functionality here to use Wikidata instead of English Wiktionary. We'll either be using the MediaWiki API with wikidata.org as the endpoint, or we'll make use of the Wikidata Query Service. Big thing is that the MediaWiki API might not be able to access the data directly via labels as that would be within query responses and not necessarily a parameter. The query service should work, but writing the queries for this is not direct :)
Unassigning you for now @axif0 as there are more pressing thing to attend to within Scribe-Data and Scribe-Server and we don't have a path forward here yet :)
Blocking this until I'm able to figure out the proper way to derive translations from Wikidata via API requests :)