W3C home > Mailing lists > Public > public-rdb2rdf-wg@w3.org > April 2011

Re: D2R's many-to-many definition

From: Richard Cyganiak <richard@cyganiak.de>
Date: Tue, 26 Apr 2011 22:09:55 +0100
Cc: ashok malhotra <ashok.malhotra@oracle.com>, RDB2RDF WG <public-rdb2rdf-wg@w3.org>
Message-Id: <43D1DCDC-3BAD-4B1C-8377-53B31F780331@cyganiak.de>
To: Eric Prud'hommeaux <eric@w3.org>
On 26 Apr 2011, at 14:57, Eric Prud'hommeaux wrote:
> Persuant to the many-to-many (Q's for Richard and others):
>  What is the exact definition of a many-to-many table?

A table T is a “link table” iff

* T has exactly two FKs defined
* T's primary key (if any) is not referenced by any FKs
* none of the T's two FKs reference T itself (seems redundant with the previous point, but that's what it says in the code)
* each column of T occurs in an FK

>  Does D2R include many-to-many behavior in it's default behavior?

Yes, in the mapping generator script. Any tables that detect as link tables will be mapped to a property connecting the two tables referenced by the two FKs, while non-link tables are mapped to classes.

>  Does the many-to-many representation preclude the representation
>  as a first class relation?

The mapping generator will not generate a mapping file that maps link tables to classes. However, users are free to modify the mapping file after it has been generated, and can change the mapping of the link table into anything they like, including a representation where you have a class for the link table, and a resource for each row.

Received on Tuesday, 26 April 2011 21:10:22 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:00:23 UTC