[Pellet-users] Problems with the Interface Pellet-Jena (performances and not only)

Evren Sirin evren at clarkparsia.com
Thu Jan 31 17:59:02 UTC 2008


On 1/25/08 5:06 AM, Andrea Splendiani wrote:
> Hi,
>
> I have a problem with the interface between Pellet and Jena.
>
> That is:
>
> OntModel myBasicKnowledge
> myOntoKnowledge=ModelFactory.createOntologyModel(PelletReasonerFactory.THE_SPEC,myBasicKnowledge); 
>
> myOntoKnowledge.prepare();
> ...
> OntModel newModel.add(myOntoKnowledge)
> ^^^
> At this point, it starts a huge computation (For small ontologies, it 
> is still reasonable, but it's undoable for bigger ones) (Note: 
> small=~10^2 classes+instances bigger=10^4).
>
> Now, pellet command line and programmatic classification and 
> realization tasks are fast.
>
> When I add the model to an ontology, I guess it issues a 
> listStatements(), I think that at its time prompts the expansion of 
> all possible relations and classes in the ontology, and here lie my 
> problem. Or at least that's my guess.

Yes, this is true.

>
> Can this be avoided ?

Yes, there are couple of options depending on what you are trying to 
accomplish. My first suggestion would be to have a single model that you 
will query, e.g. just create myOntoKnowledge and put everything in it 
(rather that creating an  extra newModel). And if you don't call 
listStatements on this model you should be fine (all computations will 
be done on-demand as you want). If you really want to put myOntKnowledge 
into newModel then add it through OntModel.addSubModel. Whenever you 
query newModel it will pass the query myOntoKnowledge and any other sub 
model it might have. But make sure that newModel is a plain model with 
no reasoners attached.

>
> classification would be enough of a computation for me (ideally, I 
> would like to have computations on demand driven by the Jena model).
>
> Digging on the wen, I've come to the following code:
>
>
> Model tempModel=myOntoKnowledge.getBaseModel();
> OntModel 
> tempModel2=ModelFactory.createOntologyModel(PelletReasonerFactory.THE_SPEC,tempModel); 
>
> tempModel2.prepare();
> OWLReasoner reasoner = 
> ((PelletInfGraph)tempModel2.getGraph()).getOWLReasoner();
> reasoner.classify();
> reasoner.realize();
> myOntoKnowledge=ModelFactory.createOntologyModel(OntModelSpec.OWL_MEM);
> Model m=reasoner.extractModel(false);
> ^^^^^^
> Here still huge computation.
>                
> Any hint/help ?

If classification and realization is completed fast and you got stuck at 
extractModel then this is probably related to the inefficiency of 
extractIndividualModel [1]. One workaround is just to extract only 
inferences regarding class and property models using extractClassModel 
and extractPropertyModel functions. That should be really fast after 
classification is completed.

Cheers,
Evren

[1] http://cvsdude.com/trac/clark-parsia/pellet-devel/ticket/97

>
> Andrea Splendiani
>
>                
>
>
> -----------
> Andrea Splendiani
> post-doc, bootstrep project (www.bootstrep.eu)
>
> UPRES-EA 3888 - Laboratoire d'Informatique Médicale
> CHU de Pontchaillou
> 2, rue Henri Le Guilloux
> 35033 Rennes - France
> Tel : +33 2 99 28 92 45 / +33 2 99 28 42 15 (secr.)
> Fax : +33 2 99 28 41 60
>
> 48° 07.275N
> 1° 41.643W
>
>
>
>
>
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Pellet-users mailing list
> Pellet-users at lists.owldl.com
> http://lists.owldl.com/mailman/listinfo/pellet-users
> _______________________________________________
>
> Sponsored by Clark & Parsia, LLC http://clarkparsia.com/



More information about the Pellet-users mailing list