Major change
[u/philim/db2osl_thesis.git] / osl.tex
CommitLineData
c31df1ed
PM
1\chapter{The OBDA Specification Language (OSL)}
2\label{osl}
3e157d33
PM
3
4As described in \cite{eng}, an OBDA specification consists of several types of maps,
5all containing data entries and links to other maps.
6This fits perfectly into the environment of ontologies and OWL, with data properties
c31df1ed
PM
7being the obvious choice to represent contained data entries and object properties being
8the obvious choice to represent links between maps.
3e157d33
PM
9Also, a potential user probably to some degree is familiar with this environment,
10since this is what the bootstrapping process at the end amounts to.
11
c31df1ed 12Therefore, an ideal base for the OBDA Specification Language is OWL,
3e157d33
PM
13being a solid framework for data and constraint representation
14with a high degree of software support,
15while imposing only a minimum of introductory preparation to the user.
16
17Another advantage of this approach is that the specification is kept
c31df1ed 18compact and focused on the entities that the language has to represent rather than
3e157d33
PM
19primarily dealing with technical details.
20In particular, many of those details can be formulated as OWL restrictions
21in a header ontology demanded to be imported by documents conforming
c31df1ed
PM
22to the \osl{} specification.
23Thus, they are not only specified precisely but they are also stipulated in a
24machine-readable form for which tools are widely available, enabling the user to check
25many aspects of an \osl{} document for conformity with minimal effort.
3e157d33
PM
26
27\section{Specification}
c31df1ed 28\label{oslspec}
3e157d33
PM
29\newcounter{parcount}
30\newcommand{\parnum}{\textsuperscript{\arabic{parcount}}}
31\newcommand{\p}{\refstepcounter{parcount} \parnum \hspace{1em}}
32
c31df1ed
PM
33\p An \osl{} document is a valid OWL 2 document (as described in \cite{owl})
34containing individuals and data that represent the OBDA Specification,
35as well as OWL properties that connect them.
3e157d33
PM
36The individuals and OWL properties are recognized and mapped to their roles by their IRIs.
37
c31df1ed 38\p\label{spec_ignored} An \osl{} document may contain more OWL entities
3e157d33
PM
39(with IRIs not defined in this specification), which are ignored.
40
c31df1ed 41\p An \osl{} document has to declare all individuals having different IRIs as different
3e157d33 42from each other (except those which are ignored, see paragraph \ref{spec_ignored}).\\
c31df1ed 43It is recommended to use the \texttt{owl:AllDifferent} OWL statement for this purpose.
3e157d33
PM
44
45\p\label{spec_base} Unless stated otherwise, IRIs mentioned in the following are IRIs relative
46to a base IRI chosen by the user being empty (which makes the IRIs absolute \cite{xmlbase})
47or ending with a hash character (`\#').\\
c31df1ed
PM
48\newpage
49It is recommended to use that base IRI as \texttt{xml:base} XML attribute.\\
3e157d33 50IRIs prefixed with \texttt{osl:} are IRIs relative to the IRI\\
c31df1ed 51\oslbaseurl{}\;.
3e157d33 52
c31df1ed
PM
53%\newpage
54\p An \osl{} document has to import the following ontology
55(referred to as ``the \osl{} header'' in the following):\\
56\oslheaderurl{}
3e157d33 57
c31df1ed 58\p The OWL individuals described by the \osl{} document representing the certain types of OBDA maps
3e157d33
PM
59must have the IRIs specified in table \ref{spec_tbl_indv_iris}
60(for base IRIs, see paragraph \ref{spec_base}).
61Here, \textit{$<$class URI$>$} refers\\
62to the \texttt{OWL class URI} field of the respective entity map for entity maps,\\
63to the \texttt{OWL class URI} field of the associated entity map for identifier maps,\\
64to the \texttt{OWL class URI} field of the associated entity map for subtype maps and\\
65%\newpage
66to the \texttt{OWL class URI} field of the entity map associated with the respective subtype map
67for translation tables of subtype maps.\\
68Similarly, \textit{$<$property URI$>$} refers\\
69to the \texttt{OWL property URI} field of the respective attribute map for attribute maps
c31df1ed 70(or, if it is empty, the value that would have been generated for it if it weren't empty),\\
3e157d33
PM
71to the \texttt{OWL property URI} field of the respective relation map for relation maps and\\
72to the \texttt{OWL property URI} field of the respective attribute map
73for translation tables of attribute maps (or, if it is empty, the value that would have
c31df1ed 74been generated for it if it weren't empty).
3e157d33 75
c31df1ed
PM
76%\vspace{\spacebeforetable{}}
77\KOMAoption{fontsize}{\smallerfontsize{}}
3e157d33
PM
78\begin{table}[]\begin{center}
79 \begin{tabular}{l|l}
80 \textbf{Map type} & \textbf{OWL IRI} \\ \hline
81 Entity map & \textit{$<$class URI$>$}\texttt{\_\_ENTITY\_MAP} \\
82 Attribute map & \textit{$<$property URI$>$}\texttt{\_\_ATTRIBUTE\_MAP} \\
83 Identifier map & \textit{$<$class URI$>$}\texttt{\_\_IDENTIFIER\_MAP} \\
84 Relation map & \textit{$<$property URI$>$}\texttt{\_\_RELATION\_MAP} \\
85 Subtype map & \textit{$<$class URI$>$}\texttt{\_\_SUBTYPE\_MAP} \\
86 Translation table of attribute map &
87 \textit{$<$property URI$>$}\texttt{\_\_ATTRIBUTE\_MAP\_\_TRANSLATION\_TABLE} \\
88 Translation table of subtype map &
89 \textit{$<$class URI$>$}\texttt{\_\_SUBTYPE\_MAP\_\_TRANSLATION\_TABLE} \\
90 \end{tabular}
c31df1ed 91 \caption{OWL individual IRIs in \osl{}}
3e157d33
PM
92 \label{spec_tbl_indv_iris}
93\end{center}\end{table}
c31df1ed 94\KOMAoption{fontsize}{\myfontsize{}}
3e157d33 95
c31df1ed 96\p The OWL individuals described by the \osl{} document representing the certain types of OBDA maps
3e157d33
PM
97must be of the OWL types specified in table \ref{spec_tbl_types}
98(for base IRIs, see paragraph \ref{spec_base}).
99
c31df1ed 100%\vspace{\spacebeforetable{}}
3e157d33
PM
101\begin{table}[]\begin{center}
102 \begin{tabular}{l|l}
103 \textbf{Map type} & \textbf{OWL class IRI} \\ \hline
104 Entity map & \texttt{osl:EntityMap} \\
105 Attribute map & \texttt{osl:AttributeMap} \\
106 Identifier map & \texttt{osl:IdentifierMap} \\
107 Relation map & \texttt{osl:RelationMap} \\
108 Subtype map & \texttt{osl:SubtypeMap} \\
109 Translation table & \texttt{osl:TranslationTable} \\
110 \end{tabular}
c31df1ed 111 \caption{Class membership of map representations in \osl{}}
3e157d33
PM
112 \label{spec_tbl_types}
113\end{center}\end{table}
114
c31df1ed 115\p The OWL properties described by the \osl{} document representing the fields of the certain OBDA maps
3e157d33
PM
116must have the IRIs specified in table \ref{spec_tbl_prop_iris}
117(for base IRIs, see paragraph \ref{spec_base}).
118
c31df1ed
PM
119%\vspace{\spacebeforetable{}}
120%\KOMAoption{fontsize}{\smallerfontsize{}}
3e157d33
PM
121\begin{table}[]\begin{center}
122 \begin{tabular}{l|l|l|l}
123 \textbf{Map type} & \textbf{Field label} & \textbf{Field name} & \textbf{OWL IRI} \\ \hline
124 Entity map & \texttt{E1} & \texttt{Table name} & \texttt{osl:em\_\_tableName} \\
125 Entity map & \texttt{E2} & \texttt{Label} & \texttt{osl:em\_\_label} \\
126 Entity map & \texttt{E3} & \texttt{Identifier map} & \texttt{osl:em\_\_identifierMap} \\
127 Entity map & \texttt{E4} & \texttt{Attribute maps...} & \texttt{osl:em\_\_attributeMaps} \\
128 Entity map & \texttt{E5} & \texttt{OWL class URI} & \texttt{osl:em\_\_owlClassURI} \\
129 Entity map & \texttt{E6} & \texttt{Description} & \texttt{osl:em\_\_description} \\ \hline
130 Attribute map & \texttt{A1} & \texttt{Column name} & \texttt{osl:am\_\_columnName} \\
131 Attribute map & \texttt{A2} & \texttt{SQL datatype} & \texttt{osl:am\_\_sqlDatatype} \\
132 Attribute map & \texttt{A3} & \texttt{Mandatory} & \texttt{osl:am\_\_mandatory} \\
133 Attribute map & \texttt{A4} & \texttt{Label} & \texttt{osl:am\_\_label} \\
134 Attribute map & \texttt{A5} & \texttt{OWL property URI} & \texttt{osl:am\_\_owlPropertyURI} \\
135 Attribute map & \texttt{A6} & \texttt{Property type} & \texttt{osl:am\_\_propertyType} \\
136 Attribute map & \texttt{A7} & \texttt{Translation} & \texttt{osl:am\_\_translation} \\
137 Attribute map & \texttt{A8} & \texttt{URI pattern} & \texttt{osl:am\_\_uriPattern} \\
138 Attribute map & \texttt{A9} & \texttt{RDF language} & \texttt{osl:am\_\_rdfLanguage} \\
139 Attribute map & \texttt{A10} & \texttt{XSD datatype} & \texttt{osl:am\_\_xsdDatatype} \\
140 Attribute map & \texttt{A11} & \texttt{Description} & \texttt{osl:am\_\_description} \\ \hline
141 Identifier map & \texttt{I1} & \texttt{Entity map} & \texttt{osl:im\_\_entityMap} \\
142 Identifier map & \texttt{I2} & \texttt{Attribute maps...} & \texttt{osl:im\_\_attributeMaps} \\
143 Identifier map & \texttt{I3} & \texttt{URI pattern} & \texttt{osl:im\_\_uriPattern} \\ \hline
144 Relation map & \texttt{R1} & \texttt{Source entity map} & \texttt{osl:rm\_\_sourceEntityMap} \\
145 Relation map & \texttt{R2} & \texttt{Source column} &
146 \texttt{osl:rm\_\_sourceColumn\textcolor{red}{\textbf{s}}} \\
147 Relation map & \texttt{R3} & \texttt{Target entity map} & \texttt{osl:rm\_\_targetEntityMap} \\
148 Relation map & \texttt{R4} & \texttt{Target column} &
149 \texttt{osl:rm\_\_targetColumn\textcolor{red}{\textbf{s}}} \\
150 Relation map & \texttt{R5} & \texttt{OWL property URI} & \texttt{osl:rm\_\_owlPropertyURI} \\ \hline
151 Subtype map & \texttt{S1} & \texttt{Entity Map} & \texttt{osl:sm\_\_entityMap} \\
152 Subtype map & \texttt{S2} & \texttt{Column Name} & \texttt{osl:sm\_\_columnName} \\
153 Subtype map & \texttt{S3} & \texttt{OWL superclass URI} & \texttt{osl:sm\_\_owlSuperclassURI} \\
154 Subtype map & \texttt{S4} & \texttt{Prefix} & \texttt{osl:sm\_\_prefix} \\
155 Subtype map & \texttt{S5} & \texttt{Suffix} & \texttt{osl:sm\_\_suffix} \\
156 Subtype map & \texttt{S6} & \texttt{Translation} & \texttt{osl:sm\_\_translation} \\ \hline
157 Translation table & \texttt{T1} & \texttt{Source value...} &
158 \texttt{osl:tt\_\_sourceValue\textcolor{red}{\textbf{s}}} \\
159 Translation table & \texttt{T2} & \texttt{RDF ressource...} &
160 \texttt{osl:tt\_\_rdfRessource\textcolor{red}{\textbf{s}}} \\
161 \end{tabular}
c31df1ed 162 \caption{OWL property IRIs in \osl{}}
3e157d33
PM
163 \label{spec_tbl_prop_iris}
164\end{center}\end{table}
c31df1ed 165%\KOMAoption{fontsize}{\myfontsize{}}
3e157d33 166
c31df1ed
PM
167%\newpage
168\p The following OWL properties in the \osl{} document refer to lists of elements:
3e157d33
PM
169\begin{itemize}
170 \item[] \texttt{osl:rm\_\_sourceColumns}
171 \item[] \texttt{osl:rm\_\_targetColumns}
172 \item[] \texttt{osl:tt\_\_sourceValues}
173 \item[] \texttt{osl:tt\_\_rdfRessources}
174\end{itemize}
c31df1ed
PM
175Therefore, they have the OWL class \texttt{osl:StringListNode} as their range,
176as is required by the \osl{} header.
3e157d33
PM
177They must connect the respective individual to an
178\texttt{osl:StringListNode} individual in every case.
179This ``root node'' must \emph{not} have an \texttt{osl:hasValue} property.\\
180If the represented list is not empty, the list elements are represented by other
181\texttt{osl:StringListNode} individuals connected seriatim by the property
182\texttt{osl:nextNode}, with the first individual being connected to the root node.
183The node representing the last list element must not have an
184\texttt{osl:nextNode} property.\\
185All nodes except the root node \emph{may} have an \texttt{osl:hasValue} property
186connecting them to their values.
c31df1ed
PM
187The actual list consists of exactly these values, thus, nodes without values
188are ignored.\\
189It is recommended to enumerate the node IRIs, using $0$ for the root node.