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