Warning:
This wiki has been archived and is now read-only.
All Cases for Default Mapping
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.
Contents
- 1 Relation only has a Primary Key @@single attribute PK?@@
- 2 Relation only has a Composite Primary Key
- 3 Relation only has a Foreign Key
- 4 Relation has at least two or more Foreign Keys
- 5 Relation has a Primary Key and only one Foreign Key
- 6 Relation has a Primary Key and two (2) Foreign Keys
- 7 Relation has a Primary Key and more than two (> 2) Foreign Keys
- 8 Relation has a Composite Primary Key and only one Foreign Key
- 9 Relation has a Composite Primary Key and two (2) Foreign Keys
- 10 Relation has a Composite Primary Key and more than two (> 2) Foreign Keys
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)
trivial
Relation has a Primary Key and two (2) Foreign Keys
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
Trivial
one of the Foreign Keys is also the Primary Key
Not addressed
Relation has a Composite Primary Key and only one Foreign Key
trivial
Foreign Key is part of the Primary Key
not addressed
Relation has a Composite Primary Key and two (2) Foreign Keys
trivial
All the Foreign Keys are part of the Primary Key
not addressed
Should be the many-to-many Relation
not addressed
Relation has a Composite Primary Key and more than two (> 2) Foreign Keys
trivial
All the Foreign Keys are part of the Primary Key
not addressed
not addressed