molgenis / molgenis-emx2

MOLGENIS EMX2, the latest version of the MOLGENIS data platform.
GNU Lesser General Public License v3.0
14 stars 18 forks source link

RDF API: Ensure literal's have a (correct) language tag. #4160

Open svandenhoek opened 3 months ago

svandenhoek commented 3 months ago

Is your feature request related to a problem? Please describe. Best practice is to ensure String literal's define their language. Also FDP v1.2 defines this: https://specs.fairdatapoint.org/fdp-specs-v1.2.html#repositorymetadata

Name of the FAIR Data Point with the language tag.

EMX2 docs state language tags can be adjusted for labels here (not sure how this works in practice though, couldn't quickly find how to change), though a more robust system is probably needed if language should be defined per-column.

Describe the solution you'd like

Describe alternatives you've considered

  1. Leave it as is.

Not really preferred as RDF standards might require language tag.

  1. Simply add @en.

Possible short-term solution while only English is allowed, though this means if a user would add non-English text in the tables, the generated RDF is malformed.

Additional context Current example output:

<http://localhost:8080/my_FDP/api/rdf/Container?id=Example_FDP_catalog_container>
  a My_FDP:Container, qb:Observation, <http://www.w3.org/ns/ldp#DirectContainer>;
  dcterms:title "Example FAIR Data Point catalog container";

Preferred output:

<http://localhost:8080/my_FDP/api/rdf/Container?id=Example_FDP_catalog_container>
  a My_FDP:Container, qb:Observation, <http://www.w3.org/ns/ldp#DirectContainer>;
  rdfs:label "Example_FDP_catalog_container"@en;
  dcterms:title "Example FAIR Data Point catalog container"@en, "Voorbeeld FAIR Data Point catalog container"@nl;
mswertz commented 3 months ago

should we then default this to 'en'?

svandenhoek commented 2 months ago

For now hardcoded language tag or an advanced setting with default language tag seem like the best approach until we run into issues where we need multi-language support inside a single schema.