I’m working on an implementation that requires assigning rdf:type
based upon a value in the data.
Example:
ID,Species
1,Rat
2,Eagle
ID-1 should be assigned type as "Animal" and ID-2 should be assigned type as "Bird".
I’m stuck with the conditional mapping. I tried this YARRRML mapping:
- p: a
o:
value: http://example.com/Animal
condition:
function: idlab-fn:equal
parameters:
- [grel:valueParameter, $(Species)]
- [grel:valueParameter2, "Rat"]
The problem might be that the condition is defined at the object instead of one level higher (see https://rml.io/yarrrml/spec/#conditions), the following seems to work (tested on Matey)