c5ea8e39847350b9b29025bf588e0d26595ee9cb
[u/philim/db2osl_thesis.git] / osl.tex
1 \chapter{The OBDA Specification Language (OSL)}
2 \label{osl}
3
4 TODO: aims, proceeding, structure
5 As described in \cite{eng}, an OBDA specification consists of several types of maps,
6 all containing data entries and links to other maps.
7 This fits perfectly into the environment of ontologies and \name{OWL}, with data
8 properties being the obvious choice to represent contained data entries
9 and object properties being the obvious choice to represent links between maps.
10 Also, a potential user probably to some degree is familiar with this environment,
11 since this is what the bootstrapping process at the end amounts to.
12
13 Therefore, an ideal base for the OBDA Specification Language is \name{OWL},
14 being a solid framework for data and constraint representation
15 with a high degree of software support,
16 while imposing only a minimum of introductory preparation to the user.
17
18 Another advantage of this approach is that the specification is kept
19 compact and focused on the entities that the language has to represent rather than
20 primarily dealing with technical details.
21 In particular, many of those details can be formulated as \name{OWL} restrictions
22 in a header ontology demanded to be imported by documents conforming
23 to the \osl{} specification.
24 Thus, they are not only specified precisely but they are also stipulated in a
25 machine-readable form for which tools are widely available, enabling the user to check
26 many aspects of an \osl{} document for conformity with minimal effort.
27
28 \section{Specification}
29 \label{osl_spec}
30 \newcounter{parcount}
31 \newcommand{\parnum}{\textsuperscript{\arabic{parcount}}}
32 \newcommand{\p}{\refstepcounter{parcount} \parnum \hspace{1em}}
33
34 \p An \osl{} document is a valid \name{OWL} 2 document (as described in \cite{owl})
35 containing individuals and data that represent the OBDA specification,
36 as well as \name{OWL} properties that connect them.
37 The individuals and \name{OWL} properties are recognized and mapped to their roles
38 by their IRIs.
39
40 \p \label{spec_ignored} An \osl{} document may contain more \name{OWL} entities
41 (with IRIs not defined in this specification), which are ignored.
42
43 \p An \osl{} document has to declare all individuals having different IRIs as different
44 from each other (except those which are ignored, see paragraph \ref{spec_ignored}).\\
45 It is recommended to use the \texttt{owl:AllDifferent} \name{OWL}
46 statement for this purpose.
47
48 \p \label{spec_base} Unless stated otherwise, IRIs mentioned in the following are
49 IRIs relative to a base IRI chosen by the user being empty (which makes the IRIs
50 absolute \cite{xmlbase}) or ending with a hash character (`\#').\\
51 \newpage
52 It is recommended to use that base IRI as \texttt{xml:base} XML attribute.\\
53 IRIs prefixed with \texttt{osl:} are IRIs relative to the IRI\\
54 \oslbaseurl{}\;.
55
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{}
60
61 \p The \name{OWL} individuals described by the \osl{} document representing
62 the certain types of OBDA maps
63 must have the IRIs specified in table \ref{spec_tbl_indv_iris}
64 (for base IRIs, see paragraph \ref{spec_base}).
65 Here, \textit{$<$class URI$>$} refers\\
66 to the \texttt{OWL class URI} field of the respective entity map for entity maps,\\
67 to the \texttt{OWL class URI} field of the associated entity map for identifier maps,\\
68 to the \texttt{OWL class URI} field of the associated entity map for subtype maps and\\
69 %\newpage
70 to the \texttt{OWL class URI} field of the entity map associated with the respective subtype map
71 for translation tables of subtype maps.\\
72 Similarly, \textit{$<$property URI$>$} refers\\
73 to the \texttt{OWL property URI} field of the respective attribute map for attribute maps
74 (or, if it is empty, the value that would have been generated for it if it weren't empty),\\
75 to the \texttt{OWL property URI} field of the respective relation map for relation maps and\\
76 to the \texttt{OWL property URI} field of the respective attribute map
77 for translation tables of attribute maps (or, if it is empty, the value that would have
78 been generated for it if it weren't empty).
79
80 %\vspace{\spacebeforetable{}}
81 \KOMAoption{fontsize}{\smallerfontsize{}}
82 \begin{table}[]\begin{center}
83         \begin{tabular}{l|l}
84                 \textbf{Map type} & \textbf{\name{OWL} IRI} \\ \hline
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}
95         \caption{\name{OWL} individual IRIs in \osl{}}
96         \label{spec_tbl_indv_iris}
97 \end{center}\end{table}
98 \KOMAoption{fontsize}{\myfontsize{}}
99
100 \p The \name{OWL} individuals described by the \osl{} document representing
101 the certain types of OBDA maps
102 must be of the \name{OWL} types specified in table \ref{spec_tbl_types}
103 (for base IRIs, see paragraph \ref{spec_base}).
104
105 %\vspace{\spacebeforetable{}}
106 \begin{table}[]\begin{center}
107                 \begin{tabular}{l|l}
108                         \textbf{Map type} & \textbf{\name{OWL} class IRI} \\ \hline
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}
116                 \caption{\name{OWL} class membership of map representations in \osl{}}
117                 \label{spec_tbl_types}
118 \end{center}\end{table}
119
120 \p The \name{OWL} properties described by the \osl{} document representing
121 the fields of the certain OBDA maps
122 must have the IRIs specified in table \ref{spec_tbl_prop_iris}
123 (for base IRIs, see paragraph \ref{spec_base}).
124
125 %\vspace{\spacebeforetable{}}
126 %\KOMAoption{fontsize}{\smallerfontsize{}}
127 \begin{table}[]\begin{center}
128                 \begin{tabular}{l|l|l|l}
129                         \textbf{Map type} & \textbf{Field label} & \textbf{Field name} & \textbf{\name{OWL} IRI} \\ \hline
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}
168                 \caption{\name{OWL} property IRIs in \osl{}}
169                 \label{spec_tbl_prop_iris}
170 \end{center}\end{table}
171 %\KOMAoption{fontsize}{\myfontsize{}}
172
173 %\newpage
174 \p The following \name{OWL} properties in the \osl{} document refer
175 to lists of elements:
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}
182 Therefore, they have the \name{OWL} class \texttt{osl:StringListNode}
183 as their range, as is required by the \osl{} header.
184 They must connect the respective individual to an
185 \texttt{osl:StringListNode} individual in every case.
186 This ``root node'' must \emph{not} have an \texttt{osl:hasValue} property.\\
187 If 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.
190 The node representing the last list element must not have an
191 \texttt{osl:nextNode} property.\\
192 All nodes except the root node \emph{may} have an \texttt{osl:hasValue} property
193 connecting them to their values.
194 The actual list consists of exactly these values, thus, nodes without values
195 are ignored.\\
196 It is recommended to enumerate the node IRIs, using $0$ for the root node.