ISSUE-55 (nested-maps): Nested predicate-object maps [R2RML]

ISSUE-55 (nested-maps): Nested predicate-object maps [R2RML]

Raised by: Richard Cyganiak
On product: R2RML

There is no good reason for R2RML not to allow nesting of predicate-object maps. This seems like an arbitrary restriction.

It makes writing of mappings harder if the tables are denormalized with respect to the target vocabulary.

The cost of supporting nested predicate-object maps in the spec would be negligible. The cost in implementations would be small, because an implementation could easily convert the nested predicate-object maps into an additional “fake” triples map.


We have a table:

And want a graph of this general structure from each row -- note the target ontology has an explicit class for employment relationships:

[   a biz:EmploymentRelationship;
    biz:employee [
        a biz:Person;
        biz:name ?FNAME;
        biz:staffNo ?STAFFNO
    biz:employer ?EMPLOYER_ID;
Here's the mapping:

[] rr:logicalTable [ rr:tableName "EMPLOYEE" ];
    rr:subjectMap [ rr:class biz:EmploymentRelationship; rr:column "ID"; ]
    rr:predicateObjectMap [
        rr:predicateMap [ rr:predicate biz:employee ];
        rr:objectMap [ rr:class biz:Person; rr:template "employee/{ID}"; rr:termType "IRI" ];
        rr:predicateObjectMap [
            rr:predicateMap [[ rr:predicate biz:name ];
            rr:objectMap [[ rr:column "FNAME" ];
        rr:predicateObjectMap [
            rr:predicateMap [[ rr:predicate biz:staffNo ];
            rr:objectMap [[ rr:column "STAFFNO" ];
    rr:predicateObjectMap [
        rr:predicateMap [ rr:predicate biz:employer ];
        rr:objectMap [ rr:template "organization/{EMPLOYER_ID}"; rr:termType "IRI" ];

Received on Monday, 18 July 2011 17:55:19 UTC