[Pellet-users] Concurrent Use of Pellet - Some Questions
Paolo Bussotti
paolo.bussotti at unifi.it
Fri May 9 09:45:12 UTC 2008
Hi everybody.
With reference to the snippet in the Pellet FAQ about the concurrent use
of Pellet,
which I have included below:
Model model = ModelFactory.createOntologyModel(
PelletReasonerFactory.THE_SPEC, model );
model.read( "http://example.org/ontology" );
/* ... any additional model modification ... */
((PelletInfGraph) model.getGraph()).classify();
model.query( ... );
I would like to know why the graph.classify() is used instead of , for
example, graph.prepare() .
In facts -correct me if I'm wrong -both implies kb.prepare().
So the focus seems to me to be addictionally calling also for
classification. (i.e. to kb.classify through graph.classify()).
I have two questions:
1) If I use an external synchronisation construct allowing threads to
access the pellet-backed model in a mutually exclusive fashion,
both for writing and querying, isn't this enough to ensure a
correct behaviour?
2) Any externally synchronized thread prepares the graph (or the model)
after model manipulation, and therefore the implied call to kb.prepare()
should be done.
So I think that any successively synchronized thread will start with
a kb in the proper state, with changes reset via the kb.prepare()
invocation.
3) If I make changes from the pellet-backed Jena model, prepare it, call
for consistency check and possibly query it both through the model calls
and SPARQL queries, it appears to me from the sources that
classification/realization is done at query time, at least for many
programmatic query. Also SPARQL queries provide correct results and
appear to me (from the required time) to have a similar behaviour. I've
worked with Pellet 1.4. Is it still true for the more recent version? If
it is why then, use graph().classify() each time?
I ask you this because I have to frequently modify the model and
prepare it at the graph level in order to check consistency.
Therefore, I imposed an external synchronization. Moreover I classified
and realise explicitly the model only at the very start, relying to
classification
occurring automatically when querying the model.
I thank you in advance, and hope to not to have formulated my question
in a comprehensible way :-) .
If not, please advise me and I'll try to be more clear.
Best Regards
Paolo Bussotti
More information about the Pellet-users
mailing list