Proposal for “per-row blank node maps” in R2RML

I have seen no mail about this so let me ask if we can all agree to
Richard's proposal below (I have cut and pasted from two of his notes and fixed some
of the wording.  Please check.).
Further, will this completely resolve the issue?   Our last and final issue?

Proposal:

     rr:subjectMap [
         rr:termType rr:RowBlankNode;
     ];

• If the term type is rr:BlankNode, then you have to specify how to generate the blank node identifier using rr:column/rr:template/rr:constant. (That's the status quo.)

• If the term type is rr:RowBlankNode, then you don't specify rr:column/rr:template/rr:constant, and you get a fresh blank node for each row. (That's the new part.)


ADD a new Section 7.4 within Section 7, “Creating RDF Terms with Term Maps”:

[[
7.4 Blank Nodes for Each Row of a Logical Table

A per-row blank node map is a term map that generates a fresh blank node for each row of the logical table. In the case of logical tables that contain duplicate rows, this allows generating distinct subjects for the duplicate rows. A per-row blank node map is represented by a resource that has an rr:termType property with value rr:RowBlankNode.

Per-row blank node maps are only allowed as subject maps or object maps.

The referenced columns of a per-row blank node map is the empty set.

Conforming R2RML processors MAY treat R2RML mappings that use per-row blank node maps over R2RML views as an error.

It is possible to define multiple per-row blank node maps over a single logical table. In this case, each of the maps produce distinct blank nodes. In the following example, two unique blank nodes are generated for each logical table row, one as the subject and one of the object of the generated ex:p triples.

     <#map1>  a rr:TriplesMap;
         rr:logicalTable<#someLogicalTable>;
         rr:subjectMap [ rr:termType rr:RowBlankNode; ];
         rr:predicateObjectMap [
             rr:property ex:p;
             rr:objectMap [ rr:termType rr:RowBlankNode; ];
         ];
         .

But in the following example, each generated triple will have the same blank node as subject and object, because the same per-row blank node map is reference as the subject map and object map.

     <#map1>  a rr:TriplesMap;
         rr:logicalTable<#someLogicalTable>;
         rr:subjectMap<#blankNodes>;
         rr:predicateObjectMap [
             rr:property ex:p;
             rr:objectMap<#blankNodes>;
         ];
         .
     <#blankNodes>  rr:termType rr:RowBlankNode.
]]


ADD one line to the definition of “term map”:
http://www.w3.org/2001/sw/rdb2rdf/r2rml/#dfn-term-map

[[
A term map must be exactly one of the following:

	• a constant-valued term map,
	• a column-valued term map,
	• a template-valued term map.
	• a per-row blank node map.<<<  ADD THIS
]]


ADD a new clause to the definition of “generated RDF term”:
http://www.w3.org/2001/sw/rdb2rdf/r2rml/#dfn-generated-rdf-term

[[
	• If the term map is a per-row blank node map, then the generated RDF term is a blank node that is unique to the logical table row and to the term map.
]]

-- 
All the best, Ashok

Received on Thursday, 10 May 2012 22:32:37 UTC