[Pellet-users] Pellet performance on a Jena project

Matteo Montalto matteo.montalto at fastwebnet.it
Wed May 21 11:58:22 UTC 2008


Matteo Montalto ha detto: in data 19/05/2008 17.30:

> Do you have any hint/suggestion to give me?
> Thanks! :-)

Noone? :( I did believe this could be a "common" problem :(
Anyway, please forgive my auto-reply, it's a bit urgent and now I'm in 
trouble with a related problem; i need to write down on a file a "final" 
ontology, that means, an ontology on which Pellet had worked and that 
contains all the "base" assertions (as loaded by the ontology file) + 
the inferred ones.
The ontology file is here:
http://www.megafileupload.com/en/file/65625/family_swrl_originale-owl.html

The code, using Jena, is really minimal:

import java.io.*;
import com.hp.hpl.jena.rdf.model.*;
import com.hp.hpl.jena.ontology.*;
import org.mindswap.pellet.jena.*;

public class pelletNativeSWRL {
  public static void main (String[] args) throws FileNotFoundException
  {
    OntModel 
pelletModel=ModelFactory.createOntologyModel(PelletReasonerFactory.THE_SPEC);
    pelletModel.read("file:family_swrl_originale.owl");
    File f=new File("pelletOutput.owl");
    FileOutputStream fos;
    try {
        fos = new FileOutputStream(f);
        PrintStream ps =new PrintStream(fos);
        pelletModel.writeAll(ps, "N3", null);
        } catch (FileNotFoundException e) {
        e.printStackTrace();
        }
  }
}

There are two issues I'd like to ask for:
1) even if in the previous post I described a strange, slow behaviour of 
Pellet as reasoner in a precise project... here the situation is even 
worse: I can't get the output file because the program terminates in a 
pair of minutes with an "Exception in thread "main"
java.lang.OutOfMemoryError: Java heap space".
The ontology is 53 k and few swrl rules, and I reserve a max heap space 
for java using the VM flag -Xmx1536M (1,5 Gb) (i have  2gb of RAM..) 
...there should be something I'm missing, seems really a strange problem.

2) performance check: i'd like to measure (in milliseconds) the time 
needed to setup the concrete, final OntModel (that's the sequence: 1 - 
create a pellet Model; 2 - load into this model an ontology from file; 3 
- make pellet trigger and concretize any inferred assertion in the 
pellet Model - Stop. :)
While in other set-ups under Jena I know exactly how to trigger a 
reasoner (for example, if I'm using a fwd chaining reasoner a prepare() 
call on the model makes exactly what I'm looking for), with Pellet I 
don't know where to put my "stop" checkpoint. I know that a writeAll() 
call, or an add() call, makes the reasoner trigger... anyway I can't 
understand why the writeAll() call on a pelletModel as the one described 
above takes ages to finish. So, what's the minimal way, even without 
writing out the resultant model, to make pellet trigger in such a 
configuration?
Thanks a lot for your help.




More information about the Pellet-users mailing list