zazuko / xrm

A friendly language for mappings to RDF
MIT License
1 stars 0 forks source link

JSON support for RML & carml #140

Closed ktk closed 1 year ago

ktk commented 1 year ago

Right now XRM supports CSV & XML with the generated RML output. JSON is missing.

IMO the only change required for that would be to support JSON as type in XRM and in this case output rml:referenceFormulation ql:JSONPath; in the generated RML or carml dialect.

Instead of XPath like in JSON we would use JSONpath but they are probably handled completely transparent from an XRM point of you. So my guess is there is no change needed for that?

mchlrch commented 1 year ago

Resolved, xrm version 1.3.0 supports mapping of JSON source

Sample source definition in XRM:

logical-source characters {
    type json
    source "characters.json"
    iterator "$.characters[*]"

    referenceables
        id
        firstname
        lastname
        hair
}

Generated rml:logicalSource:

    rml:logicalSource [
        rml:source "characters.json";
        rml:referenceFormulation ql:JSONPath;
        rml:iterator "$.characters[*]"
    ];