[Attempto] bridging between Thea and Attempto

Kaarel Kaljurand kaljurand at gmail.com
Wed Nov 24 22:51:53 CET 2010


Hi Chris,

On Wed, Nov 24, 2010 at 03:14, Chris Mungall <CJMungall at lbl.gov> wrote:
>
> I think it would be useful to have some kind of bridge between Thea and ACE (see [*]). I think this bridge would be fairly simple to implement, as it appears ACE also uses prolog terms to represent an OWL ontology.

as I've implemented most of the ACE->OWL/SWRL code I'll describe a bit
some of the decisions made and what could be changed. I would also
implement these changes unless somebody disagrees.

First, ACE->OWL/SWRL generates ontologies that do not cover all of
OWL, e.g. they don't contain annotations, imports, namespace prefixes,
and certain data constructs (e.g. facets). So we haven't been thinking
about how to represent them in Prolog.

Second, ACE->OWL/SWRL wants mainly to communicate with the OWL-API
(which is used by the tools AceWiki and ACE View). As the OWL-API
cannot load serialized Prolog terms (btw, it would be cool if somebody
wrote such an OWL reader for the OWL-API), we have written a converter
to OWL 2 XML (which can now also handle SWRL). (There used to be also
a converter into RDF/XML but this is deprecated now as maintaining it
is too much work and is unnecessary if e.g. Thea could do it.)

The XML converter is very simple because the terms can be directly
mapped to XML elements. It's available in the APE tarball in
utils/owlswrl/owlfss_owlxml.pl. A similar converter is included in the
OWL verbalizer, but it works in the other direction, i.e. XML->Prolog,
see:
http://code.google.com/p/owlverbalizer/source/browse/trunk/owlxml_owlfss.pl?spec=svn10&r=2

Ideally they should be merged in a single module which provides a
bidirectional interface.

These two files could be a potential contribution to the Thea code
since both are not specific to ACE nor the DRS, but as I said they
only handle a fragment of OWL, which is either the output of ACE->OWL
or the input to OWL->ACE.

> On the surface the terms used are quite different. ACE uses a single term to represent a whole ontology, like this:
>
>    'Ontology'('http://attempto.ifi.uzh.ch/ontologies/owlswrl/test',
>        ['SubClassOf'('Class'('':cat),
>                'ObjectSomeValuesFrom'('ObjectInverseOf'('ObjectProperty'('':like)),
>                                                                'ObjectOneOf'(['NamedIndividual'('':'John')])))])
>
> In Thea, this would be represented as prolog database with the following facts:
>
>        ontology('http://attempto.ifi.uzh.ch/ontologies/owlswrl/test').
>        subClassOf(cat, someValuesFrom(inverseOf(like),oneOf(['John']))).
>
> The differences seem to be:
>
> * facts rather than a single term

I wouldn't want to change the single term representation. One can
convert between Attempto and Thea by something like:

attempto_to_thea(ontology(Axioms)) :-
    maplist(assert, Axioms).

thea_to_attempto(ontology(Axioms)) :-
    findall(Axiom, axiom(Axiom), Axioms).


> * prolog-friendly lowercasing vs identical strings from the owl2 structural specification

This could be changed in Attempto. I used uppercase term names to be
closer to the OWL spec and to make it easier to generate XML. But for
the Prolog user quoting is really annoying, so I'll change that.

> * use of weakly typed constructs vs strongly typed constructs
>   (we both adhere to the owl2 syntax)

Wouldn't you have ambiguity e.g.

oneOf(['John'])

could be a DataOneOf with "John" a literal (of type rdf:PlainLiteral)
or ObjectOneOf with "John" as an IRI of an individual.

The spec also uses explicit "object" and "data"...

> * typing of the owl entities ('cat' vs 'Class'(cat))

I will change that as it's unnecessarily verbose. The spec uses
explicit typing only in the declaration axioms.


So the above term would become.

    ontology('http://attempto.ifi.uzh.ch/ontologies/owlswrl/test',
        [subClassOf('http://foo#cat',
                objectSomeValuesFrom(objectInverseOf(a:like),
                           objectOneOf(['_':'genid12345'])))])

In this example, I've changed the entity references to show that IRIs
would be atoms, prefixed names would be terms of type atom:atom, and
I'm not entirely sure what to do with anonymous individuals.

> I think it would be very easy for us (Thea) to provide a bridge. Is this something that might interest the ACE community?

I for one would be interested. :)

> I first wanted to check that the term structures above were stable (I would presume they are, as they correspond to the OWL2 structural syntax). Actually, I first wanted to check if there was a volunteer to write this code...
>
> I also just wanted to establish contact, to see if there were other opportunities for code sharing and reuse. No sense in reinventing the wheel.
>

I'll update utils/owlswrl/owlfss_owlxml.pl. Maybe it will become
something that Thea can use.

--
Kaarel


More information about the attempto mailing list