kg-construct / rml-core

RML-Core: Main features for RDF generation with RML
https://w3id.org/rml/core/spec
Creative Commons Attribution 4.0 International
12 stars 9 forks source link

Result of expressions should be an array/list instead of set #121

Closed pmaria closed 2 months ago

pmaria commented 6 months ago

Currently the results of expressions are defined as sets.

With additions of rml-cc and rml-lv, and most probably rml-fnml as well, this leads to limitations.

For example, it would not be possible to create a list

( "1"  "1"  "1" ) 

from input data

[
    {
        "values": [
            "1",
            "1",
            "1"
        ]
    }
]

with a mapping like

<#TM> a rml:TriplesMap;
    rml:logicalSource [ ... ] ;
    rml:subjectMap [
        rml:template "e/{$.id}" ;
    ] ;
    rml:predicateObjectMap [
        rml:predicate ex:with ;
        rml:objectMap [
            rml:gather ( [ rml:reference "$.values[*]" ; ] ) ;
            rml:gatherAs rdf:List ;
        ] ;
    ] ;
.

because the result set of rml:reference "$.values[*]" will be ["1"].

Proposal

Change the result of the expressions to be of type array or list.