RMLio / yarrrml-parser

A YARRRML parser library and CLI in Javascript
MIT License
41 stars 17 forks source link

allow datatype: rdf:langString in case language: is given #160

Closed mvanbrab closed 2 years ago

mvanbrab commented 2 years ago

Issue type: :unicorn: Feature

Description

It would be nice if for a language string, the datatype rdf:langString is allowed.

Currently, one has to specify either a datatype or a language (both will not work):

mappings:
  mapping1:
    source:
    - AT01
    s: onddoel:$(@id)
    po:
    - p: skos:prefLabel
      o:
        # will work
        value: $(something1)
        language: nl
    - p: skos:altLabel
      o:
        # won't work
        value: $(something2)
        language: nl
        datatype: rdf:langString

Here won't work means the RMLMapper outputs following error and quits:

datatype rdf:langString requires a language tag

Why it is useful

We're in a situation where we generate the YARRRML file with a tool, that needs the datatype for other purposes too. Now we have to make an exception on rdf:langString, while it seems trivial that the datatype in this case is a rdf:langString.

Existing features it breaks

If the solution is to allow datatype: rdf:langString but not propagate it to the output in case language: is also given, I think this feature doesn't break anything.

pheyvaer commented 2 years ago

@mvanbrab I should be fixed with the changes in this branch. Could you give it a try? Thanks!

mvanbrab commented 2 years ago

@pheyvaer perfect!