- From: Juan Sequeda <juanfederico@gmail.com>
- Date: Fri, 29 Jul 2011 08:10:22 -0500
- To: Richard Cyganiak <richard@cyganiak.de>
- Cc: public-rdb2rdf-wg@w3.org
- Message-ID: <CAMVTWDz3B8DvGqnzwtJVQoz2EXhKpLTFCxnxOv0Gt_KbTKpYtg@mail.gmail.com>
Richard, all
This may be a dumb question, but I haven't been able to figure out how to
represent a many-to-many relationship in r2rml. For example:
Student(s_id, name)
Course(c_id, title)
Enrolled(s_id, c_id)
Where Enrolled is the many-to-many relationship.
These are the TripleMaps for the Student and Course table:
<#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" ];
].
<#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" ];
].
I assume that I should add a predicateObjectMap to TriplesMap1 (student)
which is going to connect to TriplesMap2 (course), but the joinCondition is
on the enrolled table.
<#TriplesMap1>
rr:predicateObjectMap [
rr:predicateMap [ rr:predicate ex:isEnrolled; ];
rr:objectMap [
rr:parentTriplesMap <#TriplesMap2>;
rr:joinCondition [
rr:child "?????";
rr:parent "???";
];
].
How is this suppose to be done? And could you add an example in the specs.
Thanks!
Juan Sequeda
+1-575-SEQ-UEDA
www.juansequeda.com
Received on Friday, 29 July 2011 13:11:10 UTC