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