Scribe-Data icon indicating copy to clipboard operation
Scribe-Data copied to clipboard

Use APIs for CLI get command for translations

Open andrewtavis opened this issue 1 year ago β€’ 10 comments

Terms

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 translations as an option for the CLI for get (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 book or 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! πŸ“ΆπŸš²

andrewtavis avatar Dec 08 '24 23:12 andrewtavis

  • Adding -dt translations as an option for the CLI for get (g) command if not done already

Is translations under -dt? I mean our needs are scribe-data get -t language english -dt nouns.

axif0 avatar Dec 23 '24 07:12 axif0

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.

andrewtavis avatar Dec 23 '24 07:12 andrewtavis

Thank you so much for the quick clarification...

axif0 avatar Dec 23 '24 07:12 axif0

Very welcome! :)

andrewtavis avatar Dec 23 '24 16:12 andrewtavis

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 :)

andrewtavis avatar Jan 04 '25 13:01 andrewtavis

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?

axif0 avatar Jan 04 '25 20:01 axif0

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 😊

andrewtavis avatar Jan 11 '25 15:01 andrewtavis

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 :)

andrewtavis avatar Jan 25 '25 10:01 andrewtavis

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 :)

andrewtavis avatar Mar 16 '25 15:03 andrewtavis

Blocking this until I'm able to figure out the proper way to derive translations from Wikidata via API requests :)

andrewtavis avatar Apr 26 '25 15:04 andrewtavis