ontoportal-lirmm / ontologies_linked_data

Models and serializers for ontologies and related artifacts backed by 4store
Other
0 stars 7 forks source link

Add request language to @context #65

Closed syphax-bouazzouni closed 1 year ago

syphax-bouazzouni commented 1 year ago

Requirement

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

We should see in the @context the @language of the request, like in the following

"@context": {
  "@language": "en"
  "@vocab": "http://data.bioontology.org/metadata/",
  "prefLabel": "http://www.w3.org/2004/02/skos/core#prefLabel",
  "synonym": "http://www.w3.org/2004/02/skos/core#altLabel",
  "definition": "http://www.w3.org/2004/02/skos/core#definition",
  "obsolete": "http://www.w3.org/2002/07/owl#deprecated",
  "semanticType": "http://bioportal.bioontology.org/ontologies/umls/hasSTY",
  "cui": "http://bioportal.bioontology.org/ontologies/umls/cui",
  "inScheme": "http://www.w3.org/2004/02/skos/core#inScheme",
  "created": "http://purl.org/dc/terms/created",
  "modified": "http://purl.org/dc/terms/modified"
}

The language value should be

The code that handles this is here : https://github.com/ontoportal-lirmm/ontologies_linked_data/blob/master/lib/ontologies_linked_data/serializers/json.rb#L67

syphax-bouazzouni commented 1 year ago

works for one class (e.g https://data.testportal.lirmm.fr/ontologies/INRAETHES/classes/http%3A%2F%2Fopendata.inrae.fr%2FthesaurusINRAE%2Fc_25056?lang=fr) but not for classes endpoints (e.g https://data.testportal.lirmm.fr/ontologies/INRAETHES/classes?lang=fr)

@haddadzineddine to fix.

haddadzineddine commented 1 year ago

It's already working, but I'm not sure if that's what you had in mind.

image

syphax-bouazzouni commented 1 year ago

For example https://data.testportal.lirmm.fr/ontologies/INRAETHES/classes?language=fr I don't see it

image
syphax-bouazzouni commented 1 year ago

fixed with https://github.com/ontoportal-lirmm/ontologies_linked_data/pull/73