\documentclass[pdf,plainsem,slideColor]{prosper}

\usepackage{xspace}
\usepackage{latexsym}
\usepackage{amssymb}

\usepackage{pst-node}
\usepackage{pst-uml-prosper}

\usepackage{dl-macros}

%%%%%%%%%% macros %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\newcommand{\minitab} {\hspace*{1ex}}
\newcommand{\smalltab}{\hspace*{5mm}}
\newcommand{\tab}     {\hspace*{10mm}}
\newcommand{\bigtab}  {\hspace*{15mm}}
\newcommand{\hugetab} {\hspace*{20mm}}
\newcommand{\per}{\mathpunct{\mbox{\bf .}}}
\newcommand{\topsepspace}{\vspace{\topsep}}
\newcommand{\homedir}{\~{}}

\newlength{\pictureunit}
\setlength{\pictureunit}{6em}

\def\MiniPage#1#2{\begin{minipage}[t]{.49\hsize}#1\end{minipage}%
\hspace{1ex}\begin{minipage}[t]{.49\hsize}#2\end{minipage}}

\newcommand{\interf}{{\cal I}}
\newcommand{\domain}{{\bf D}}
\newcommand{\intf}[1]{{#1}^{\cal I}}
\newcommand{\B}{\mbox{${\cal B}$}}
\newcommand{\xv}{\overline{x}}
\newcommand{\egn}{\exists^{\geq n}}
\newcommand{\eln}{\exists^{\leq n}}
\newcommand{\egx}[1]{\exists^{\geq #1}}
\newcommand{\elx}[1]{\exists^{\leq #1}}
\newcommand{\eq}{\exists^{= 1}}

\newenvironment{lefttriarray}
  {\topsepspace
  $\begin{array}{lcl}}%
  {\end{array}$
  \topsepspace}

\newcommand{\emphasize}[1]{\textcolor{red}{\bf #1}}
\def\icom{\mbox{\bf\sf i\hspace{-.05ex}{\bf\ensuremath{\bullet}}com}\xspace}

\newcommand{\EXISTR}[3]{\exists^{{\scriptscriptstyle\lessgtr} #1} [#2]#3}
\newcommand{\ATMOSTR}[3]{\exists^{\leq #1} [#2]#3}
\newcommand{\ATLEASTR}[3]{\exists^{\geq #1} [#2]#3}
\newcommand{\EXACTLYR}[3]{\exists^{= #1} [#2]#3}
\newcommand{\PROJ}[3]{#1|_{#2,#3}}
\newcommand{\DLRkey}{\mathcal{DLR}_{\mathit{key}}}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% symbols for UML package
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\newlength{\umlunitbox}
\def\umlcard#1%
  {\umlcsize #1\hspace*{-.5ex}}
\def\umlclass#1#2%
  {\rnode{#1}{\umlClass{\makebox[\umlunitbox]{#2}}{\hline\hline}}}
\def\umlclassa#1#2#3%
  {\rnode{#1}{\umlClass{\makebox[\umlunitbox]{#2}}%
  {#3\\\hline\hline}}}
\def\umldefclass#1#2%
  {\rnode{#1}{\umlClass{\makebox[\umlunitbox]%
      {{\large\bf /}#2{\large\bf /}}}{\hline\hline}}}
% \renewcommand{\ncputicon}[2][]{%
%    \setkeys{psset}{npos=0,nrot=:D}%
%    \setkeys{psset}{#1}%
%    \ncput{#2}}
\def\umlIsa{%
   \pstriangle[gangle=-90,%
              linestyle=solid,%
              fillstyle=solid,%
              fillcolor=white]%
          (-0.1,0)(0.12,0.15)} % (centre)(Width,Length)

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\def\erfigure
{     \begin{pspicture}(0.5,2)(12,5.4)
        \rput(2,5){\rnode{employee}{\psframebox{Employee}}}
        \rput(5.25,3.75){\rnode{project}{\psframebox{Project}}}
        \rput(2,4){\rnode{manager}{\psframebox{Manager}}}
        \rput(2.9,2.5){\rnode{tmanager}{\psframebox{TopManager}}}
        \rput(1.1,2.5){\rnode{amanager}{\psframebox{AreaManager}}}
        \rput(9,2.25){\rnode{dept}{\psframebox{Department}}}
        \rput(11,2.25){\rnode{sig}{\psframebox{InterestGroup}}}
        \rput(10,3.75){\rnode{orgunit}{\psframebox{OrganisationalUnit}}}
        \rput(2,3.25){\rnode{xmanager}{X}}
        \rput(10,3){\rnode{xdept}{X}}
        \pscircle(2,3.25){1.2ex}
        \pscircle(10,3){1.2ex}
        \rput(5.25,5){\dianode{works}{Works\mbox{-}for}}
        \rput(5.25,2.5){\dianode{manages}{Manages}}
        \rput(7.25,3.75){\dianode{responsible2}{Resp\mbox{-}for}}
%         \rput(3.85,5.2){(0,n)}
        \rput(5.55,4.5){(1,n)}
        \rput(4.1,2.2){(1,1)}
        \rput(5.55,3){(1,1)}
        \ncline{employee}{works}
        \ncline{works}{project}
        \ncline{tmanager}{manages}
        \ncline{manages}{project}
        \ncline{project}{responsible1}
        \ncline{responsible1}{dept}
        \ncline{project}{responsible2}
        \ncline{responsible2}{orgunit}
        \ncline{tmanager}{manages}
        \ncline{manages}{project}
        \ncline{amanager}{xmanager}
        \ncline{tmanager}{xmanager}
        \ncline{->}{xmanager}{manager}
        \ncline[doubleline=true]{xmanager}{manager}
        \ncline{dept}{xdept}
        \ncline{sig}{xdept}
        \ncline{->}{xdept}{orgunit}
        \ncline[doubleline=true]{xdept}{orgunit}
        \ncline{->}{manager}{employee}
    \end{pspicture}}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\semtitle{Description Logics}
\semsubject{Logics and Ontologies}
\semauthor{Enrico Franconi}
\sememail{franconi@cs.man.ac.uk}
\semwebpage{http://www.cs.man.ac.uk/\~{}franconi}
\seminstitution{Department of Computer Science, University of Manchester}

\begin{document}

\makesemtitle

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
                                                                            
\begin{slide}{Summary}

\begin{itemize}
\item What is an ontology
\item Ontology languages
\item Formalising ontologies with set theory
\item Reasoning in ontologies
\item Formalising ontologies with first order logic
\item Integrity constraints
\item The \icom ontology design tool
\end{itemize}

\end{slide}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
                                                                            
\overlays{4}{
\begin{slide}{What is an Ontology}

\begin{itemize}
\item An ontology is a formal conceptualisation of the world.
\fromSlide{2}{
\item An ontology specifies a set of \emphasize{constraints}, which
  declare what should necessarily hold in any possible world.}
\fromSlide{3}{
\item Any possible world should conform to the constraints expressed
  by the ontology.}
\fromSlide{4}{
\item Given an ontology, a {\em legal world description} is a possible
  world satisfying the constraints.}
\end{itemize}

\end{slide}}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
                                                                            
\overlays{4}{
\begin{slide}{Ontology languages}

\begin{itemize}
\item An ontology language usually introduces \emphasize{concepts}
  (aka classes, entities), \emphasize{properties} of concepts (aka
  slots, attributes, roles), \emphasize{relationships} between
  concepts (aka associations), and additional \emphasize{constraints}.

\fromSlide{2}{
\item Ontology languages may be simple (e.g., having only concepts),
  frame-based (having only concepts and properties), or logic-based
  (e.g. Ontolingua and DAML+OIL). }

\fromSlide{3}{
\item Ontology languages are typically expressed by means of
  diagrams.}

\fromSlide{4}{
\item The Entity-Relationship conceptual data model and UML Class
  Diagrams can be considered as ontology languages.}
\end{itemize}

\end{slide}}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
                                                                            
\begin{slide}{Entity-Relationship Schema}

   \topsepspace
  
{\small
 \psset{unit=1.3cm}    
   \begin{pspicture}(-1,2.6)(6,5.8)
       \rput(2,5){\rnode{employee}{\psframebox{Employee}}}
       \rput(2,6){\rnode{pslip}{\underline{\scriptsize%
       PaySlipNumber(Integer)}}}
       \rput(3,5.75){\rnode{salary}{\scriptsize Salary(Integer)}}
       \rput(6,3.75){\rnode{project}{\psframebox{Project}}}
       \rput(7,4.25){\rnode{projectcode}{\underline{\scriptsize%
       ProjectCode(String)}}}
       \rput(2,4){\rnode{manager}{\psframebox{Manager}}}
       \rput(2.9,2.5){\rnode{tmanager}{\psframebox{TopManager}}}
       \rput(1.1,2.5){\rnode{amanager}{\psframebox{AreaManager}}}
       \rput(2,3.25){\rnode{xmanager}{$\times$}}
       \rput(2,5.75){\rnode{apslip}{\ }}
       \rput(3,5.5){\rnode{asalary}{\ }}
       \rput(7,4){\rnode{aprojcode}{\ }}
       \rput(6,5){\dianode{works}{Works\mbox{-}for}}
       \rput(6,2.5){\dianode{manages}{Manages}}
       \rput(5.55,4.5){(1,n)}
       \rput(4.1,2.7){(1,1)}
       \rput(5.55,3){(1,1)}
       \ncline{employee}{works}
       \ncline{works}{project}
       \ncline{tmanager}{manages}
       \ncline{manages}{project}
       \ncline{tmanager}{manages}
       \ncline{manages}{project}
       \ncline{amanager}{xmanager}
       \ncline{tmanager}{xmanager}
       \ncline{->}{xmanager}{manager}
       \ncline{->}{xmanager}{manager}
       \ncline[doubleline=true]{xmanager}{manager}
       \ncline{->}{manager}{employee}
       \ncline{employee}{apslip}
       \ncline{employee}{asalary}
       \ncline{project}{aprojcode}
       \pscircle(2,3.25){1.2ex}
       \pscircle[fillstyle=solid,fillcolor=white](2,5.75){.7ex}
       \pscircle[fillstyle=solid,fillcolor=white](3,5.5){.7ex}
       \pscircle[fillstyle=solid,fillcolor=white](7,4){.7ex}
   \end{pspicture}}

\end{slide}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{slide}{UML Class Diagram}

\topsepspace

{\footnotesize
    \psset{unit=3cm}
    \setlength{\umlunitbox}{1.5cm}
    \def\umlcsize{\scriptsize}
    \begin{pspicture}(-0.5,-0.2)(2.5,2.2)
        \rput(0,0){\umlclass{amanager}{AreaManager}}
        \rput(1,0){\umlclass{tmanager}{TopManager}}
        \rput(0.5,1){\umlclass{manager}{Manager}}
        \rput(2,1){\umlclassa{project}{Project}%
        {\umlcsize\sf ProjectCode:String}}
        \rput(0.5,2){\umlclassa{employee}{Employee}%
        {\umlcsize\sf PaySlipNumber:Integer\vspace{-1em} \\ 
         \umlcsize\sf Salary:Integer}}
        \ncSHS[armA=0.3]{manager}{amanager}
        \ncSHS[armA=0.3]{manager}{tmanager}
        \naput[npos=1.99,nrot=:U]{\umlcsize\{disjoint,complete\}}
%        \ncputicon{\umlIsa}
        \ncline{employee}{manager}
%        \ncputicon{\umlIsa}
        \ncES{employee}{project}
        \nbput[npos=1.9,nrot=:L]{\umlcard{1..$\star$}}
        \naput[npos=0.7,nrot=:U]{Works-for}
        \ncEN{tmanager}{project}
        \nbput[npos=1.9,nrot=:R]{\umlcard{1..1}}
        \nbput[npos=0.2,nrot=:U]{\umlcard{1..1}}
        \naput[npos=1.2,nrot=:R]{Manages}
    \end{pspicture}
}
   
\end{slide}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{slide}{Meaning of basic constructs}
  
  \begin{itemize}
      \item An entity/class is a {\bf\em set of instances};
      \item an association (n-ary relationship) is a {\bf\em set of 
      pairs (n-tuples) of instances};
      \item an attribute is a {\bf\em set of 
      pairs of an instance and a domain element}.
  \end{itemize}
  
  \topsepspace
  
  \begin{center}
  \psset{unit=0.5cm}
  \begin{pspicture}(0,-2)(17,8)
      \pscustom[linewidth=2pt,fillstyle=solid,fillcolor=gray]{
      \psccurve(0,4)(1,1)(5.5,0)(10,1)(11,4)(10,7)(5.5,8)(1,7)}
      \pscustom[linewidth=2pt,fillstyle=solid,fillcolor=lightgray]{
      \psccurve(2.5,1)(4,3)(3.5,4)(4,5)(2.5,7)(1,6)(1.5,5)%
      (1,4)(1.5,3)(1,2)(1.5,1)}
      \pscustom[linewidth=2pt,fillstyle=solid,fillcolor=lightgray]{
      \psccurve(8.5,1)(10,3)(9.5,4)(10,5)(8.5,7)(7,6)(7.5,5)%
      (7,4)(7.5,3)(7,2)(7.5,1)}
      \pscustom[linewidth=2pt,fillstyle=solid,fillcolor=lightgray]{
      \psccurve(14.5,1)(16,3)(15.5,4)(16,5)(14.5,7)(13,6)(13.5,5)%
      (13,4)(13.5,3)(13,2)(13.5,1)}
      \rput(2,6){\rnode{e1}{E$_{1}$}}
      \rput(3,5){\rnode{e2}{E$_{2}$}}
      \rput(2,4){\rnode{e3}{E$_{3}$}}
      \rput(3,3){\rnode{e4}{E$_{4}$}}
      \rput(2,2){\rnode{e5}{E$_{5}$}}
      \rput(8.5,5.5){\rnode{p1}{P$_{1}$}}
      \rput(8,4){\rnode{p2}{P$_{2}$}}
      \rput(8.5,2.5){\rnode{p3}{P$_{3}$}}
      \rput(14,6){\rnode{s1}{\footnotesize ``P12a"}}
      \rput(15,5){\rnode{s2}{\footnotesize``P02b"}}
      \rput(14,4){\rnode{s3}{\footnotesize``P2a/1"}}
      \rput(14,2){\rnode{s4}{\footnotesize``P9"}}
       \ncline{e1}{p1}
       \ncline{e2}{p1}
       \ncline{e2}{p2}
       \ncline{e2}{p3}
       \ncline{e3}{p1}
       \ncline{e4}{p2}
       \ncline{e4}{p3}
       \ncline{e5}{p3}
       \ncline{p1}{s1}
       \ncline{p2}{s2}
       \ncline{p3}{s3}
       \psbezier{->}(2,-1)(3,-0.5)(1,0.5)(2.5,1.5)
       \psbezier{->}(8,-1)(9,-0.5)(7,0.5)(8.5,1.5)
       \psbezier{->}(14,-1)(15,-0.5)(13,0.5)(14.5,1.5)
       \psbezier{->}(5,-2)(6,-1)(4,0.5)(5.5,1.5)
       \psbezier{->}(11,-2)(12,-1)(10,0.5)(11.5,1.5)
       \rput(2,-1.5){Employee}
       \rput(8,-1.5){Project}
       \rput(14,-1.5){String}
       \rput(5,-2.5){Works-for}
       \rput(12,-2.5){ProjectCode}
      \pscustom{\psccurve(6,4)(7,1)(11.5,0)(16,1)(17,4)(16,7)(11.5,8)(7,7)}
\end{pspicture}
\end{center}

\end{slide}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{slide}{A world is described by sets of instances}
  
  \topsepspace
  
  \def\spair#1#2{\scriptsize$\langle$#1,#2$\rangle$}
  
  \begin{center}
  \psset{unit=0.5cm}
  \begin{pspicture}(0,-2)(17,8)
      \pscustom[linewidth=2pt,fillstyle=solid,fillcolor=lightgray]{
      \psccurve(2.5,1)(4,3)(3.5,4)(4,5)(2.5,7)(1,6)(1.5,5)%
      (1,4)(1.5,3)(1,2)(1.5,1)}
      \pscustom[linewidth=2pt,fillstyle=solid,fillcolor=lightgray]{
      \psccurve(8.5,1)(10,3)(9.5,4)(10,5)(8.5,7)(7,6)(7.5,5)%
      (7,4)(7.5,3)(7,2)(7.5,1)}
      \pscustom[linewidth=2pt,fillstyle=solid,fillcolor=lightgray]{
      \psccurve(14.5,1)(17,3)(16.5,4)(17,5)(14.5,7)(12,6)(12.5,5)%
      (12,4)(12.5,3)(12,2)(12.5,1)}
      \rput(2,6){\rnode{e1}{E$_{1}$}}
      \rput(3,5){\rnode{e2}{E$_{2}$}}
      \rput(2,4){\rnode{e3}{E$_{3}$}}
      \rput(3,3){\rnode{e4}{E$_{4}$}}
      \rput(2,2){\rnode{e5}{E$_{5}$}}
      \rput(8.5,5.5){\rnode{p1}{P$_{1}$}}
      \rput(8,4){\rnode{p2}{P$_{2}$}}
      \rput(8.5,2.5){\rnode{p3}{P$_{3}$}}
       \rput(14,6){\spair{E$_{1}$}{P$_{1}$}}
       \rput(15,5.5){\spair{E$_{2}$}{P$_{1}$}}
       \rput(14,5){\spair{E$_{2}$}{P$_{2}$}}
       \rput(15,4.5){\spair{E$_{2}$}{P$_{3}$}}
       \rput(14,4){\spair{E$_{3}$}{P$_{1}$}}
       \rput(15,3.5){\spair{E$_{4}$}{P$_{2}$}}
       \rput(14,3){\spair{E$_{4}$}{P$_{3}$}}
       \rput(15,2.5){\spair{E$_{5}$}{P$_{3}$}}
       \psbezier{->}(2,-1)(3,-0.5)(1,0.5)(2.5,1.5)
       \psbezier{->}(8,-1)(9,-0.5)(7,0.5)(8.5,1.5)
       \psbezier{->}(14,-1)(15,-0.5)(13,0.5)(14.5,1.5)
       \rput(2,-1.5){Employee}
       \rput(8,-1.5){Project}
       \rput(14,-1.5){Works-for}
\end{pspicture}
\end{center}

\end{slide}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
                                                                            
\begin{slide}{The relational representation}
    \renewcommand{\arraystretch}{.9}

    {\footnotesize

    \begin{minipage}[t]{.3\textwidth}
    Employee
    
    \begin{tabular}{|c|}
        \hline
        {\it employeeId}\\
        \hline
      E$_{1}$\\
      E$_{2}$\\
      E$_{3}$\\
      E$_{4}$\\
      E$_{5}$\\ 
        \hline
    \end{tabular}
    \end{minipage}
    %
    \begin{minipage}[t]{.3\textwidth}    
    Project
    
    \begin{tabular}{|c|}
        \hline
        {\it projectId}\\
        \hline
      P$_{1}$\\
      P$_{2}$\\
      P$_{3}$\\
        \hline
    \end{tabular}
    \end{minipage}
    %
    \begin{minipage}[t]{.3\textwidth}      
        String
        
    \begin{tabular}{|c|c|}
        \hline
        {\it anystring} \\ \hline
      ``P12a''\\
      ``P02b''\\
      ``P2a/1''\\
      ``P9'' \\
      $\cdots$\\
        \hline
    \end{tabular}
    \end{minipage}
    
    \hspace{2em}
    
    \begin{minipage}[t]{.45\textwidth}
    Works-for
    
    \begin{tabular}{|c|c|}
        \hline
        {\it employeeId} & {\it projectId} \\ \hline
       E$_{1}$ & P$_{1}$ \\
       E$_{2}$ & P$_{1}$ \\
       E$_{2}$ & P$_{2}$ \\
       E$_{2}$ & P$_{3}$ \\
       E$_{3}$ & P$_{1}$ \\
       E$_{4}$ & P$_{2}$ \\
       E$_{4}$ & P$_{3}$ \\
       E$_{5}$ & P$_{3}$\\
        \hline
    \end{tabular}
    \end{minipage}
    %
    \begin{minipage}[t]{.3\textwidth}          
    ProjectCode
    
    \begin{tabular}{|c|c|}
        \hline
        {\it projectId} & {\it pcode} \\ \hline
      P$_{1}$ & ``P12a''\\
      P$_{2}$ & ``P02b''\\
      P$_{3}$ & ``P2a/1''\\
        \hline
    \end{tabular}
    \end{minipage}
            
    }
    
    \renewcommand{\arraystretch}{1}
    
\end{slide}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\overlays{2}{%
\begin{slide}{Meaning of Attributes}

\psset{unit=\pictureunit}

\rput(1,-1){\rnode{project}{\psframebox{Project}}}
\rput(1.75,-0.25){\rnode{projectcode}{\footnotesize ProjectCode(String)}}
\rput(1.25,-0.5){\rnode{aprojcode}{\ }}
\ncline{project}{aprojcode}
\pscircle[fillstyle=solid,fillcolor=white](1.25,-0.5){.7ex}

\vspace{1.5\pictureunit}
  
\fromSlide{2}{%
$$\mbox{Project}\subseteq\{p\mid%
\sharp(\mbox{ProjectCode}\cap(\{p\}\times{\tt String}))\geq 1\}$$}

\end{slide}
}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\overlays{2}{%
\begin{slide}{Meaning of ISA}
  
\psset{unit=\pictureunit}
\rput(1,-0.5){\rnode{employee}{\psframebox{Employee}}}
\rput(1,-1.25){\rnode{manager}{\psframebox{Manager}}}
\ncline{->}{manager}{employee}
  
\vspace{2\pictureunit}
  
\fromSlide{2}{%
$$\mbox{Manager}\subseteq\mbox{Employee}$$}

\end{slide}
}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\overlays{2}{%
\begin{slide}{Meaning of \emph{disjoint} and \emph{total} constraints}

\topsepspace
    
\psset{unit=\pictureunit}

\rput(2,0){\rnode{manager}{\psframebox{Manager}}}
\rput(1,-1){\rnode{tmanager}{\psframebox{TopManager}}}
\rput(3,-1){\rnode{amanager}{\psframebox{AreaManager}}}
\rput(2,-0.5){\rnode{xmanager}{\pscircle[fillstyle=solid,fillcolor=white]{.7ex}}}
\ncline{amanager}{xmanager}
\ncline{tmanager}{xmanager}
\ncline{->}{xmanager}{manager}
\ncline{->}{xmanager}{manager}
\ncline[doubleline=true]{xmanager}{manager}
\rput(2,-0.5){\small $\times$}

\vspace{2\pictureunit}
      
\fromSlide{2}{%
\begin{itemize}
\item {\em ISA:} $\mbox{AreaManager}\subseteq\mbox{Manager}$
\item {\em ISA:} $\mbox{TopManager}\subseteq\mbox{Manager}$
\item {\em disjoint:}
$\mbox{AreaManager}\cap\mbox{TopManager}=\emptyset$
\item {\em total}
$\mbox{Manager}\subseteq\mbox{AreaManager}\cup\mbox{TopManager}$
\end{itemize}}

\end{slide}
}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\overlays{3}{%
\begin{slide}{Meaning of Associations and Relationships}
  
\psset{unit=1.2\pictureunit}

\rput(1,-0.5){\rnode{employee}{\psframebox{Employee}}}
\rput(5,-0.5){\rnode{project}{\psframebox{Project}}}
\rput(3,-0.5){\dianode{works}%          
  {\onlySlide{3}{\hspace{-3em}\rnode{NAA}%
     {\pscirclebox[linecolor=red]{\color{blue}\footnotesize A1}}}%
   \hspace{1ex}Works\mbox{-}for\hspace{1ex}%
   \onlySlide{3}{\rnode{NAB}%
     {\pscirclebox[linecolor=red]{\color{blue}\footnotesize A2}}\hspace{-3em}}}}
\ncline{employee}{works}
\ncline{project}{works}

\vspace{1.5\pictureunit}
  
\fromSlide{2}{%
$$\mbox{Works-for}\subseteq%
  \rnode{NBA}{\mbox{Employee}}\times\rnode{NBB}{\mbox{Project}}$$}

\onlySlide*{3}{%
\nccurve[linecolor=red,angleA=270,angleB=90]{->}{NAA}{NBA}%
\nccurve[linecolor=red,angleA=270,angleB=90]{->}{NAB}{NBB}}

\end{slide}
}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\overlays{3}{%
\begin{slide}{Meaning of Cardinality Constraints}

\psset{unit=1.2\pictureunit}

\rput(1,-0.5){\rnode{topmanager}{\psframebox{TopManager}}}
\rput(5,-0.5){\rnode{project}{\psframebox{Project}}}
\rput(3,-0.5){\dianode{manages}%                
  {\onlySlide{3}{\hspace{-3em}\rnode{NAA}%
     {\pscirclebox[linecolor=red]{\color{blue}\footnotesize A1}}}%
   \hspace{1ex}Manages\hspace{1ex}%
   \onlySlide{3}{\rnode{NAB}%
     {\pscirclebox[linecolor=red]{\color{blue}\footnotesize A2}}\hspace{-3em}}}}
\ncline{topmanager}{manages}
\ncline{project}{manages}
\rput(1.9,-0.4){\footnotesize({\sf min},{\sf max})}

\vspace{1.5\pictureunit}
  
\fromSlide{2}{%
$$\mbox{TopManager}\subseteq\{m\mid%
{\sf max}\geq\sharp(\mbox{Manages}\cap(\rnode{NAB}{\{m\}}\times\Omega))\geq 
{\sf min}\}$$

(where $\Omega$ is the set of all instances)}

\onlySlide*{3}{%
\nccurve[linecolor=red,angleA=270,angleB=90]{->}{NAA}{NAB}}

\end{slide}
}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{slide}{Meaning of the initial diagram}
  
\noindent
$\mbox{Works-for}\subseteq\mbox{Employee}\times\mbox{Project}$\\
$\mbox{Manages}\subseteq\mbox{TopManager}\times\mbox{Project}$

\noindent
$\mbox{Employee}\subseteq\{e\mid%
\sharp(\mbox{PaySlipNumber}\cap(\{e\}\times{\tt Integer}))\geq 1\}$\\
$\mbox{Employee}\subseteq\{e\mid%
\sharp(\mbox{Salary}\cap(\{e\}\times{\tt Integer}))\geq 1\}$\\
$\mbox{Project}\subseteq\{p\mid%
\sharp(\mbox{ProjectCode}\cap(\{p\}\times{\tt String}))\geq 1\}$

\noindent
$\mbox{TopManager}\subseteq\{m\mid%
1\geq\sharp(\mbox{Manages}\cap(\{m\}\times\Omega))\geq 1\}$
$\mbox{Project}\subseteq\{p\mid%
1\geq\sharp(\mbox{Manages}\cap(\Omega\times\{p\}))\geq 1\}$\\
$\mbox{Project}\subseteq\{p\mid%
\sharp(\mbox{Works-for}\cap(\Omega\times\{p\}))\geq 1\}$

\noindent
$\mbox{Manager}\subseteq\mbox{Employee}$\\
$\mbox{AreaManager}\subseteq\mbox{Manager}$\\
$\mbox{TopManager}\subseteq\mbox{Manager}$\\
$\mbox{AreaManager}\cap\mbox{TopManager}=\emptyset$\\
$\mbox{Manager}\subseteq\mbox{AreaManager}\cup\mbox{TopManager}$

\end{slide}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{slide}{Reasoning}
    
  Given an ontology -- seen as a collection of constraints -- it is
  possible that additional constraints can be inferred.

\begin{itemize}
    
\item An entity is inconsistent if it denotes always the empty set.

\item An entity is a sub-entity of another entity if the former denotes
a subset of the set denoted by the latter.

\item Two entities are equivalent if they denote the same set.

\item $\ldots$

\end{itemize}

\end{slide}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\overlays{2}{%
\begin{slide}{Reasoning}

\psset{unit=1.2\pictureunit}

\rput(2,0){\rnode{person}{\psframebox{Person}}}
\rput(1,-1){\rnode{italian}{\psframebox{Italian}}}
\rput(3,-1){\rnode{english}{\psframebox{English}}}
\rput(0.5,-2){\rnode{lazy}{\psframebox{Lazy}}}%
\rput(1.5,-2){\rnode{latin}{\psframebox{LatinLover}}}
\rput(2.5,-2){\rnode{gentle}{\psframebox{Gentleman}}}
\rput(3.5,-2){\rnode{hooligan}{\psframebox{Hooligan}}}
\rput(2,-0.5){\rnode{xperson}{\pscircle[fillstyle=solid,fillcolor=white]{.7ex}}}
\rput(1,-1.5){\rnode{xitalian}{\pscircle[fillstyle=solid,fillcolor=white]{.7ex}}}
\rput(3,-1.5){\rnode{xenglish}{\pscircle[fillstyle=solid,fillcolor=white]{.7ex}}}
\ncline{italian}{xperson}
\ncline{english}{xperson}
\ncline{lazy}{xitalian}
\ncline{latin}{xitalian}
\ncline{gentle}{xenglish}
\ncline{hooligan}{xenglish}
\ncline{->}{xperson}{person}
\ncline{->}{xitalian}{italian}
\ncline{->}{xenglish}{english}
\ncline{->}{xitalian}{italian}
\ncline[doubleline=true]{xitalian}{italian}
\rput(2,-0.5){\rnode{xperson}{\pscircle[fillstyle=solid,fillcolor=white]{.7ex}}}
\rput(1,-1.5){\rnode{xitalian}{\pscircle[fillstyle=solid,fillcolor=white]{.7ex}}}
\rput(3,-1.5){\rnode{xenglish}{\pscircle[fillstyle=solid,fillcolor=white]{.7ex}}}
\rput(2,-0.5){\small $\times$}
\rput(1,-1.5){\small $\times$}
\nccurve[angleA=270,angleB=270]{->}{latin}{gentle}
\onlySlide*{2}{\rput(1.45,-2.1){\color{red}\rule{.8\pictureunit}{2pt}}%
\nccurve[linecolor=green,angleA=180,angleB=90]{->}{italian}{lazy}%
}%

\vspace{2.8\pictureunit}
      
\fromSlide{2}{%
{\em implies}

$\mbox{LatinLover}=\emptyset$\\
$\mbox{Italian}\subseteq\mbox{Lazy}$\\
$\mbox{Italian}\equiv\mbox{Lazy}$
}

\end{slide}
}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\overlays{2}{%
\begin{slide}{Reasoning by cases}

\psset{unit=1.2\pictureunit}

\rput(2,0){\rnode{italian}{\psframebox{Italian}}}
\rput(0.5,-1){\rnode{lazy}{\psframebox{Lazy}}}%
\rput(1.5,-1){\rnode{mafioso}{\psframebox{Mafioso}}}
\rput(2.5,-1){\rnode{latin}{\psframebox{LatinLover}}}
\rput(3.5,-1){\rnode{prof}{\psframebox{ItalianProf}}}
\rput(2,-0.5){\rnode{xitalian}{\pscircle[fillstyle=solid,fillcolor=white]{.7ex}}}
\ncline{lazy}{xitalian}
\ncline{mafioso}{xitalian}
\ncline{latin}{xitalian}
\ncline{->}{prof}{italian}
\ncline{->}{xperson}{person}
\ncline{->}{xitalian}{italian}
\ncline{->}{xitalian}{italian}
\ncline[doubleline=true]{xitalian}{italian}
\rput(2,-0.5){\rnode{xperson}{\pscircle[fillstyle=solid,fillcolor=white]{.7ex}}}
\rput(2,-0.5){\small $\times$}
\nccurve[angleA=270,angleB=270,linestyle=dashed]{mafioso}{prof}
\nccurve[angleA=270,angleB=270,linestyle=dashed]{lazy}{prof}
\rput(1.9,-1.7){\footnotesize$\{$disjoint$\}$}
\onlySlide*{2}{\rput(1.45,-2.1){%
\nccurve[linecolor=green,angleA=90,angleB=90]{->}{prof}{latin}%
}}

\vspace{2.5\pictureunit}
      
\fromSlide{2}{%
{\em implies}

$\mbox{ItalianProf}\subseteq\mbox{LatinLover}$
}

\end{slide}
}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\overlays{2}{%
\begin{slide}{ISA and Inheritance}
  
\psset{unit=\pictureunit}

\rput(1,-1){\rnode{employee}{\psframebox{Employee}}}
\rput(1,-1.75){\rnode{manager}{\psframebox{Manager}}}
\ncline{->}{manager}{employee}
\rput(1.50,-0.55){\rnode{salary}{\footnotesize Salary(Integer)}}
\rput(1.50,-0.7){\rnode{asalary}{\ }}
\ncline{employee}{asalary}
\pscircle[fillstyle=solid,fillcolor=white](1.50,-0.7){.7ex}
\onlySlide*{2}{%
\rput(1.50,-1.3){\rnode{isalary}{\color{green}\footnotesize Salary(Integer)}}
\rput(1.50,-1.45){\rnode{aisalary}{\ }}
\ncline[linecolor=green]{manager}{aisalary}
\pscircle[fillstyle=solid,fillcolor=white,linecolor=green](1.50,-1.45){.7ex}
}

\vspace{2\pictureunit}
  
\fromSlide{2}{%
{\em implies}

$\mbox{Manager}\subseteq\{m\mid%
\sharp(\mbox{Salary}\cap(\{m\}\times{\tt Integer}))\geq 1\}$
}

\end{slide}
}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\overlays{2}{%
\begin{slide}{Infinite worlds}
    
    \topsepspace
  
\psset{unit=\pictureunit}
\rput(1,0){\rnode{root}{\psframebox{Root}}}
\rput(1,-1){\rnode{node}{\psframebox{Node}}}
\ncline{->}{node}{root}
\rput(2,-0.5){\dianode{link}{link}}
\nccurve[angleB=90]{root}{link}
\nccurve[angleB=270]{node}{link}
\rput(1.5,0.1){\footnotesize (2,2)}
\rput(1.5,-1.1){\footnotesize(0,1)}

\vspace{1.5\pictureunit}
  
\fromSlide{2}{%
{\em implies}

``the classes Root and Node contain an infinite number of instances''.
}

\end{slide}
}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{slide}{Ontologies in First Order Logic}

    \begin{itemize}
        
\item We have introduced ontology languages that specify a set of
constraints that should be satisfied by the world of interest.
    
\item The \textit{interpretation} of an ontology is therefore defined
  as the collection of all the {\em legal world descriptions} -- i.e.,
  all the (finite) relational structures which conform to the
  constraints imposed by the ontology.
  
\item In order to formally define the interpretation, an ontology is
  mapped into a set of \textit{First Order Logic} (FOL) formulas.
  
\item The legal world descriptions (i.e., the interpretation) of an
  ontology are all the models of the translated FOL theory.

\end{itemize}


\end{slide}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{slide}{FOL alphabet}

The Alphabet of the FOL language will have the following set of {\em
  Predicate} symbols:

\begin{itemize}
\item 1-ary predicate symbols: $E_1,E_2,\ldots,E_n$ for each
  Entity-set; $D_1,D_2,\ldots,D_m$ for each Basic Domain.
  
\item binary predicate symbols: $A_1,A_2,\ldots,A_k$ for each
  Attribute.
  
\item n-ary predicate symbols: $R_1,R_2,\ldots,R_p$ for each
  Relationship-set.
\end{itemize}

\end{slide}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{slide}{FOL Notation}

\begin{itemize}
    
\item {\em Vector variables} indicated as $\xv$ stand for an n-tuple
  of variables: $\xv = x_1,\ldots,x_n$
  
 
\item {\em Counting existential quantifier} indicated as $\eln$ or $\egn$.

  $\eln x\per R(x,y) \equiv$\\\hspace*{2em} \parbox[t]{.8\textwidth}{$ \forall
    x_1,\ldots,x_n,x_{n+1}\per
    R(x_1,y)\wedge\ldots\wedge R(x_n,y)\wedge R(x_{n+1},y) \rightarrow \\
    (x_1=x_2) \vee\ldots \vee (x_1=x_n) \vee (x_1=x_{n+1}) \vee \\
    (x_2=x_3) \vee\ldots \vee (x_2=x_n) \vee (x_2=x_{n+1}) \vee \\
    \ldots\ldots\vee (x_n=x_{n+1})
    $}
    
    \vspace{1em}

  $\egn x\per R(x,y) \equiv$\\\hspace*{2em}\parbox[t]{.8\textwidth}{$ \exists
    x_1,\ldots,x_n\per
    R(x_1,y)\wedge\ldots\wedge R(x_n,y)\wedge R(x_{n+1},y) \wedge \\
    \neg(x_1=x_2) \wedge\ldots  \wedge\neg(x_1=x_n)\wedge\\
    \neg(x_2=x_3) \wedge\ldots \wedge \neg(x_2=x_n) \wedge \\
    \ldots\ldots\wedge (x_{n-1}=x_{n}) 
    $}

\end{itemize}
\end{slide}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{slide}{The Interpretation function}
  
  \textbf{Interpretation}: $\interf = \langle\domain,
  \intf{\cdot}\rangle$, where $\domain$ is an arbitrary non-empty set
  such that:

\begin{itemize}
\item $\domain = \Omega \cup \B$, where:
  \begin{itemize}
  \item $\B = \cup _{i=1}^{m} \B_{Di}$.\ \ $\B_{Di}$ is the set of
    values associated with each basic domain (i.e., integer, string,
    etc.); and $\B_{Di} \cap \B_{Dj} = \emptyset$, $\forall i,j\per
    i\neq j$
  \item $\Omega$ is the abstract entity domain such that $\B\cap
    \Omega = \emptyset$.
  \end{itemize}
\end{itemize}

\end{slide}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{slide}{The Formal Semantics for the Atoms}
  
$\interf$ is the interpretation function that maps:

\begin{itemize}
\item {\em Basic Domain Predicates} to elements of the relative basic domain:\\
  $\intf{D_i} = \B_{Di}$ ~~(e.g., $\intf{\mbox{\em String}} =
  \B_{\mbox{\em String}}$).
\item {\em Entity-set Predicates} to elements of the entity domain:\\
  $\intf{E_i} \subseteq \Omega$.
\item {\em Attribute Predicates} to binary relations such that:\\
  $\intf{A_i} \subseteq \Omega\times\B$.
\item {\em Relationship-set Predicates} to n-ary relations over the entity domain:\\
  $\intf{R_i}\subseteq\Omega\times\Omega\ldots\times\Omega=\Omega^n$.
\end{itemize}

\end{slide}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\overlays{2}{
\begin{slide}{The Attribute Construct}

{\footnotesize\psset{unit=1.1cm}    
   \begin{pspicture}(-1,4)(6,5.4)
        \rput(3.5,5){\rnode{employee}{\psframebox{$E$}}}
        \rput(5.5,5){\rnode{attr}{\pscirclebox{}}}
        \rput(4.5,5.2){A}
        \rput(5.8,5){D}
%        \rput(4.1,2.2){(1,1)}
%        \rput(5.55,3){(1,1)}
        \ncline{employee}{attr}
    \end{pspicture}}

  \begin{itemize}
  \item The meaning of this constraint is:
    $$\intf{E} \subseteq\{e\in\Omega\mid%
    \sharp(\intf{A}\cap(\{e\}\times\B_D))\geq 1\}$$
%     \eq d\per(e,d)\in\intf{A}\wedged\in\B_D\}$$
    \fromSlide{2}{ \item 
      The FOL translation is the formula:
      $$\forall x\per E(x)\rightarrow \exists y.A(x,y)\wedge D(y)$$}

  \end{itemize}

\end{slide}}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\overlays{2}{
\begin{slide}{The Relationship Construct}

{\footnotesize\psset{unit=1.1cm}    
   \begin{pspicture}(-1,3)(7,5.4)
        \rput(3.5,5){\rnode{employee}{\psframebox{$E_1$}}}
        \rput(5,3.75){\rnode{project}{\psframebox{$\ldots$}}}
        \rput(6.5,5){\rnode{emp}{\psframebox{$E_n$}}}
        \rput(5,5){\dianode{works}{$R$}}
%        \rput(5.55,4.5){(1,n)}
%        \rput(4.1,2.2){(1,1)}
%        \rput(5.55,3){(1,1)}
        \ncline{employee}{works}
        \ncline{emp}{works}
        \ncline{works}{project}
    \end{pspicture}}

  \begin{itemize}
  \item The meaning of this constraint is:
    $$\intf{R} \subseteq\intf{E_1}\times\ldots\times \intf{E_n}$$
    \fromSlide{2}{ \item 
      The FOL translation is the formula:
      $$\forall x_1,\ldots,x_n\per R(x_1,\ldots,x_n) \rightarrow
      E_1(x_1)\wedge\ldots\wedge E_n(x_n)$$}

  \end{itemize}

\end{slide}}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\overlays{2}{
\begin{slide}{The Cardinality Construct}

{\footnotesize\psset{unit=1.1cm}    
   \begin{pspicture}(-1,3)(7,5.4)
        \rput(3.5,5){\rnode{employee}{\psframebox{$E_1$}}}
        \rput(5,3.7){\rnode{project}{\psframebox{$E_i$}}}
        \rput(6.5,5){\rnode{emp}{\psframebox{$E_n$}}}
        \rput(5,5){\dianode{works}{$R$}}
        \rput(5.3,4.2){(p,q)}
%        \rput(4.1,2.2){(1,1)}
%        \rput(5.55,3){(1,1)}
        \ncline{employee}{works}
        \ncline{emp}{works}
        \ncline{works}{project}
    \end{pspicture}}

  \begin{itemize}
  \item The meaning of this constraint is:
    $$\intf{E_i} \subseteq\{e_i\in\Omega\mid%
    p\leq\sharp(\intf{R}\cap(\Omega\times\{e_i\}\times\Omega))\leq q\}$$
%    p\leq \mid\!\{(e_1,\ldots,e_i,\ldots,e_n)\in\intf{R}\}\!\mid\leq q\}$$
    \fromSlide{2}{ \item 
      The FOL translation is the formula:
      $$\forall x_i\per E(x_i) \rightarrow \parbox[t]{.75\textwidth}{$
        \egx{p} x_1,\ldots,x_{i-1},x_{i+1},\ldots x_n\per R(x_1,\ldots,x_n)\wedge\\
        \elx{q} x_1,\ldots,x_{i-1},x_{i+1},\ldots x_n\per R(x_1,\ldots,x_n)
       $}$$}

  \end{itemize}

\end{slide}}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{slide}{The Cardinality Construct: An Example}
    
{\footnotesize\psset{unit=1.1cm}    
   \begin{pspicture}(-0.5,4.6)(8,5.4)
        \rput(2,5){\rnode{prof}{\psframebox{Professor}}}
        \rput(8,5){\rnode{stud}{\psframebox{Student}}}
        \rput(5,5){\dianode{sup}{Supervises}}
        \rput(3,5.2){(2,3)}
        \rput(7.1,5.2){(1,1)}
%        \rput(5.55,3){(1,1)}
        \ncline{prof}{sup}
        \ncline{sup}{stud}
    \end{pspicture}}

  A valid world description is:
  
      \begin{minipage}[t]{.25\semslidewidth}
    Professor
    
    \begin{tabular}{|c|}
        \hline
        {\it professorId}\\
        \hline
      Alex\\
      Bob\\     
        \hline
    \end{tabular}
    \end{minipage}
    %
    \begin{minipage}[t]{.25\semslidewidth}    
    Student
    
    \begin{tabular}{|c|}
        \hline
        {\it studentId}\\
        \hline
        John\\
        Mary\\
        Nick\\
        Paul\\
        Laura\\
        \hline
    \end{tabular}
    \end{minipage}
    %
    \begin{minipage}[t]{.4\semslidewidth}    
    
    Supervises

    \begin{tabular}{|c|c|}
        \hline
        {\it professorId} & {\it studentId} \\ \hline
     Alex & John \\ 
     Bob  & Laura\\
     Alex & Mary \\
     Bob  & Nick \\
     Alex & Paul \\
        \hline
    \end{tabular}
    \end{minipage}
  
\end{slide}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{slide}{The Cardinality Construct: An Example}
    
{\footnotesize\psset{unit=1.1cm}    
   \begin{pspicture}(-0.5,4.6)(8,5.4)
        \rput(2,5){\rnode{prof}{\psframebox{Professor}}}
        \rput(8,5){\rnode{stud}{\psframebox{Student}}}
        \rput(5,5){\dianode{sup}{Supervises}}
        \rput(3,5.2){(2,3)}
        \rput(7.1,5.2){(1,1)}
%        \rput(5.55,3){(1,1)}
        \ncline{prof}{sup}
        \ncline{sup}{stud}
    \end{pspicture}}

  An invalid world description is:
  
      \begin{minipage}[t]{.25\semslidewidth}
    Professor
    
    \begin{tabular}{|c|}
        \hline
        {\it professorId}\\
        \hline
      Alex\\
      Bob\\     
        \hline
    \end{tabular}
    \end{minipage}
    %
    \begin{minipage}[t]{.25\semslidewidth}    
    Student
    
    \begin{tabular}{|c|}
        \hline
        {\it studentId}\\
        \hline
        John\\
        Mary\\
        Nick\\
        Paul\\
        Laura\\
        \hline
    \end{tabular}
    \end{minipage}
    %
    \begin{minipage}[t]{.4\semslidewidth}    
    
    Supervises

    \begin{tabular}{|c|c|}
        \hline
        {\it professorId} & {\it studentId} \\ \hline
     Alex & John \\ 
     Bob  & Laura\\
     Alex & Mary \\
     Bob  & Nick \\
     Alex & Paul \\
     {\color{blue}Alex} & {\color{blue}Laura} \\
        \hline
    \end{tabular}
    \end{minipage}
  
\end{slide}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


  
  \begin{slide}{The Cardinality Construct: An Example}

{\footnotesize\psset{unit=1.1cm}    
   \begin{pspicture}(-0.5,4)(8,5.4)
        \rput(2,5){\rnode{prof}{\psframebox{Professor}}}
        \rput(8,5){\rnode{stud}{\psframebox{Student}}}
        \rput(5,5){\dianode{sup}{Supervises}}
        \rput(3,5.2){(2,3)}
        \rput(7.1,5.2){(1,1)}
%        \rput(5.55,3){(1,1)}
        \ncline{prof}{sup}
        \ncline{sup}{stud}
    \end{pspicture}}

  \begin{itemize}
  \item The FOL translation is:\\
    $\forall x,y\per {\tt Supervises}(x,y) \rightarrow
    {\tt Professor}(x)\wedge {\tt Student}(y)$ \\
    $\forall x\per {\tt Professor}(x) \rightarrow \parbox[t]{.5\textwidth}{$
    \egx{2} y\per {\tt Supervises}(x,y)\wedge\\
    \elx{3} y\per {\tt Supervises}(x,y) $}$\\
    $\forall y\per {\tt Student}(y) \rightarrow
    \eq x\per {\tt Supervises}(x,y)$

  \end{itemize}

\end{slide}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


  
  \begin{slide}{ISA Relations}

The {\bf ISA} relation is a constraint that specifies {\em sub-entity sets}.

Sub-entity-set = contains entities with more properties -- both more
attributes and different participation in relationships -- not
pertinent to the Super-entity-set.

A Sub-entity-set {\it inherits} all the properties of its
Sub-entity-sets.

\vspace{1cm}
We distinguish between the following different ISA relations:
\begin{itemize}
\item Overlapping Partial;
\item Overlapping Total;
\item Disjoint Partial;
\item Disjoint Total.
\end{itemize}

\end{slide}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\overlays{2}{
\begin{slide}{The Overlapping Partial Construct}

{\footnotesize\psset{unit=1.1cm}    
   \begin{pspicture}(-0.5,2)(8,5.4)
        \rput(5,5){\rnode{e}{\psframebox{$E$}}}
        \rput(3,2.5){\rnode{e1}{\psframebox{$E_1$}}}
        \rput(5,2.5){\rnode{ei}{\psframebox{$\ldots$}}}
        \rput(7,2.5){\rnode{en}{\psframebox{$E_n$}}}
        \rput(5,3.5){\rnode{isa}{\pscirclebox{}}}
%        \rput(3,5.2){(1,3)}
%        \rput(7.1,5.2){(1,1)}
%        \rput(5.55,3){(1,1)}
        \ncline{->}{isa}{e}
        \ncline{e1}{isa}
        \ncline{ei}{isa}
        \ncline{en}{isa}
    \end{pspicture}}

  \begin{itemize}
  \item The meaning of this constraint is:
    $$\intf{E_i} \subseteq \intf{E},~\mbox{for all}~ i=1,\ldots,n.$$
   \fromSlide{2}{ \item
      The FOL translation is the formula:
      $$\forall x\per E_i(x) \rightarrow E(x),~\mbox{for all}~ i=1,\ldots,n.$$}

  \end{itemize}

\end{slide}}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\overlays{2}{
\begin{slide}{The Overlapping Total Construct}

{\footnotesize\psset{unit=1.1cm}    
   \begin{pspicture}(-0.5,2)(8,5.4)
        \rput(5,5){\rnode{e}{\psframebox{$E$}}}
        \rput(3,2.5){\rnode{e1}{\psframebox{$E_1$}}}
        \rput(5,2.5){\rnode{ei}{\psframebox{$\ldots$}}}
        \rput(7,2.5){\rnode{en}{\psframebox{$E_n$}}}
        \rput(5,3.5){\rnode{isa}{\pscirclebox{}}}
%        \rput(3,5.2){(1,3)}
%        \rput(7.1,5.2){(1,1)}
%        \rput(5.55,3){(1,1)}
        \ncline{->}{isa}{e}
        \ncline[doubleline=true]{isa}{e}
        \ncline{e1}{isa}
        \ncline{ei}{isa}
        \ncline{en}{isa}
    \end{pspicture}}

\begin{itemize}
\item The meaning of this constraint is:
   \begin{lefttriarray}
     \intf{E_i} & \subseteq & \intf{E},~~\mbox{for all}~ i=1,\ldots,n\\
     \intf{E}   & \subseteq & \intf{E_1} \cup\ldots\cup\intf{E_n}
   \end{lefttriarray}
   \fromSlide{2}{ \item
     The FOL translation is the set of formulas:
   \begin{lefttriarray}
     \forall x\per E_i(x) & \rightarrow & E(x),~~\mbox{for all}~
     i=1,\ldots,n\\
     \forall x\per E(x) & \rightarrow & E_1(x)\vee\ldots\vee E_n    
   \end{lefttriarray}}
  \end{itemize}

\end{slide}}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\overlays{2}{
\begin{slide}{The Disjoint Partial Construct}

{\vspace{-1.75em}\footnotesize\psset{unit=1.1cm}    
   \begin{pspicture}(-0.5,2)(8,4.7)
        \rput(5,4.5){\rnode{e}{\psframebox{$E$}}}
        \rput(3,2.5){\rnode{e1}{\psframebox{$E_1$}}}
        \rput(5,2.5){\rnode{ei}{\psframebox{$\ldots$}}}
        \rput(7,2.5){\rnode{en}{\psframebox{$E_n$}}}
        \rput(5,3.5){\rnode{isa}{\pscirclebox{$\times$}}}
%        \rput(3,5.2){(1,3)}
%        \rput(7.1,5.2){(1,1)}
%        \rput(5.55,3){(1,1)}
        \ncline{->}{isa}{e}
        \ncline{e1}{isa}
        \ncline{ei}{isa}
        \ncline{en}{isa}
    \end{pspicture}}

\begin{itemize}
\item The meaning of this constraint is:
   \begin{lefttriarray}
     \intf{E_i} \subseteq \intf{E} & \mbox{for all}~ i=1,\ldots,n & \\
     \intf{E_i}\cap\intf{E_j} = \emptyset & \mbox{for all}~ i\not = j&
   \end{lefttriarray}
   \fromSlide{2}{ \item
     The FOL translation is the set of formulas:
   \begin{lefttriarray}
     \forall x\per E_1(x)     & \rightarrow & E(x)\wedge \neg E_2(x)\wedge
                                              \ldots\wedge \neg E_n(x)\\
     \forall x\per E_2(x)     & \rightarrow & E(x)\wedge \neg E_3(x)\wedge
                                              \ldots\wedge \neg E_n(x)\\
     \forall x\per E_{n-1}(x) & \rightarrow & E(x)\wedge \neg E_n(x)\\
     \forall x\per E_{n}(x) & \rightarrow & E(x)
   \end{lefttriarray}}
  \end{itemize}

\end{slide}}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\overlays{2}{
\begin{slide}{The Disjoint Total Construct}

{\vspace{-1.75em}\footnotesize\psset{unit=1.1cm}    
   \begin{pspicture}(-0.5,2)(8,4.7)
        \rput(5,4.5){\rnode{e}{\psframebox{$E$}}}
        \rput(3,2.5){\rnode{e1}{\psframebox{$E_1$}}}
        \rput(5,2.5){\rnode{ei}{\psframebox{$\ldots$}}}
        \rput(7,2.5){\rnode{en}{\psframebox{$E_n$}}}
        \rput(5,3.5){\rnode{isa}{\pscirclebox{$\times$}}}
%        \rput(3,5.2){(1,3)}
%        \rput(7.1,5.2){(1,1)}
%        \rput(5.55,3){(1,1)}
        \ncline{->}{isa}{e}
        \ncline{->}{isa}{e}
        \ncline[doubleline=true]{isa}{e}
        \ncline{e1}{isa}
        \ncline{ei}{isa}
        \ncline{en}{isa}
    \end{pspicture}}

    \vspace{-1.1em}\renewcommand{\arraystretch}{0.99}
\begin{itemize}
\item The meaning of this constraint is: {\footnotesize
   \begin{lefttriarray}
     \intf{E_i} \subseteq \intf{E} & \mbox{for all}~ i=1,\ldots,n & \\
     \intf{E_i}\cap\intf{E_j} = \emptyset & \mbox{for all}~ i\not = j & \\
     \intf{E} \subseteq \intf{E_1} \cup\ldots\cup\intf{E_n} &&
   \end{lefttriarray}}
   \fromSlide{2}{ \item
     The FOL translation is the set of formulas:  {\footnotesize
   \begin{lefttriarray}
     \forall x\per E(x)       & \rightarrow & E_1(x)\vee\ldots\vee E_n \\
     \forall x\per E_1(x)     & \rightarrow & E(x)\wedge \neg E_2(x)\wedge
                                              \ldots\wedge \neg E_n(x)\\
     \forall x\per E_2(x)     & \rightarrow & E(x)\wedge \neg E_3(x)\wedge
                                              \ldots\wedge \neg E_n(x)\\
     \forall x\per E_{n-1}(x) & \rightarrow & E(x)\wedge \neg E_n(x)\\
     \forall x\per E_{n}(x) & \rightarrow & E(x)
   \end{lefttriarray}}}
  \end{itemize}\renewcommand{\arraystretch}{1}

\end{slide}}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


  
  \begin{slide}{FOL Translation: An Example}

{\footnotesize\psset{unit=1.1cm}    
    \begin{pspicture}(-2,2.6)(6,5.1)
        \rput(2,5){\rnode{employee}{\psframebox{Employee}}}
        \rput(6,3.75){\rnode{project}{\psframebox{Project}}}
        \rput(2,4){\rnode{manager}{\psframebox{Manager}}}
        \rput(2.9,2.5){\rnode{tmanager}{\psframebox{TopManager}}}
        \rput(1.1,2.5){\rnode{amanager}{\psframebox{AreaManager}}}
        \rput(2,3.25){\rnode{xmanager}{$\times$}}
        \pscircle(2,3.25){1.2ex}
        \rput(6,5){\dianode{works}{Works\mbox{-}for}}
        \rput(6,2.5){\dianode{manages}{Manages}}
        \rput(5.55,4.5){(1,n)}
        \rput(4.1,2.7){(1,1)}
        \rput(5.55,3){(1,1)}
        \ncline{employee}{works}
        \ncline{works}{project}
        \ncline{tmanager}{manages}
        \ncline{manages}{project}
        \ncline{project}{responsible2}
%        \ncline{responsible2}{orgunit}
        \ncline{tmanager}{manages}
        \ncline{manages}{project}
        \ncline{amanager}{xmanager}
        \ncline{tmanager}{xmanager}
        \ncline{->}{xmanager}{manager}
        \ncline[doubleline=true]{xmanager}{manager}
        \ncline{dept}{xdept}
        \ncline{sig}{xdept}
        \ncline{->}{xdept}{orgunit}
        \ncline[doubleline=true]{xdept}{orgunit}
        \ncline{->}{manager}{employee}
    \end{pspicture}}

    \vspace{2em}
    
    {\footnotesize\renewcommand{\arraystretch}{0.99}
\begin{lefttriarray}
\forall x,y\per{\tt Works\mbox{-}for}(x,y) & \rightarrow &
      {\tt Employee}(x)\wedge {\tt Project}(y) \\
\forall x,y\per{\tt Manages}(x,y)          & \rightarrow &
      {\tt Top\mbox{-}Manager}(x)\wedge {\tt Project}(y)\\
{
\forall y\per{\tt Project}(y)}             & {\rightarrow} &
      { \exists x\per{\tt Works\mbox{-}for}(x,y)} \\
{
\forall y\per{\tt Project}(y)}             & {\rightarrow} &
      {\eq x\per{\tt Manages}(x,y)} \\
{
\forall x\per{\tt Top\mbox{-}Manager}(x)}  & {\rightarrow} &
      {\eq y\per{\tt Manages}(x,y)} \\
{
\forall x\per{\tt Manager}(x)}             & {\rightarrow} &
      {{\tt Employee}(x)} \\
{
\forall x\per{\tt Manager}(x)}             & {\rightarrow} &
      {{\tt Area\mbox{-}Manager}(x)\vee{\tt Top\mbox{-}Manager}(x)}\\
{
\forall x\per{\tt Area\mbox{-}Manager}(x)} & {\rightarrow} &
      {{\tt Manager}(x)\wedge \neg{\tt Top\mbox{-}Manager}(x)}\\
{
\forall x\per{\tt Top\mbox{-}Manager}(x)}  & {\rightarrow} &
      {{\tt Manager}(x)}
\end{lefttriarray}\renewcommand{\arraystretch}{1}}

\end{slide}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\overlays{3}{
\begin{slide}{Additional (integrity) constraints}

{\footnotesize\psset{unit=1.1cm}
     \begin{pspicture}(0.5,2)(11,5.4)
        \rput(2,5){\rnode{employee}{\psframebox{Employee}}}
        \rput(5.25,3.75){\rnode{project}{\psframebox{Project}}}
        \rput(2,4){\rnode{manager}{\psframebox{Manager}}}
        \rput(2.9,2.5){\rnode{tmanager}{\psframebox{TopManager}}}
        \rput(1.1,2.5){\rnode{amanager}{\psframebox{AreaManager}}}
        \rput(9,2.5){\rnode{dept}{\psframebox{Department}}}
        \rput(11,2.5){\rnode{sig}{\psframebox{InterestGroup}}}
        \rput(10,3.75){\rnode{orgunit}{\psframebox{OrganisationalUnit}}}
        \rput(2,3.25){\rnode{xmanager}{$\times$}}
        \rput(10,3){\rnode{xdept}{$\times$}}
        \pscircle(2,3.25){1.2ex}
        \pscircle(10,3){1.2ex}
        \rput(5.25,5){\dianode{works}{Works\mbox{-}for}}
        \rput(5.25,2.5){\dianode{manages}{Manages}}
        \rput(7.25,3.75){\dianode{responsible2}{Resp\mbox{-}for}}
%         \rput(3.85,5.2){(0,n)}
        \rput(5.55,4.5){(1,n)}
        \rput(4.1,2.2){(1,1)}
        \rput(5.55,3){(1,1)}
        \rput(3.85,5.2){\fromSlide{2}{\color{red}(1,n)}}
        \ncline{employee}{works}
        \ncline{works}{project}
        \ncline{tmanager}{manages}
        \ncline{manages}{project}
        \ncline{project}{responsible1}
        \ncline{responsible1}{dept}
        \ncline{project}{responsible2}
        \ncline{responsible2}{orgunit}
        \ncline{tmanager}{manages}
        \ncline{manages}{project}
        \ncline{amanager}{xmanager}
        \ncline{tmanager}{xmanager}
        \ncline{->}{xmanager}{manager}
        \ncline[doubleline=true]{xmanager}{manager}
        \ncline{dept}{xdept}
        \ncline{sig}{xdept}
        \ncline{->}{xdept}{orgunit}
        \ncline[doubleline=true]{xdept}{orgunit}
        \ncline{->}{manager}{employee}
    \end{pspicture}}

\begin{itemize}
\item Managers do not work for a project
  (she/he just manages it).
$$\forall x\per{\tt Manager}(x) \rightarrow 
    \forall y\per\neg {\tt WORKS\mbox{-}FOR}(x,y)$$

\fromSlide{2}{\item If the minimum cardinality
for the participation of employees to the \textit{works-for} 
relationship is increased, then $\ldots$}

\fromSlide{3}{\item If an ISA link is added stating that Interest
Groups are Departments, then $\ldots$}

\end{itemize}

\end{slide}}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\end{document}
