RMLio / RML-Mapper

Generate High Quality Linked Data from multiple originally (semi-)structured data (legacy)
http://RML.io
52 stars 20 forks source link

Transformation breaks when info is not available in the source data? #14

Closed m1ci closed 5 years ago

m1ci commented 7 years ago

Hi,

We have following JSON with an array. However, not always the array (x-tags) is available. When the array is present, the transformation is executed, but the problem is when the array is not present - the execution is interrupted and it does not continue.

Please find bellow the source JSON and the RML mapping. Are we doing smth wrong here or this is "normal" behavior of RML? Thanks!

Source data/JSON:

            "x-tags": [
              "API",
              "API descriptions",
              "API definition",
              "swagger",
              "RAML",
              "WADL",
              "API blueprint",
              "OpenAPI"
            ],

RML mapping:

    rr:predicateObjectMap [
        rr:predicate semapi:assignedTag;
                rr:objectMap 
        [
                        rr:parentTriplesMap <#TagsMapping>
        ]
    ];

<#TagsMapping>

    rml:logicalSource [
        rml:source "data/apis-guru/apis_guru.json";
        rml:referenceFormulation ql:JSONPath ;
        rml:iterator "$.data.versions.[*].info.x-tags"
    ];

    rr:subjectMap [
        rr:template "http://linked-web-apis.fit.cvut.cz/resource/{$}_tag";
    ];

    rr:predicateObjectMap [
        rr:predicate dcterms:title;
        rr:objectMap [
            rml:reference "$"
        ]
    ] .
pheyvaer commented 5 years ago

Hi,

We've updated the RMLMapper and it can now be found here. When the array is not found, the RMLMapper should not crash, but it will also not generate RDF for that entity as no data is available. If you have still issues, you can open a new issue at the repo of the new RMLMapper.