All Cases for Default Mapping
From RDB2RDF
In the paper Translating SQL Applications to the Semantic Web, the authors state as a theorem "the space of relations describable in SQL DDL using various combina- tions of primary key and foreign key references between the relations can be partitioned into 10 disjoint cases of key combinations." We now present all the 10 possible cases.
Relation only has a Primary Key @@single attribute PK?@@
Trivial
Relation only has a Composite Primary Key
Primary keys may also be composite. If the primary key for Department were (name, city), the identifier for that first (only) tuple would be
<http://foo.example/DB/Department/name.Accounting_city.Cambridge#_>.
Relation only has a Foreign Key
Trivial
Relation has at least two or more Foreign Keys
Trivial
Relation has a Primary Key and only one Foreign Key
Foreign Key is the Primary Key
Primary-is-foreign Key Exception: If the primary key is also a foreign key K to relation R:
- The shared subject is the subject node of the referenced tuple in R.
- The foreign key K generates no reference triple.
- Even if K is a single-attribute foreign key, it generates a literal triple.
@@issue — what is the primary key is an exact rearrangement of the foreign key? (needs discussion)
Foreign Key and the Primary Key do not share any attributes
trivial
Relation has a Primary Key and two (2) Foreign Keys
the Foreign Key and the Primary Key do not share any attributes
Trivial
one of the Foreign Keys is also the Primary Key
Not addressed
Relation has a Primary Key and more than two (> 2) Foreign Keys
Foreign Key and the Primary Key do not share any attributes
Trivial
one of the Foreign Keys is also the Primary Key
Not addressed
Relation has a Composite Primary Key and only one Foreign Key
Foreign Key and the Primary Key do not share any attributes
trivial
Foreign Key is part of the Primary Key
not addressed
Relation has a Composite Primary Key and two (2) Foreign Keys
the Foreign Keys and the Primary Key do not share any attributes
trivial
All the Foreign Keys are part of the Primary Key
not addressed
Should be the many-to-many Relation
Foreign Keys and Primary Key share common attributes
not addressed
Relation has a Composite Primary Key and more than two (> 2) Foreign Keys
the Foreign Keys and the Primary Key do not share any attributes
trivial
All the Foreign Keys are part of the Primary Key
not addressed
Foreign Keys and Primary Key share common attributes
not addressed
