[Pellet-users] Pellet performance on a Jena project
Matteo Montalto
matteo.montalto at fastwebnet.it
Mon May 19 15:30:41 UTC 2008
Hello list, please forgive me for this looong post :-P
I'm doing a work with Jena in order to realize an SWRL rule interpreter;
in order to check results and performance, I did two simple programs
that configure a system as follows:
1) first solution (mine one): I load an ontology from an .owl file into
a base model (with no inference at all); then I build a pellet model
over it (using Pellet as OWL reasoner, disabling the SWRL safe rule
support). Finally, a rule model is built over pellet model. "Visually",
the schema is as follows:
-----------------------------
| upperModel (ruleReasoner) |
| ---------------------- |
| | innerModel (pellet | |
| | no_SWRL) | |
| | ---------------- | |
| | | base (OWL_MEM)| | |
| | ---------------- | |
| | | |
| --------------------- |
-----------------------------
2) second solution (simpler one): I create a pellet model and load in it
my ontology (configuring Pellet to support SWRL safe rules): this is the
schema:
-----------------------------
! pelletModel (pellet and !
! SWRL support)|
-----------------------------
An equivalent schema would be:
-----------------------------
! pelletModel (pellet and !
! SWRL support)|
| ------------------- |
| | base (OWL_MEM) | |
| ------------------- |
-----------------------------
meaning, in this last case, that pelletModel is a model built over a
base model that doesn't make inference and is used only to load the
ontology from the file. (I tell "equivalent" since the creation of the
"nested" model affects by nothing the performance of the overall system
in such a case).
The problem:
while solution 1) goes smooth and with good performance, solution 2)
seems REALLY slow (my test ontology for this case is this one:
http://www.megafileupload.com/en/file/65341/daycare-swrl-owl.html, 35 k,
expressivity ALCOIF(D), with 4 SWRL rules).
To give an idea while solution 1) gives an output in few seconds (the
output is a call of the writeAll() method from Jena API), the second
solution gives the expected output ("expected" to say that, to me, is
correct) in minutes.
I did some tests, using the following java code (that uses Jena):
//solution 2 - snip of the main()
OntModel pelletModel =
ModelFactory.createOntologyModel(PelletReasonerFactory.THE_SPEC);
pelletModel.read("file:myOntFile.owl");
then, in order to get an output file, I used:
File f=new File("PelletOutput.owl");
FileOutputStream fos;
fos = new FileOutputStream(f);
PrintStream ps=new PrintStream(fos);
pelletModel.writeAll(ps, "N3", null);
//ps is a PrintStream variable that I use to write directly on a file,
N3 is the language used.
The writeAll() call makes Pellet trigger, so that I know that in output
I'll find the entire model (base one + inferred sentences).
Such a implementation takes more than half an hour to terminate
successfully, giving a correct output (e.g., also reporting assertions
inferred by the application of SWRL rules).
A similar implementation of solution 1) gives an output in few seconds.
I did also some other tests and asked on the Jena ML, but all makes me
thinking that it's a pellet-related question. Also because, in solution
1), where Pellet is used as owl reasoner without SWRL support,
performance are definitely much better.
Do you have any hint/suggestion to give me?
Thanks! :-)
More information about the Pellet-users
mailing list