Re: Many-to-Many table in R2RML

On 29 Jul 2011, at 15:19, Juan Sequeda wrote:
> Could you please add this example (or something similar) to the specs. I think it would be really useful.

I'll see what I can do.

> So is this wrong then:
> 
> <#TriplesMap1>
>     rr:logicalTable [ rr:tableName "student"; ]
>     rr:subjectMap [
>         rr:template "http://data.example.com/student/{s_id}";
>         rr:class ex:Student;
>     ];
>     rr:predicateObjectMap [
>         rr:predicateMap [ rr:predicate ex:name; ];
>         rr:objectMap [ rr:column "name" ];
>     ];
>     rr:predicateObjectMap [ 
>     	rr:predicateMap [ rr:predicate ex:isEnrolled ] ;
>         rr:refObjectMap [ rr:parentTriplesMap <#TriplesMap2> ];
>     ].
>     
> <#TriplesMap2>
>     rr:logicalTable [ rr:tableName "course"; ]
>     rr:subjectMap [
>         rr:template "http://data.example.com/course/{c_id}";
>         rr:class ex:Course;
>     ];
>     rr:predicateObjectMap [
>         rr:predicateMap [ rr:predicate ex:title; ];
>         rr:objectMap [ rr:column "title" ];
>     ];
>     rr:predicateObjectMap [ 
>     	rr:predicateMap [ rr:predicate ex:hasStudent ] ;
>         rr:refObjectMap [ rr:parentTriplesMap <#TriplesMap1> ];
>     ].

Yes this is wrong. A referencing object map needs an rr:join (unless if both triples maps use the same logical table).

The way referencing object maps are designed, you can't use them to join over two tables.

> ok. but if I'm not wrong, it's not explicit in the spec that you can give a subjectMap and objectMap a URI. or is it?

Quoting from 4.1
http://www.w3.org/2001/sw/rdb2rdf/r2rml/#vocabulary

[[
An R2RML mapping graph: […] may use the same IRI or blank node in multiple roles to enable re-use of mapping components. For example, an IRI that represents a subject map may be used as the subject map of multiple triples maps; and may even be used as an object map of another triples map if it has the right properties.
]]

I'll see if I can re-word this to make this even more explicit.

>> A case can be made for further syntactic sugar in the case where a triples map only has a single predicate-object map:
...
>> A case can be made for further syntactic sugar in the case where one doesn't need a logical table to be re-usable. In that case it would be simpler to just stick rr:tableName, rr:sqlQuery and so on directly onto the triples map:
...
> YES!! Can we please have this!!!

I'll raise issues. Not sure how much we can do though given the remaining time to Last Call.

Best,
Richard

Received on Friday, 29 July 2011 14:51:36 UTC