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