[Attempto] the case of mixing RDF vocabularies : a FOAF example

Kaarel Kaljurand kaljurand at gmail.com
Thu Jun 14 13:29:39 CEST 2012


Hi,

On Wed, Jun 13, 2012 at 1:59 PM, Jean-Marc Vanel
<jeanmarc.vanel at gmail.com> wrote:
>
> 2012/6/13 Kaarel Kaljurand <kaljurand at gmail.com>
>>
>> In the context of ACE->OWL/SWRL you can have lexicon entries like:
>> pn_sg('Mary', iri('http://www.example.com/names#Mary'))
>
> I tried this and it works.
> I updated my lexicon this way :
>
> 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 ).
>
> ( BTW there must be a better way to write this Prolog, by avoiding pasting
> the FOAF prefix at every line, and do a string concatenation ).

The ACE lexicon format is meant to directly reflect the lexicon data
structure that APE uses internally, as such, it not really optimized
for human reading and writing,. The idea is more that this format is
automatically generated from a more user-friendly format. The
generator can then do such prefix expansion etc.

> BTW the iri/1 predicate should be indicated in the doc.

The iri-term in the DRS lemma argument position is a convention that
is only supported by the ACE->OWL/SWRL converter. It is documented
here:

https://github.com/Attempto/APE/tree/master/utils/owlswrl

(I agree the documentation is a bit hidden.)

> Then I rerun APE :
>
>  % 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
>
> and now the result is exactly as expected :
>
> <Ontology
>     xml:base="http://www.w3.org/2002/07/owl#"
>     xmlns="http://www.w3.org/2002/07/owl#"
>     ontologyIRI="http://eulergui.sf.net/contact.owl">
>   <SubClassOf>
>     <ObjectIntersectionOf>
>       <ObjectIntersectionOf>
> <Class IRI="http://xmlns.com/foaf/0.1/#Person"/>
> <ObjectSomeValuesFrom>
>  <ObjectProperty IRI="http://xmlns.com/foaf/0.1/#homepage"/>
>  <Class IRI="http://www.w3.org/2002/07/owl#Thing"/>
> </ObjectSomeValuesFrom>
>       </ObjectIntersectionOf>
>       <ObjectSomeValuesFrom>
> <ObjectProperty IRI="http://xmlns.com/foaf/0.1/#currentProject"/>
> <Class IRI="http://www.w3.org/2002/07/owl#Thing"/>
>       </ObjectSomeValuesFrom>
>     </ObjectIntersectionOf>
>     <Class
> IRI="http://eulergui.sf.net/contact.owl#interesting-contact"/>
>   </SubClassOf>
> </Ontology>
>
> But ... there is a but ...
> If load the resulting OWL/XML file into Protégé + ACE View 1.3.1, I found no
> way to load my lexicon ( and I looked the doc. ) .
> Hence the paraphrases produced are bad .

In case of ACE View the surface forms that correspond to the IRI are
expected to be defined via OWL entity annotation properties. (See the
documentation here:
http://attempto.ifi.uzh.ch/site/docs/owl_to_ace.html) There is no
separately loadable lexicon, i.e. both the axioms and the entity
annotations need to be defined in the OWL files. So, in order to
control the verbalization you need to add these annotations.
ACE->OWL/SWRL cannot add them because it only sees the DRS and not the
lexicon that was used in the creation of the DRS.

> Moreover , the Lexicon view table is not editable.

Yes, that's a bug (or actually a regression), see:

http://code.google.com/p/aceview/issues/detail?id=12

Currently the only option is to directly edit the annotations for
which there is a standard Protege GUI, and possible even some 3rd
party plugins.

> I wonder if ACEWiki has a way to load a lexicon , and I think I saw that.

AceWiki takes the lexicon information form the plain text files in the
data-directory, where there is a file for each word, e.g.

    type:trverb
    words:contains;contain;contained by;
    | If something X is a <1,0> something Y then Y <2,0> X .
    | If X <2,0> Y then X is a <1,0> Y .

To "load" a lexicon, just create such files (with just the first 2
lines in each file) and restart AceWiki.

--
kaarel


More information about the attempto mailing list