ISSUE-59 (simple-triples-maps): Syntactic sugar for triples maps that only have a single predicate-object map [R2RML]

ISSUE-59 (simple-triples-maps): Syntactic sugar for triples maps that only have a single predicate-object map [R2RML]

http://www.w3.org/2001/sw/rdb2rdf/track/issues/59

Raised by: Richard Cyganiak
On product: R2RML

Currently, a triples map has exactly one subject map, and then a number of predicate-object maps. However, there is a case that we can expect to see reasonably often where a triples map has exactly one predicate-object map. This is when an n:m link table is mapped to a single set of triples.

In the interest of making simple things simple and hard things possible, this case could be simplified by removing the intermediate predicate-object map node and just sticking its predicate map(s) and object map directly onto the triples map. This yields a much more readable form.

Example:

    Student(s_id, name)
    Course(c_id, title)
    Enrolled(s_id, c_id)

Where Enrolled is the many-to-many relationship. The current R2RML mapping would be:

<#LinkMap_1_2>
    rr:logicalTable [ rr:tableName "enrolled" ];
    rr:subjectMap [ rr:template "http://data.example.com/student/{s_id}" ];
    rr:predicateObjectMap [
        rr:predicateMap [ rr:predicate ex:isEnrolled ];
        rr:objectMap [ rr:template "http://data.example.com/course/{c_id}" ];
    ].

With syntactic sugar, it would become:

<#LinkMap_1_2>
    rr:logicalTable [ rr:tableName "enrolled" ];
    rr:subjectMap [ rr:template "http://data.example.com/student/{s_id}" ];
    rr:predicateMap [ rr:predicate ex:isEnrolled ];
    rr:objectMap [ rr:template "http://data.example.com/course/{c_id}" ].

The spec would say: A triples map MAY have exactly one object map and one or more predicate maps. If these are present, then they form an implicit predicate-object map. This would be a simple change.

This has been proposed by Richard here [1] and seconded by Juan here [2].

[1]: http://lists.w3.org/Archives/Public/public-rdb2rdf-wg/2011Jul/0169.html
[2]: http://lists.w3.org/Archives/Public/public-rdb2rdf-wg/2011Jul/0170.html

Received on Friday, 29 July 2011 18:23:51 UTC