Skip to content
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

Provide confguration of default language #67

Open
EnricoMi opened this issue Nov 16, 2020 · 0 comments
Open

Provide confguration of default language #67

EnricoMi opened this issue Nov 16, 2020 · 0 comments
Labels
enhancement New feature or request

Comments

@EnricoMi
Copy link
Collaborator

EnricoMi commented Nov 16, 2020

Given a default language or a sequence of them would allow sources to pick only a single string value for multi-language predicates that have a @lang directive. Querying for <predicate>@lang1:lang2:. would pick lang1 first, then lang2, then no language, finally any other language. This make the connector pick certain languages when reading from Dgraph. Predicate name should then not include any language tags. This would work with any source and mode.

This should then allow:

spark.read.option("dgraph.language", "en").dgraph.triples(target).show(false)
subject predicate objectString objectType
1 title Star Wars: Episode IV - A New Hope string
3 title Star Wars: Episode V - The Empire Strikes Back string
6 title Star Wars: Episode VI - Return of the Jedi string
spark.read.option("dgraph.language", "zh").dgraph.triples(target).show(false)
subject predicate objectString objectType
1 title 星際大戰四部曲:曙光乍現 string
3 title 星際大戰五部曲:帝國大反擊 string
6 title 星際大戰六部曲:絕地大反攻 string
spark.read.option("dgraph.language", "de").dgraph.triples(target).show(false)
subject predicate objectString objectType
1 title Krieg der Sterne string
3 title Das Imperium schlägt zurück string
6 title Die Rückkehr der Jedi-Ritter string
@EnricoMi EnricoMi added the enhancement New feature or request label Nov 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant