EYE looking through N3 glasses

by Jos De Roo of AGFA

Context is Semantic Web (slides from TimBL)

Subject, verb and object

All knowledge is just a set of statements

<#pat> <#knows> <#jo> .

### in classical logic: knows(pat,jo)

Object can be literal

<#pat> <#knows> <#jo> .
<#pat> <#age> 24 .

Note: noun form "age" preferred to the verb style "knows" for predicates.

Saving space: the comma and semicolon

<#pat> <#child>  <#al>, <#chaz>, <#mo> ;
       <#age>    24 ;
       <#eyecolor> "blue" .

Data .. e.g. a table

age eyecolor
pat 24 blue
al 3 green
jo 5 green

  <#pat>   <#age> 24;  <#eyecolor> "blue" .
  <#al>    <#age>  3;  <#eyecolor> "green" .
  <#jo>    <#age>  5;  <#eyecolor> "green" .

Unnamed things: Square brackets

<#pat> <#child> [ <#age> 4 ] , [ <#age> 3 ].

### in classical logic: ∃x ∃y child(pat,x) ∧ child(pat,y) ∧ age(x,4) ∧ age(y,3)

Note:

  [ <#name> "Pat"; <#age> 24;  <#eyecolor> "blue"  ].
  [ <#name> "Al" ; <#age>  3;  <#eyecolor> "green" ].
  [ <#name> "Jo" ; <#age>  5;  <#eyecolor> "green" ].

Local concept

<> <#title>  "A simple example of N3".

Who or what knows what <#title> is?

Shared concept

<> <http://purl.org/dc/elements/1.1/title>
 "Primer - Getting into the Semantic Web and RDF using N3".

To save space:

@prefix dc:  <http://purl.org/dc/elements/1.1/> .
<> dc:title
  "Primer - Getting into the Semantic Web and RDF using N3".

Note

Making vocabularies

Equivalent:

:Person rdf:type  rdfs:Class
:Person a rdfs:Class.

which we could use with data;

:Pat a :Person.

Examples: class and property

:Woman a rdfs:Class; rdfs:subClassOf :Person .

and a property:

:sister a rdf:Property.

Something about the Property :sister::

:sister rdfs:domain :Person;
        rdfs:range :Woman.

Use:

:Pat  :sister  :Jo.

Convention:

Rules Are Just Statements


#   subject        verb        object
#=============  ==========    ==============
{ ?x :son ?y }      =>        { ?y a :Male }.
{ ?x :son ?y }  log:implies   { ?y a :Male }.

### in classical logic: ∀x ∀y son(x,y) ⇒ male(y)

The terms in braces { } are formulas.

The rule statement relates two formulas.

More Complex Antecedent

{ ?x :son ?y.
  ?y!:age math:lessThan 15 }
 =>
{ ?y a :Boy }

More Complex Consequent

{ ?x :son ?y }
  =>
{ ?y a :Male.
  ?y :parent ?x.
  ?x a :Parent }.

Layer Cake

sweb-stack

EYE, an open source reasoning engine

Detailed design of EYE

EYE under the hood

In the current design of EYE things are integrated as follows:
EYE

Basic MONADIC Benchmark

       triples   cycles |         cwm         eye        jena
                        |       [sec]       [sec]       [sec]
------------------------|------------------------------------
        10,000    1,518 |      15.400       0.420       3.200
       100,000      645 |      99.860       2.190       9.310
     1,000,000      380 |   1,094.860      21.170      75.380
    10,000,000      480 |  (OutOfMem)     231.610     853.060
   100,000,000      480 |               2,640.580   9,217.800
 1,000,000,000      431 |              32,474.540  (OutOfMem)

Test environment:

Linux 4.0.5 x86_64
processor	: 0
model name	: Intel(R) Xeon(R) CPU E5-2665 0 @ 2.40GHz
processor	: 1
model name	: Intel(R) Xeon(R) CPU E5-2665 0 @ 2.40GHz
processor	: 2
model name	: Intel(R) Xeon(R) CPU E5-2665 0 @ 2.40GHz
processor	: 3
model name	: Intel(R) Xeon(R) CPU E5-2665 0 @ 2.40GHz
MemTotal:       264163268 kB


Reference:

https://github.com/josd/bmb

Deep taxonomy benchmark

         depth |         cwm         eye      hermit       jdrew        jena
               |       [sec]       [sec]       [sec]       [sec]       [sec]
---------------|------------------------------------------------------------
            10 |       0.160       0.018       0.055       0.130       0.047
           100 |       1.050       0.022       1.040       0.200       0.422
         1,000 |      65.930       0.063       3.580       0.870       9.302
        10,000 |   7,298.000       0.482     310.510      18.680   2,597.242
       100,000 | 732,974.070       4.808  (OutOfMem)   1,875.000  (OutOfMem)
     1,000,000 |  (848 days)      48.434              (OutOfMem)


Test environment:

Linux 4.0.5 x86_64
processor	: 0
model name	: Intel(R) Xeon(R) CPU E5-2665 0 @ 2.40GHz
processor	: 1
model name	: Intel(R) Xeon(R) CPU E5-2665 0 @ 2.40GHz
processor	: 2
model name	: Intel(R) Xeon(R) CPU E5-2665 0 @ 2.40GHz
processor	: 3
model name	: Intel(R) Xeon(R) CPU E5-2665 0 @ 2.40GHz
MemTotal:       264163268 kB


Reference:

http://ruleml.org/WellnessRules/files/WellnessRulesN3-2009-11-10.pdf

RESTdesc Composition Benchmark

        length |         cwm         eye
               |       [sec]       [sec]
---------------|------------------------
             2 |       0.188       0.029
             4 |       0.371       0.032
             8 |       1.004       0.038
            16 |       3.504       0.053
            32 |      13.968       0.085
            64 |      58.689       0.157
           128 |     251.361       0.344
           256 |   1,081.179       0.936
           512 | (MaxRecurs)       2.894
         1,024 |                   9.764


Test environment:

Linux 4.0.5 x86_64
processor	: 0
model name	: Intel(R) Xeon(R) CPU E5-2665 0 @ 2.40GHz
processor	: 1
model name	: Intel(R) Xeon(R) CPU E5-2665 0 @ 2.40GHz
processor	: 2
model name	: Intel(R) Xeon(R) CPU E5-2665 0 @ 2.40GHz
processor	: 3
model name	: Intel(R) Xeon(R) CPU E5-2665 0 @ 2.40GHz
MemTotal:       264163268 kB


Reference:

https://github.com/RubenVerborgh/RESTdesc-Composition-Benchmark

EYE Server by Ruben Verborgh

Online course by Ruben Verborgh

Semantic Web Reasoning With EYE

Thank You

Thank you for your attention

http://www.agfa.com/w3c/Talks/2012/04swig/