Demo at CNL 2012

What options for semantic based software development ?

EulerGUI framework

Based on these extreme principles Short fact sheet

Data flow diagram including inference engines

ACE -1-> OWL+SWRL -2-> N3(ontology+rules) -3-> Drools
                            !                   !
                            v                   v
                     Euler, CWM, FuXi         Drools<->
                            |
                            v
                           N3

The first row represents data formats. The arrow 1 is implemeted by ATTEMPTO. The arrow 2 is done by an N3 rule base applied in EulerGUI. The arrow 3 is implemeted by the Java classes DroolsTripleHandler and N3JavaMappingBuiltin .

Depending on project circonstances and team skills, one can enter the train at any "station". Then either Euler engine can be used for one time (batch) run, or Drools for dynamic (stateful) processing.

Software project data flow diagram

Another view stressing on reuse of existing domain ontologies, supplemented by domain expertise in ATTEMPTO Controled English (ACE), plus functional specifications :

data flow diagrams

Forward chaining rule engine

Demonstrations

Write an ontology using ATTEMPTO, extending FOAF

Run APE in command line :

ape.exe -uri http://eulergui.sf.net/contact.owl -ulexfile foaf-lexicon.pl -text \
'If P is a person that has-homepage something and has-current-project something then P is an n:interesting-contact .' \
-solo owlxml > interesting-contact2.owl

Run EulerGUI from command line, reading the OWL file just generated :

eg interesting-contact2.owl http://jmvanel.free.fr/jmv.rdf

jmv.rdf is my FOAF profile on the Internet.

The translation of OWL into N3 is :

@prefix ns2: <http://eulergui.sf.net/contact.owl#>.

{ ?VAR <http://xmlns.com/foaf/0.1/currentProject> ?t0.
  ?VAR <http://xmlns.com/foaf/0.1/homepage> ?t2.
  ?VAR a <http://xmlns.com/foaf/0.1/Person>
} => {
  ?VAR a ns2:interesting-contact}.

Now click on the button to launch Drools engine. Since the URI <htpp://jmvanel.free.fr/jmv.rdf#me> ( that's me ) has a foaf:currentProjet and a foaf:homepage , it is inferred that he is an interesting-contact . To confirm this, one can either use the user Knowledge Base display in tools to see the whole KB. Or one can use the N3 shell to ask this query (just paste it with Ctrl-V) :

@prefix ns2: <http://eulergui.sf.net/contact.owl#>.
?X a ns2:interesting-contact .

The answer appears at once :

<http://jmvanel.free.fr/jmv.rdf#me> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://eulergui.sf.net/contact.owl#interesting-contact> .

Under the hood

There is a local lexicon file for ATTEMPTO APE : foaf-lexicon.pl , that tells how to verbalize the foaf concepts in english :

cat foaf-lexicon.pl 

tv_finsg('has-homepage' ,       iri('http://xmlns.com/foaf/0.1/homepage') ).
tv_infpl('have-homepage' ,      iri('http://xmlns.com/foaf/0.1/homepage') ).
tv_finsg('has-current-project' ,        iri('http://xmlns.com/foaf/0.1/currentProject') ).
tv_infpl('have-current-project' ,       iri('http://xmlns.com/foaf/0.1/currentProject') ).

noun_sg( person,        iri('http://xmlns.com/foaf/0.1/Person'), neutr) .
noun_pl( persons,       iri('http://xmlns.com/foaf/0.1/Person'), neutr) .

How to run the demonstration

  1. install ATTEMPTO APE, see http://attempto.ifi.uzh.ch/site/downloads/
  2. download foaf-lexicon.pl from the link
  3. download EulerGUI , preferably the latest snapshot from http://sourceforge.net/projects/eulergui/files/eulergui/1.11/ ; that is an executable (Java) jar

    EulerGUI Manual is available from help menu

  4. run commands as above

Generate skeleton ATTEMPTO lexicon from an ontology

eg $HOME/ontologies/foaf.rdf \
http://deductions.svn.sourceforge.net/svnroot/deductions/ape/owl2attempto_lexicon.n3