[Pellet-users] Query: Pellet Logic Query vs. Jena Direct API vs SPARQL

william fitzgerald wfitzgerald at tssg.org
Tue Jun 26 15:17:55 UTC 2007


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Dear Pellet Experts:

I have a question in relation to querying ontologies using Protege,
Jena, Pellet and ARQ API's. I hope it can provoke some interesting
conversation.

Am I correct in saying there are 3 ways in which an ontology can be queried?

1) OWL-API or Jena API: It provides a way to get a class for example and
list its subclasses, restrictions, individuals and so forth. Hence, in
one sense, one could write and application that queries the ontologies
in this way. For example. a swing GUI could pass in a string to name a
class in return to have its super and subclasses listed etc etc.


2) Pellet: it provides "Logical Query
Capabilities" in the sense that "Equivalent" or "Complete" Classes can
be classified into an existing asserted model. One can view a "complete
class" as a "logical query" placed on the ontology which states
something along the lines of "find me all my subclasses based on my
constraints...". Note: I have used Protege 3.3 and the DIG interface to
Pellet in this way when building an OWL-DL ontology.

3) SPARQL: via Jena's ARQ (or Protege's plugin when in IDE mode), one
can pass SQL like queries over an OWL ontology (OWL-DL) and have a
result passed back based on pattern matching.

4) I suppose a 4th is using SWRL rules!

Note:
A example Query:
SELECT ?subject WHERE { ?subject rdfs:subClassOf <#Vegetable> }";
Example Class Structure:
Vegetable --> Apple --> Magic Apple

I find that in Protege that when this example is run for instance that I
am only returned Apple (regardless of the ontology be already "classified").

However, in Jena ,I notice that I am returned also the subclass of
Apple. Hence I am returned the result of "Apple" and "Magic Apple". Also
Jena seems to return the Vegetable class itself and the Nothing Class.

In the above Jena/pellet output the ontology model is loaded like in the
pellet ClassTree example. Not sure if this has any bearing on the result
differences:
model=ModelFactory.createOntologyModel( PelletReasonerFactory.THE_SPEC);
model.read( ontology );
model.prepare();
((PelletInfGraph) model.getGraph()).getKB().classify();


Interesting results all the same!!!

Anyhow to play devils advocate:
+++++++++++++++++++++++++++++++

Why would I use SPARQL to query an ontology rather than developing an
application that directly uses the OWL-API (or even the Jena API)?

Why shouldn't one just focus on Logic Querying when working solely on
OWL-DL models as opposed to the other two methods?

I suppose ultimately what I am asking is: what advantages/disadvantages
have one over the other and why should one care about it?

I am keen to fully understand the semantic web arena and I believe
answering such questions should help me ( and I presume other beginners
too) in developing and packaging various API's, tools etc to do
something useful with an ontology (OWL-DL models in my case, reasoning
is vital in my case).

Its one thing to develop an ontology with an IDE like Protege, but its
quite another trying to maximize usage of that model in real world end
user applications using Jena and Pellet api's for example to extract the
usefulness of the ontology.


Looking forward to some comments.
regards,
Will.


- --
William M. Fitzgerald,
PhD Student,
Telecommunications Software & Systems Group,
ArcLabs Research and Innovation Centre,
Waterford Institute of Technology,
WIT West Campus,
Carriganore,
Waterford.
Office Ph: +353 51 302937
Mobile Ph: +353 87 9527083
Web: www.williamfitzgerald.org



-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGgS4jIcwlebz1MmwRAhzMAJ9YG3ptavaiMYta6Ht73tKcYyxtxgCfe3zG
Um9sRu0Dzdyv9FJDK5T3LwA=
=DQ/Y
-----END PGP SIGNATURE-----


More information about the Pellet-users mailing list