Mat-O-Lab / RDFConverter

Conversion and validation of YARRRML and Chowlk files to RDF. Applied to Material Sciences Methods
http://rdfconverter.matolab.org/
Apache License 2.0
7 stars 0 forks source link

Error in output of parsing RML from yarrrml2rml endpoint #34

Closed horstf closed 2 years ago

horstf commented 2 years ago

Using the example RML rules from here for example with the rmlmapper jar from rml.io, I get the expected mapped rules:

$ java -jar rmlmapper.jar -m rules.rml.ttl
<https://raw.githubusercontent.com/Mat-O-Lab/resources/main/mechanics/data/polymer_tensile/Zugversuch_eng_ETFE-Ref%2BGroesseneffekt2-metadata.json/.%2FAktuelleProbe> <http://purl.obolibrary.org/obo/0010002> "https://raw.githubusercontent.com/Mat-O-Lab/MSEO/main/methods/DIN_EN_ISO_527-3.drawio.ttl/SpecimenName".
<https://raw.githubusercontent.com/Mat-O-Lab/resources/main/mechanics/data/polymer_tensile/Zugversuch_eng_ETFE-Ref%2BGroesseneffekt2-metadata.json/.%2FProbendickeA0> <http://purl.obolibrary.org/obo/0010002> "https://raw.githubusercontent.com/Mat-O-Lab/MSEO/main/methods/DIN_EN_ISO_527-3.drawio.ttl/SpecimenName".
<https://raw.githubusercontent.com/Mat-O-Lab/resources/main/mechanics/data/polymer_tensile/Zugversuch_eng_ETFE-Ref%2BGroesseneffekt2-metadata.json/.%2FProbenbreiteB0> <http://purl.obolibrary.org/obo/0010002> "https://raw.githubusercontent.com/Mat-O-Lab/MSEO/main/methods/DIN_EN_ISO_527-3.drawio.ttl/SpecimenName".

If we use the rules generated through our yarrrml2rml endpoint however, created from this yarrrml file for example, we get the following output:

$ java -jar rmlmapper.jar -m rules.rml.ttl
11:29:56.975 [main] ERROR be.ugent.rml.records.RecordsFactory .getRecords(141) - Referenceformulation http://semweb.mmlab.be/ns/ql#JSONpath is unsupported!
11:29:56.978 [main] ERROR be.ugent.rml.cli.Main               .main(393) - Cannot invoke "be.ugent.rml.records.ReferenceFormulationRecordFactory.getRecords(be.ugent.rml.access.Access, be.ugent.rml.term.Term, be.ugent.rml.store.QuadStore)" because "factory" is null

The problem may be in the different ways the LogicalSource is created. Both use the same JSONPath referenceFormulation. Example File (works):

<http://mapping.example.com/rules_000> a void:Dataset.
:source_000 a rml:LogicalSource;
    rdfs:label "data_columns";
    rml:source "https://raw.githubusercontent.com/Mat-O-Lab/resources/main/mechanics/data/polymer_tensile/Zugversuch_eng_ETFE-Ref%2BGroesseneffekt2-metadata.json";
    rml:iterator "$.tableSchema.columns[*]";
    rml:referenceFormulation ql:JSONPath.
:source_001 a rml:LogicalSource;
    rdfs:label "data_notes";
    rml:source "https://raw.githubusercontent.com/Mat-O-Lab/resources/main/mechanics/data/polymer_tensile/Zugversuch_eng_ETFE-Ref%2BGroesseneffekt2-metadata.json";
    rml:iterator "$.notes[*]";
    rml:referenceFormulation ql:JSONPath.
<http://mapping.example.com/rules_000> void:exampleResource :map_ForceMeasurementInformation_000.
:map_ForceMeasurementInformation_000 rml:logicalSource :source_001;
    a rr:TriplesMap;
    rdfs:label "ForceMeasurementInformation".
:s_000 a rr:SubjectMap.
...

Generated RML (problem):

<#ForceMeasurementInformation_0> a rr:TriplesMap;

    rml:logicalSource [
        a rml:LogicalSource;
        rml:source "https://raw.githubusercontent.com/Mat-O-Lab/resources/main/mechanics/data/polymer_tensile/Zugversuch_eng_ETFE-Ref%2BGroesseneffekt2-metadata.json";
        rml:referenceFormulation ql:JSONpath;
        rml:iterator "$.notes[*]"
    ];
    rr:subjectMap [
        a rr:SubjectMap;
        rr:template "data:{@id}";
    ];
    rr:predicateObjectMap [
        rr:predicateMap [
            a rr:PredicateMap;
            rr:constant obo:0010002;
        ];
        rr:objectMap [
            a rr:ObjectMap;
            rr:constant method:SpecimenName;
        ];
    ].
...