$$%% examples \newcommand{\exGraph}{\graph_{\mathrm{ex}}} \newcommand{\exOnto}{\onto_{\mathrm{ex}}} \newcommand{\exMappings}{\mappings_{\mathrm{ex}}} \newcommand{\exExtensions}{\extensions_{\mathrm{ex}}} \newcommand{\exRule}{r_{\mathrm{ex}}} \newcommand{\RDFSrules}{\rules_{\mathrm{RDFS}}} %% RDF \newcommand{\triple}[3]{(#1, #2, #3)} \newcommand{\tuple}[1]{\langle #1 \rangle} \newcommand{\subject}{\mathtt{s}} \newcommand{\prop}{\mathtt{p}} \newcommand{\object}{\mathtt{o}} \newcommand{\blank}{\_{:}b} \newcommand{\blankn}[1]{\_{:}#1} \newcommand{\irin}[1]{{:}\mathrm{#1}} \newcommand{\class}{\mathtt{c}} \newcommand{\nsrdf}{\mathrm{rdf{:}}} \newcommand{\nsrdfs}{\mathrm{rdfs{:}}} \newcommand{\rdftype}{\mathrm{rdf{:}type}} \newcommand{\rdfLiteral}{\mathrm{rdf{:}Literal}} \newcommand{\rdfssubClassOf}{\mathrm{rdfs{:}subClassOf}} \newcommand{\rdfssubPropertyOf}{\mathrm{rdfs{:}subPropertyOf}} \newcommand{\rdfsdomain}{\mathrm{rdfs{:}domain}} \newcommand{\rdfsrange}{\mathrm{rdfs{:}range}} \newcommand{\rdfsClass}{\mathrm{rdfs{:}Class}} \newcommand{\rdfProperty}{\mathrm{rdf{:}Property}} \newcommand{\xsdint}{\mathrm{xsd{:}int}} %% \newcommand{\type}{\tau} \newcommand{\subclass}{\prec_{sc}} \newcommand{\subproperty}{\prec_{sp}} \newcommand{\domain}{\hookleftarrow_{d}} \newcommand{\range}{\hookrightarrow_{r}} \newcommand{\rdfentailment}{\vdash_{^\mathrm{RDF}}} \newcommand{\RDFS}[1]{\mathrm{RDFS}(#1)} \newcommand{\aka}{a.k.a.~} \newcommand{\etc}{etc} \newcommand{\wrt}{w.r.t.~} \newcommand{\st}{s.t.~} \newcommand{\ie}{i.e.,~} \newcommand{\eg}{e.g.,~} \newcommand{\graph}{G} \newcommand{\rules}{\mathcal{R}} \newcommand{\sources}{\mathcal{S}} \newcommand{\views}{\mathcal{V}} \newcommand{\extensions}{\mathcal{E}} \newcommand{\onto}{\mathcal{O}} \newcommand{\mappings}{\mathcal{M}} \newcommand{\modelsrdf}{\models_\rules} \newcommand{\bgp}{P} \newcommand{\Bl}[1]{\mathrm{Bl}(#1)} \newcommand{\Val}[1]{\mathrm{Val}(#1)} \newcommand{\Var}[1]{\mathrm{Var(#1)}} \newcommand{\ext}[1]{\mathrm{ext}(#1)} \newcommand{\cert}{\mathrm{cert}} \newcommand{\ans}{\mathrm{ans}} \newcommand{\query}{\leftarrow} \newcommand{\body}[1]{\textrm{body}(#1)} \newcommand{\head}[1]{\textrm{head}(#1)} \newcommand{\cs}{\mathrm{cs}} \newcommand{\lcs}{\mathrm{lcs}} \newcommand{\cl}{\mathrm{cl}} \newcommand{\lua}{\mathrm{lua}} \newcommand{\lur}{\mathrm{lur}} \newtheorem{lemma}{Lemma} \newtheorem{definition}{Definition} \newtheorem{problem}{Problem} \newtheorem{property}{Property} \newtheorem{corollary}{Corollary} \newtheorem{example}{Example} \newtheorem{theorem}{Theorem} \newcommand{\URIs}{\mathscr U} \newcommand{\IRIs}{\mathscr I} \newcommand{\BNodes}{\mathscr B} \newcommand{\Literals}{\mathscr L} \newcommand{\Variables}{\mathscr V} % DB \newcommand{\CQ}{\ensuremath{\mathtt{CQ}}\xspace} \newcommand{\UCQ}{\ensuremath{\mathtt{UCQ}}\xspace} \newcommand{\SQL}{\ensuremath{\mathtt{SQL}}\xspace} \newcommand{\rel}[1]{\mathsf{#1}} % Cost model \newcommand{\cans}[1]{|#1|_t} \newcommand{\cref}[1]{|#1|_r} \newcommand{\db}{\mathtt{db}} % DL \newcommand{\cn}{\ensuremath{N_{C}}\xspace} \newcommand{\rn}{\ensuremath{N_{R}}\xspace} \newcommand{\inds}{\ensuremath{N_{I}}\xspace} \newcommand{\ainds}{\ensuremath{\mathrm{Ind}}\xspace} \newcommand{\funct}{\mathit{funct} \ } \newcommand{\KB}{\mathcal{K}\xspace} \newcommand{\dlr}{DL-Lite$_{\mathcal{R}}$\xspace} % Logics \newcommand{\FOL}{\ensuremath{\mathtt{FOL}}\xspace} \newcommand{\datalog}{\ensuremath{\mathtt{Datalog}}\xspace} \newcommand{\dllite}{DL-Lite\xspace} \newcommand{\true}{\mathrm{true}} \newcommand{\false}{\mathrm{false}} \newcommand{\dis}{\mathtt{dis}} \newcommand{\vars}[1]{\ensuremath{\mathrm{vars}(#1)}} %\newcommand{\terms}[1]{\ensuremath{\mathrm{terms}(#1)}} %math \renewcommand{\phi}{\varphi} \newcommand\eqdef{\stackrel{\mathclap{\normalfont\mbox{def}}}{=}} \newcommand\restr[2]{#1_{|#2}} \newcommand{\ontoBody}[1]{\mathrm{body}_\onto(#1)} %proof of the rewriting theorem \newcommand{\rdfGraph}{\graph^{\mappings}_{\extensions}} \newcommand\systemGraph{\graph^{\mappings \cup \mappings^{\text{STD}}_\onto}_{\extensions \cup \extensions_\onto}} \newcommand\viewsGraph{\graph^{\mappings^{\rules,\onto} \cup \mappings^{\text{STD}}_\onto}_{\extensions \cup \extensions_\onto}} \newcommand{\standMappings}{\mappings^{\text{STD}}_\onto} \newcommand{\reminder}[1]{[\vadjust{\vbox to0pt{\vss\hbox to0pt{\hss{\Large $\Longrightarrow$}}}}{{\textsf{\small #1}}}]} %\newcommand{\FG}[1]{\textcolor{blue}{\reminder{FG:~#1}}} \newcommand{\extVersion}{false} \newcommand{\printIfExtVersion}[2] { \ifthenelse{\equal{\extVersion}{true}}{#1}{} \ifthenelse{\equal{\extVersion}{false}}{#2}{} } \newcommand{\bda}{\true} \newcommand{\ifBDA}[2]% {% \ifthenelse{\equal{\bda}{true}}{#1}{}% \ifthenelse{\equal{\bda}{false}}{#2}{}% } %%% Local Variables: %%% TeX-master: "paper" %%% End: $$

Full RDFS Saturation

Example on QA test

We load the QA test graph with saturation:

java -jar ~/inria/code/ontosql/rdf-db/target/RDFDBDirectory/ontosql-rdfdb-1.0.7-SNAPSHOT-with-dependencies.jar -input ../projects/qa-test/qa-test.nt -pf ../projects/qa-test/qa-test.properties

We execute the following queries to get the saturation of the graph.

-- We need to insert the missing line about type in dictinary table
   INSERT INTO dictionary 
   VALUES (21, '<http://www.w3.org/1999/02/22-rdf-syntax-ns#type>');

   SELECT d1.value as s, d2.value as p, d3.value as o 
   FROM encoded_sat, dictionary as d1, dictionary as d2, dictionary as d3 
   WHERE encoded_sat.s = d1.key AND encoded_sat.p = d2.key AND encoded_sat.o = d3.key;  

There are 27 triples in the full saturation computed by rdf-db:

psql -d qatest -c "INSERT INTO dictionary 
   VALUES (21, '<http://www.w3.org/1999/02/22-rdf-syntax-ns#type>');"
psql -d qatest -c "SELECT d1.value as s, d2.value as p, d3.value as o 
   FROM encoded_sat, dictionary as d1, dictionary as d2, dictionary as d3 
   WHERE encoded_sat.s = d1.key AND encoded_sat.p = d2.key AND encoded_sat.o = d3.key;"

       s       |                          p                           |       o       
---------------+------------------------------------------------------+---------------
 <Orsay>       | <http://www.w3.org/1999/02/22-rdf-syntax-ns#type>    | <Thing>
 <Montpellier> | <http://www.w3.org/1999/02/22-rdf-syntax-ns#type>    | <Place>
 <Maxime>      | <http://www.w3.org/1999/02/22-rdf-syntax-ns#type>    | <Thing>
 <Palaiseau>   | <http://www.w3.org/1999/02/22-rdf-syntax-ns#type>    | <Place>
 <Ioana>       | <livesIn>                                            | <Palaiseau>
 <Montpellier> | <http://www.w3.org/1999/02/22-rdf-syntax-ns#type>    | <Thing>
 <Orsay>       | <http://www.w3.org/1999/02/22-rdf-syntax-ns#type>    | <Place>
 <Palaiseau>   | <http://www.w3.org/1999/02/22-rdf-syntax-ns#type>    | <Thing>
 <Orsay>       | <http://www.w3.org/1999/02/22-rdf-syntax-ns#type>    | <City>
 <Maxime>      | <contact>                                            | "245470000"
 <Place>       | <http://www.w3.org/2000/01/rdf-schema#subClassOf>    | <Thing>
 <livesIn>     | <http://www.w3.org/2000/01/rdf-schema#range>         | <City>
 <Person>      | <http://www.w3.org/2000/01/rdf-schema#subClassOf>    | <Thing>
 <Montpellier> | <http://www.w3.org/1999/02/22-rdf-syntax-ns#type>    | <City>
 <Maxime>      | <livesIn>                                            | <Orsay>
 <Palaiseau>   | <http://www.w3.org/1999/02/22-rdf-syntax-ns#type>    | <City>
 <François>    | <livesIn>                                            | <Lannion>
 <Thing>       | <http://www.w3.org/2000/01/rdf-schema#subClassOf>    | <Thing>
 <phoneNumber> | <http://www.w3.org/2000/01/rdf-schema#subPropertyOf> | <contact>
 <contact>     | <http://www.w3.org/2000/01/rdf-schema#domain>        | <Person>
 <City>        | <http://www.w3.org/2000/01/rdf-schema#subClassOf>    | <Place>
 <Lannion>     | <http://www.w3.org/1999/02/22-rdf-syntax-ns#type>    | <City>
 <Maxime>      | <phoneNumber>                                        | "245470000"
 <Lannion>     | <http://www.w3.org/1999/02/22-rdf-syntax-ns#type>    | <Place>
 <Marie-Laure> | <livesIn>                                            | <Montpellier>
 <Lannion>     | <http://www.w3.org/1999/02/22-rdf-syntax-ns#type>    | <Thing>
 <Maxime>      | <http://www.w3.org/1999/02/22-rdf-syntax-ns#type>    | <Person>
(27 rows)

The following 5 schema triples are not generated during the saturation:

<City> <http://www.w3.org/2000/01/rdf-schema#subClassOf> <Thing> .

<phoneNumber> <http://www.w3.org/2000/01/rdf-schema#domain> <Person> .
<phoneNumber> <http://www.w3.org/2000/01/rdf-schema#domain> <Thing> .
<contact>  <http://www.w3.org/2000/01/rdf-schema#domain> <Thing> .

<livesIn> <http://www.w3.org/2000/01/rdf-schema#range> <Place> .
<livesIn> <http://www.w3.org/2000/01/rdf-schema#range> <Thing> .

TODO Implementation