Closed JBPressac closed 2 years ago
Hi @JBPressac
Thanks for reporting this! It should indeed work as you expect. We will fix this.
I looked into this and actually you can't use references to generate datatypes. In other words, it have to be constants. That is due to a limitation in [R2]RML.
Hello, Thank you for your answer. I will find a workaround, then.
Technically speaking we could add this to YARRRML syntax-wise but it wouldn't be executable by an [R2]RML processor.
Hello,
Here is the workaround to select the appropriate datatype (xsd:gYear or xsd:date) for the value of crm:P82_at_some_time_within
according to the value of the $(date_naissance_dtype)
reference:
TimeSpanBirthMapping:
sources: prelib_personne
predicateobjects:
- [a, crm:E52_Time-Span]
- p: crm:P82_at_some_time_within
o: $(date_naissance)
datatype: xsd:gYear
condition:
function: equal
parameters:
- [str1, $(date_naissance_dtype)]
- [str2, 'gYear']
- p: crm:P82_at_some_time_within
o: $(date_naissance)
datatype: xsd:date
condition:
function: equal
parameters:
- [str1, $(date_naissance_dtype)]
- [str2, 'date']
Issue type: :unicorn: Feature
Description
The usage of references to build language tags is working but not the usage of references to build datatypes
For instance, using a reference with
~lang
:generates the rule (this is an extract) :
However, using a reference with
datatype
:generates the following where _date_naissancedtype is not interpreted as a reference:
Why it is useful
Literal datatypes could change for the same object, for instance a date of birth could be of type xsd:gYear or xsd:date. Retrieving the dataype from a source could be helpfull.
Existing features it breaks
List all existing features that this new feature will break.