\section{Specification}
\label{osl_spec}
\newcounter{parcount}
\newcommand{\parnum}{\textsuperscript{\arabic{parcount}}}
\newcommand{\p}{\refstepcounter{parcount} \parnum \hspace{1em}}

\p An \osl{} document is a valid \name{OWL} 2 document (as described in \cite{owl})
containing individuals and data that represent the OBDA specification,
as well as \name{OWL} properties that connect them.
The individuals and \name{OWL} properties are recognized and mapped to their roles
by their IRIs.

\p \label{spec_ignored} An \osl{} document may contain more \name{OWL} entities
(with IRIs not defined in this specification), which are ignored.

\p An \osl{} document has to declare all individuals having different IRIs as different
from each other (except those which are ignored, see Paragraph~\ref{spec_ignored}).\\
It is recommended to use the \texttt{owl:AllDifferent} \name{OWL}
statement for this purpose.

\p \label{spec_base} Unless stated otherwise, IRIs mentioned in the following are
IRIs relative to a base IRI chosen by the user being empty (which makes the IRIs
absolute \cite{xmlbase}) or ending with a hash character (`\#').\\
\newpage
It is recommended to use that base IRI as \texttt{xml:base} XML attribute.\\
IRIs prefixed with \texttt{osl:} are IRIs relative to the IRI\\
\oslbaseurl{}\;.

%\newpage
\p An \osl{} document has to import the following ontology
(referred to as ``the \osl{} header'' in the following):\\
\oslheaderurl{}

\p The \name{OWL} individuals described by the \osl{} document representing
the certain types of OBDA maps
must have the IRIs specified in table \ref{spec_tbl_indv_iris}
(for base IRIs, see Paragraph~\ref{spec_base}).
Here, \textit{$<$class URI$>$} refers\\
to the \texttt{OWL class URI} field of the respective entity map for entity maps,\\
to the \texttt{OWL class URI} field of the associated entity map for identifier maps,\\
to the \texttt{OWL class URI} field of the associated entity map for subtype maps and\\
%\newpage
to the \texttt{OWL class URI} field of the entity map associated with the respective subtype map
for translation tables of subtype maps.\\
Similarly, \textit{$<$property URI$>$} refers\\
to the \texttt{OWL property URI} field of the respective attribute map for attribute maps
(or, if it is empty, the value that would have been generated for it if it weren't empty),\\
to the \texttt{OWL property URI} field of the respective relation map for relation maps and\\
to the \texttt{OWL property URI} field of the respective attribute map
for translation tables of attribute maps (or, if it is empty, the value that would have
been generated for it if it weren't empty).

%\vspace{\spacebeforetable{}}
\KOMAoption{fontsize}{\smallerfontsize{}}
\begin{table}[]\begin{center}
	\begin{tabular}{l|l}
		\textbf{Map type} & \textbf{\name{OWL} IRI} \\ \hline
		Entity map & \textit{$<$class URI$>$}\texttt{\_\_ENTITY\_MAP} \\
		Attribute map & \textit{$<$property URI$>$}\texttt{\_\_ATTRIBUTE\_MAP} \\
		Identifier map & \textit{$<$class URI$>$}\texttt{\_\_IDENTIFIER\_MAP} \\
		Relation map & \textit{$<$property URI$>$}\texttt{\_\_RELATION\_MAP} \\
		Subtype map & \textit{$<$class URI$>$}\texttt{\_\_SUBTYPE\_MAP} \\
		Translation table of attribute map &
			\textit{$<$property URI$>$}\texttt{\_\_ATTRIBUTE\_MAP\_\_TRANSLATION\_TABLE} \\
		Translation table of subtype map &
			\textit{$<$class URI$>$}\texttt{\_\_SUBTYPE\_MAP\_\_TRANSLATION\_TABLE} \\
	\end{tabular}
	\caption{\name{OWL} individual IRIs in \osl{}}
	\label{spec_tbl_indv_iris}
\end{center}\end{table}
\KOMAoption{fontsize}{\myfontsize{}}

\p The \name{OWL} individuals described by the \osl{} document representing
the certain types of OBDA maps
must be of the \name{OWL} types specified in table \ref{spec_tbl_types}
(for base IRIs, see Paragraph~\ref{spec_base}).

%\vspace{\spacebeforetable{}}
\begin{table}[]\begin{center}
		\begin{tabular}{l|l}
			\textbf{Map type} & \textbf{\name{OWL} class IRI} \\ \hline
			Entity map & \texttt{osl:EntityMap} \\
			Attribute map & \texttt{osl:AttributeMap} \\
			Identifier map & \texttt{osl:IdentifierMap} \\
			Relation map & \texttt{osl:RelationMap} \\
			Subtype map & \texttt{osl:SubtypeMap} \\
			Translation table & \texttt{osl:TranslationTable} \\
		\end{tabular}
		\caption{\name{OWL} class membership of map representations in \osl{}}
		\label{spec_tbl_types}
\end{center}\end{table}

\p The \name{OWL} properties described by the \osl{} document representing
the fields of the certain OBDA maps
must have the IRIs specified in table \ref{spec_tbl_prop_iris}
(for base IRIs, see Paragraph~\ref{spec_base}).

%\vspace{\spacebeforetable{}}
%\KOMAoption{fontsize}{\smallerfontsize{}}
\begin{table}[]\begin{center}
		\begin{tabular}{l|l|l|l}
			\textbf{Map type} & \textbf{Field label} & \textbf{Field name} & \textbf{\name{OWL} IRI} \\ \hline
			Entity map & \texttt{E1} & \texttt{Table name} & \texttt{osl:em\_\_tableName} \\
			Entity map & \texttt{E2} & \texttt{Label} & \texttt{osl:em\_\_label} \\
			Entity map & \texttt{E3} & \texttt{Identifier map} & \texttt{osl:em\_\_identifierMap} \\
			Entity map & \texttt{E4} & \texttt{Attribute maps...} & \texttt{osl:em\_\_attributeMaps} \\
			Entity map & \texttt{E5} & \texttt{OWL class URI} & \texttt{osl:em\_\_owlClassURI} \\
			Entity map & \texttt{E6} & \texttt{Description} & \texttt{osl:em\_\_description} \\ \hline
			Attribute map & \texttt{A1} & \texttt{Column name} & \texttt{osl:am\_\_columnName} \\
			Attribute map & \texttt{A2} & \texttt{SQL datatype} & \texttt{osl:am\_\_sqlDatatype} \\
			Attribute map & \texttt{A3} & \texttt{Mandatory} & \texttt{osl:am\_\_mandatory} \\
			Attribute map & \texttt{A4} & \texttt{Label} & \texttt{osl:am\_\_label} \\
			Attribute map & \texttt{A5} & \texttt{OWL property URI} & \texttt{osl:am\_\_owlPropertyURI} \\
			Attribute map & \texttt{A6} & \texttt{Property type} & \texttt{osl:am\_\_propertyType} \\
			Attribute map & \texttt{A7} & \texttt{Translation} & \texttt{osl:am\_\_translation} \\
			Attribute map & \texttt{A8} & \texttt{URI pattern} & \texttt{osl:am\_\_uriPattern} \\
			Attribute map & \texttt{A9} & \texttt{RDF language} & \texttt{osl:am\_\_rdfLanguage} \\
			Attribute map & \texttt{A10} & \texttt{XSD datatype} & \texttt{osl:am\_\_xsdDatatype} \\
			Attribute map & \texttt{A11} & \texttt{Description} & \texttt{osl:am\_\_description} \\ \hline
			Identifier map & \texttt{I1} & \texttt{Entity map} & \texttt{osl:im\_\_entityMap} \\
			Identifier map & \texttt{I2} & \texttt{Attribute maps...} & \texttt{osl:im\_\_attributeMaps} \\
			Identifier map & \texttt{I3} & \texttt{URI pattern} & \texttt{osl:im\_\_uriPattern} \\ \hline
			Relation map & \texttt{R1} & \texttt{Source entity map} & \texttt{osl:rm\_\_sourceEntityMap} \\
			Relation map & \texttt{R2} & \texttt{Source column} &
				\texttt{osl:rm\_\_sourceColumn\textcolor{red}{\textbf{s}}} \\
			Relation map & \texttt{R3} & \texttt{Target entity map} & \texttt{osl:rm\_\_targetEntityMap} \\
			Relation map & \texttt{R4} & \texttt{Target column} &
				\texttt{osl:rm\_\_targetColumn\textcolor{red}{\textbf{s}}} \\
			Relation map & \texttt{R5} & \texttt{OWL property URI} & \texttt{osl:rm\_\_owlPropertyURI} \\ \hline
			Subtype map & \texttt{S1} & \texttt{Entity Map} & \texttt{osl:sm\_\_entityMap} \\
			Subtype map & \texttt{S2} & \texttt{Column Name} & \texttt{osl:sm\_\_columnName} \\
			Subtype map & \texttt{S3} & \texttt{OWL superclass URI} & \texttt{osl:sm\_\_owlSuperclassURI} \\
			Subtype map & \texttt{S4} & \texttt{Prefix} & \texttt{osl:sm\_\_prefix} \\
			Subtype map & \texttt{S5} & \texttt{Suffix} & \texttt{osl:sm\_\_suffix} \\
			Subtype map & \texttt{S6} & \texttt{Translation} & \texttt{osl:sm\_\_translation} \\ \hline
			Translation table & \texttt{T1} & \texttt{Source value...} &
				\texttt{osl:tt\_\_sourceValue\textcolor{red}{\textbf{s}}} \\
			Translation table & \texttt{T2} & \texttt{RDF ressource...} &
				\texttt{osl:tt\_\_rdfRessource\textcolor{red}{\textbf{s}}} \\
		\end{tabular}
		\caption{\name{OWL} property IRIs in \osl{}}
		\label{spec_tbl_prop_iris}
\end{center}\end{table}
%\KOMAoption{fontsize}{\myfontsize{}}

%\newpage
\p The following \name{OWL} properties in the \osl{} document refer
to lists of elements:
\begin{itemize}
	\item[] \texttt{osl:rm\_\_sourceColumns}
	\item[] \texttt{osl:rm\_\_targetColumns}
	\item[] \texttt{osl:tt\_\_sourceValues}
	\item[] \texttt{osl:tt\_\_rdfRessources}
\end{itemize}
Therefore, they have the \name{OWL} class \texttt{osl:StringListNode}
as their range, as is required by the \osl{} header.
They must connect the respective individual to an
\texttt{osl:StringListNode} individual in every case.
This ``root node'' must \emph{not} have an \texttt{osl:hasValue} property.\\
If the represented list is not empty, the list elements are represented by other
\texttt{osl:StringListNode} individuals connected seriatim by the property
\texttt{osl:nextNode}, with the first individual being connected to the root node.
The node representing the last list element must not have an
\texttt{osl:nextNode} property.\\
All nodes except the root node \emph{may} have an \texttt{osl:hasValue} property
connecting them to their values.
The actual list consists of exactly these values, thus, nodes without values
are ignored.\\
It is recommended to enumerate the node IRIs, using $0$ for the root node.
