ISSUE-54 (constant-term-map): Simpler constant-valued term maps [R2RML]

ISSUE-54 (constant-term-map): Simpler constant-valued term maps [R2RML]

Raised by: Richard Cyganiak
On product: R2RML

“Constant-valued term maps” are a very simple construct that is used quite frequent in R2RML. I expect them to account for nearly 50% of all term maps.

There are several problems with the current design for constant-valued term maps in R2RML:

1. It's rather verbose. Something so simple shouldn't require several triples and nested nodes.
2. It's inconsistent with other kinds of term maps (column- and template-valued term maps)
3. While a column- or template-based term maps can be re-used in multiple position (as subject, predicate, object, and graph name), this is not possible with constant-valued term maps
4. R2RML defines four different properties for a job that could be done with one property

There are four different kinds of constant-valued term maps, depending on where in the mapping they occur: constant-valued subject maps, predicate maps, object maps, and graph maps.

[] rr:subjectMap [ rr:subject <constant> ].
[] rr:predicateMap [ rr:predicate <constant> ].
[] rr:objectMap [ rr:object <constant> ].
[] rr:graphMap [ rr:graph <constant> ].

It would be simpler if they would all use the same property for expressing the constant part:

[] rr:subjectMap [ rr:constant <constant> ].
[] rr:predicateMap [ rr:constant <constant> ].
[] rr:objectMap [ rr:constant <constant> ].
[] rr:graphMap [ rr:constant <constant> ].

This would simplify spec and implementation, and would be more consistent with the design of other kinds of term maps (column- and template-valued term maps), which use the same property (such as rr:column, rr:template, rr:termType and so on) regardless of whether the term map is a subject map, predicate map etc. This would also make them more re-usable: The same constant-valued term map could now be used both as subject and as object map, as is already possible with column- and template-valued term maps.

Furthermore, adopting this change would free up the terms rr:subject, rr:predicate, rr:object and rr:graph for another, more beneficial use: They could be used as syntactic sugar for quickly establishing constant-valued term maps. So, we could simply write

[] rr:predicate foaf:name.

and it would be syntactic sugar for

[] rr:predicateMap [ rr:constant foaf:name ].

And rr:subject, rr:object and rr:graph would be defined in the same way as shortcuts for establishing a constant-valued subject map, object map or graph map respectively.

Given that constant-valued term maps are so common (especially as predicate maps and graph maps), this would nicely help reduce the verbosity of R2RML.

Received on Monday, 18 July 2011 17:32:12 UTC