Coverage of DDL part of SQL
Topic: based on ISSUE-3 this page gathers the DDL statements we plan to support in R2RML.
- CREATE TABLE table_name
- Tables may be mapped to a Class. They may also mapped to a Property if they are binary relations.
- DESCRIBE table_name
- Lists all the fields in a table, its data types and keys. Useful to identify specific properties
- CREATE VIEW
- Because it is a virtual table, it inherits the properties of a table (may be mapped to a Class)
- Data types need to be mapped. More discussion needed to identify which vendor specific ones.
- PRIMARY KEY
- Primary Keys may be mapped to OWL Functional Property or Cardinality of 1
- FOREIGN KEY (attributes) REFERENCES table (attributes)
- Foreign Keys may be mapped to OWL Object Properties. The current table may be the domain and the referenced table may be the domain
- Attribute that has UNIQUE constraint may be mapped to a Property with a Cardinality or OWL Inverse Functional Property
- Attribute that has NULL constraint may be mapped to a Property with a Cardinality of 0
- NOT NULL
- Attribute that has NOT NULL constraint may be mapped to a Property with a Cardinality of 1
- Attribute that has a CHECK constraint may be mapped to a Property that has a range of an enumerated datatype (OWL oneOf)