RDB2OWL mapping language
Mapping relational databases to OWL ontologies or
RDF schemas

introduction The RDB2OWL mapping language allows specifying relational database to OWL ontology mappings by supplying the database object correspondence information within annotations to the ontology and its entities (e.g. OWL classes, object and data properties).



The diagram shows an example mini-University ontology, with RDB2OWL annotations included, in OWLGrEd ontology editor notation, enriched with visual profile (plugin) for RDB2OWL annotation rendering.
The example ontology in OWL RDF/XML format is available here.
A corresponding example database creation script (MS SQL Server) is available here.

language overview Add RDB2OWL annotations using the annotation property rdb2owl:DBExpr, where rdb2owl stands for <http://rdb2owl.lumii.lv/2012/1.0/rdb2owl#>, to the ontology itself and its entities (classes, object and data properties).
The ontology itself is annotated with database reference descriptions "DBRef(...)", specifying at least the database jdbc driver name and connection string, as well as it can be annotated by function definitions used in mapping definitions and description of class maps that are not attached to any concrete class.

The ontology classes can be annotated by class maps that define the correspondence between the annotated class and a table expression (a single table or a join of several tables, with an optional filter attached); furthermore a class map specifies an URI pattern for the computation of URIs for class instances corresponding to the table expression's rows.

The table expressions involving several tables can be formed in several ways:
(a) as item list notation with comma-separated, possibly alias-labeled table expressions, followed by a filter, such as ‘XTeacher T, XCourse C; T.Teacher_ID=C.Teacher_ID’, or
(b) as navigation list notation, such as ‘XTeacher[Teacher_ID]->[Teacher_ID] XCourse’ that can be shortened to ‘XTeacher->XCourse’ by omitting navigation columns that are (i) table PKs and (ii) their matching sole FKs, or
(c) as notation combining both (a) and (b), where the whole navigation list can be regarded as a single item in the item list.
There is a further possibility of local filter introduction in navigation expressions, such as  XStudent=>Registration:(Course_ID < 9)->XCourse.

The textual syntax for a class map consists of table expression and URI pattern specification, such as ‘Teacher {uri=('PersonID', IDCode)}’; the URI pattern is expected to have a list of constant strings and column expressions whose values are concatenated to give the local name of the corresponding class instance. The URI pattern can be omitted, if it is formed just from table expression’s leftmost table name followed by its primary key column(s) value. A class map’s table expression can refer also to a defined class map either by its explicit name (e.g. [[T]]), or by the name of the class for which it is the sole class map (e.g. [[Teacher]]).

The object property map is described as an extended table expression where two sub-expressions denote its subject and object class maps respectively. These sub-expressions can be either:
(a)    explicitly marked by an alias <s> or <t>, respectively, in some place within the table expression’s structure,
(b)    defined by the mark <s> or <t> as a table expression item itself; in this case the sole class maps defined explicitly for the property domain or range class are considered the subject and object class maps for the property map, or
(c)    in the case of missing explicit <s> and/or <t> marks these marks are assumed <s> for the leftmost and <t> for rightmost item within the table expression.
These conventions allow denoting e.g. the object property map simply by ‘->’, if the property corresponds to the sole FK-to-PK mapping between the tables serving as table expressions in the sole class maps of property domain and range classes, '=>' denotes the PK-to-FK correspondence.

The data property map can be described by a column name/column expression that is to be evaluated in the context of the sole class map attached to the property domain class. Alternatively, <table_expression>.<value_expression> notation can be used for data property map description, where the table expression is required to contain either explicit or implicit reference <s> to the property map’s subject class map.

The notation for RDB2OWL function definition, as well as multi-class conceptualization decorations can be found in [2].

The more detailed language design description can be found in [1], [2] and [3].

publications
contact rdb2owl@lumii.lv