jeudi 12 juillet 2012

Example with ACE Controled Natural Language => OWL => N3 rules

Example with ACE Controled Natural Language => OWL => N3 rules

ATTEMPTO ACE is a Controled Natural Language, that is, a formal language but looking like normal english. It is usable as a modeling and specification language for EulerGUI framework.
Run APE in command line :
% ape.exe -uri -ulexfile -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 htpp://
jmv.rdf is my FOAF profile on the Internet.

The translation of OWL into N3 is :
@prefix ns2: <>.

{ ?VAR <> ?t0.
  ?VAR <> ?t2.
  ?VAR a <>
} => {
  ?VAR a ns2:interesting-contact}.

Now click on the button to launch Drools engine. Since the URI <htpp://> ( 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) :
?X a ns2:interesting-contact .
The answer appears at once :
<> <> <> .

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

tv_finsg('has-homepage' ,       iri('') ).
tv_infpl('have-homepage' ,      iri('') ).
tv_finsg('has-current-project' ,        iri('') ).
tv_infpl('have-current-project' ,       iri('') ).

noun_sg( person,        iri(''), neutr) .
noun_pl( persons,       iri(''), neutr) .

How to run the demonstration
  1. install ATTEMPTO APE, see
  2. download from the link
  3. download EulerGUI , preferably the latest snapshot from ; that is an executable (Java) jarEulerGUI Manual is available from help menu
  4. run commands as above

Aucun commentaire:

Enregistrer un commentaire