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

Support Multilingual: Read one language from request parameter #63

Closed
4 tasks done
Tracked by #307
syphax-bouazzouni opened this issue Jan 20, 2023 · 3 comments · Fixed by ontoportal-lirmm/goo#24 or #71
Closed
4 tasks done
Tracked by #307
Assignees

Comments

@syphax-bouazzouni
Copy link

syphax-bouazzouni commented Jan 20, 2023

Use case

INRAETHES has two languages French and English
We will use as use cas in INRAETHES the concept https://stageportal.lirmm.fr/ontologies/INRAETHES?p=classes&conceptid=http%3A%2F%2Fopendata.inrae.fr%2FthesaurusINRAE%2Fc_2ecd2d30
What we have in the data

<rdf:Description rdf:about="http://opendata.inrae.fr/thesaurusINRAE/c_2ecd2d30">
  <rdf:type rdf:resource="http://www.w3.org/2004/02/skos/core#Concept"/>
  <skos:inScheme rdf:resource="http://opendata.inrae.fr/thesaurusINRAE/thesaurusINRAE"/>
  <skos:inScheme rdf:resource="http://opendata.inrae.fr/thesaurusINRAE/mt_98"/>
  <skos:topConceptOf rdf:resource="http://opendata.inrae.fr/thesaurusINRAE/mt_98"/>
  <skos:broader rdf:resource="http://opendata.inrae.fr/thesaurusINRAE/d_1102"/>
  <dct:created rdf:datatype="http://www.w3.org/2001/XMLSchema#dateTime">2022-09-09T10:11:21</dct:created>
  <dct:modified rdf:datatype="http://www.w3.org/2001/XMLSchema#dateTime">2022-09-09T10:14:13</dct:modified>

  # prefLabel
  <skos:prefLabel xml:lang="fr">absorptiométrie biphotonique à rayons X</skos:prefLabel>
  <skos:prefLabel xml:lang="en">dual x-ray absorptiometry</skos:prefLabel>


  # Synonyms
  <skos:altLabel xml:lang="fr">ostéodensitométrie</skos:altLabel>
  <skos:altLabel xml:lang="fr">densitométrie minérale osseuse</skos:altLabel>
  <skos:altLabel xml:lang="en">DXA</skos:altLabel>
  <skos:altLabel xml:lang="en">dual-energy x-ray absorptiometry</skos:altLabel>
  <skos:altLabel xml:lang="en">osteodensitometry</skos:altLabel>
  <skos:altLabel xml:lang="en">bone densitometry</skos:altLabel>
  <skos:altLabel xml:lang="en">DEXA</skos:altLabel>
</rdf:Description>

What we show currently in the API
From https://data.stageportal.lirmm.fr/ontologies/INRAETHES/classes/http%3A%2F%2Fopendata.inrae.fr%2FthesaurusINRAE%2Fc_2ecd2d30

"prefLabel": "dual x-ray absorptiometry",
"synonym": [
		"dual-energy x-ray absorptiometry",
		"osteodensitometry",
		"DXA",
		"bone densitometry",
		"DEXA"
]

What we have in the triple store
From https://data.stageportal.lirmm.fr/ontologies/INRAETHES/classes/http%3A%2F%2Fopendata.inrae.fr%2FthesaurusINRAE%2Fc_2ecd2d30?display=properties

"properties": {
	"http://www.w3.org/2004/02/skos/core#prefLabel": [
		"absorptiométrie biphotonique à rayons X",
		"dual x-ray absorptiometry"
	],
        "http://www.w3.org/2004/02/skos/core#altLabel": [
		"dual-energy x-ray absorptiometry",
		"osteodensitometry",
		"DXA",
		"bone densitometry",
		"DEXA",
		"densitométrie minérale osseuse",
		"ostéodensitométrie"
	],
	"http://www.w3.org/2004/02/skos/core#topConceptOf": [
		"http://opendata.inrae.fr/thesaurusINRAE/mt_98"
	],
	"http://www.w3.org/2004/02/skos/core#inScheme": [
		"http://opendata.inrae.fr/thesaurusINRAE/mt_98",
		"http://opendata.inrae.fr/thesaurusINRAE/thesaurusINRAE"
	],
	"http://purl.org/dc/terms/created": [
		"2022-09-09T10:11:21"
	],
	"http://www.w3.org/2004/02/skos/core#broader": [
		"http://opendata.inrae.fr/thesaurusINRAE/d_1102"
	],
	"http://www.w3.org/1999/02/22-rdf-syntax-ns#type": [
		"http://www.w3.org/2004/02/skos/core#Concept",
		"http://www.w3.org/2002/07/owl#NamedIndividual"
	],
	"http://purl.org/dc/terms/modified": [
		"2022-09-09T10:14:13"
	]
},

The target state (phase one)

1- Default portal language (done) :

From https://data.stageportal.lirmm.fr/ontologies/INRAETHES/classes/http%3A%2F%2Fopendata.inrae.fr%2FthesaurusINRAE%2Fc_2ecd2d30
We show the prefLabel and synonyms of the default portal language (english), as already done now

2- Add request language parameter:

If we call this https://data.stageportal.lirmm.fr/ontologies/INRAETHES/classes/http%3A%2F%2Fopendata.inrae.fr%2FthesaurusINRAE%2Fc_2ecd2d30?lang=fr

we should display this in the API

"prefLabel": "absorptiométrie biphotonique à rayons X",
"synonym": [
		"densitométrie minérale osseuse",
		"ostéodensitométrie"
]

If we call this https://data.stageportal.lirmm.fr/ontologies/INRAETHES/classes/http%3A%2F%2Fopendata.inrae.fr%2FthesaurusINRAE%2Fc_2ecd2d30?lang=en

we should display this in the API (current default)

"prefLabel": "dual x-ray absorptiometry",
"synonym": [
		"dual-energy x-ray absorptiometry",
		"osteodensitometry",
		"DXA",
		"bone densitometry",
		"DEXA"
]

TODO

@syphax-bouazzouni
Copy link
Author

as reference an example of a JSON-LD
image

@syphax-bouazzouni
Copy link
Author

Deployed in production in ontoportal-lirmm/bioportal_web_ui#240

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment