oeg-upm / mapeathor

Translator of spreadsheet mappings into R2RML, RML or YARRRML
https://morph.oeg.fi.upm.es/tool/mapeathor
Apache License 2.0
30 stars 10 forks source link

Get predicate from source sheet #17

Closed nleguillarme closed 3 years ago

nleguillarme commented 3 years ago

Hi.

For my use case, I need to read the Predicate linking two entities (two "subjects") from a source sheet. It was a bit tricky to do that directly with YARRRML but I managed to make it work. I wonder if it is something Mapeathor could do ?

anaigmo commented 3 years ago

Hi,

In Mapeathor two subjects can be linked in the Predicate_Object Sheet, not in the Source sheet. The Subject sheet's purpose is only to declare the subject, what's it's the IRI and class. Linking two subjects falls into creating triples, that is why it is the Predicate_Object Sheet. Two subjects previously declared in the Subject sheet can be linked there, using the columns ID (subject1), predicate, referenceID (subject2), InnerRef and OurterRef (fields in data that have to be equal to perform the link), just as it is shown in the example in the wiki. There is another option to link two subjects "manually" without using these columns, that is writing the IRI of the new subject in the Object column, with 'IRI datatype'.

Hope this answers your question,

Ana

nleguillarme commented 3 years ago

Well, actually what I need to do is to read the predicate field of the Predicate_Object sheet from my input csv file. My data are interspecies interactions records, and my input CSV file looks like that :

ID SUBJECT INTERACTION OBJECT
0 species1 obo:eats species2

With Mapeathor I can create two entities in the Subject sheet, one for species 1, one for species 2.

What I's like to have in the Predicate_Object sheet is something like this :

ID Predicate Object DataType ReferenceID InnerRef OuterRef
SUBJECT {INTERACTION}     OBJECT {ID} {ID}

so that the Predicate field (here the 'eats' interaction) is read from my input file.

anaigmo commented 3 years ago

Ok I see. For now, the tool cannot interpret predicates as rml:reference, it can for rr:template (obo:{INTERACTION}) and constant (obo:eats). I'll incorporate it, thanks for letting me know :)

anaigmo commented 3 years ago

Done