[Pellet-users] Pellet API tutorial
Pavel Klinov
pklinov at clarkparsia.com
Wed Apr 16 17:39:40 UTC 2008
Hi, Andrea
You're right, tutorials aren't yet there and I'll try to write some
soon. The API itself is very simple, basically you only need to worry
about the main reasoner interface (com.clarkparsia.pronto.ProntoReasoner
[1]) which provides methods for probabilistic entailments as well as
satisfiability/consistency checking + probabilistic explanations.
Couple of examples of using it (taken from the test suite [2]):
PTBox entailment (i.e. KB |= (D|C)[l,u] where C and D are OWL classes):
ProbKnowledgeBase pkb = new KBStandaloneLoader().load( +++Here
goes your ontology URI+++); //Load the probabilistic knowledge base
ProntoReasoner reasoner = new ProntoLexicographicReasoner( new
PSATSolverImpl() ); //Create the reasoner
ConditionalConstraint awfCC = reasoner.subsumptionEntailment(
pkb, ATermUtils
.makeTermAppl( +++ C class URI +++ ),
ATermUtils.makeTermAppl( +++ D class URI +++ ) ); //Probabilistic
entailment
assertEquals( 0.1, awfCC.getLowerBound(), 0.0001 ); //Verifying
the results
assertEquals( 0.5, awfCC.getUpperBound(), 0.0001 );
PABox entailment works similarly (KB |= (C|owl:Thing)[l, u] for a
particular individual)
ProbKnowledgeBase pkb = new KBStandaloneLoader().load( +++Here
goes your ontology URI+++); //Load the probabilistic knowledge base
ProntoReasoner reasoner = new ProntoLexicographicReasoner( new
PSATSolverImpl() ); //Create the reasoner
ConditionalConstraint tweetyCC = reasoner.membershipEntailment(
pkb, ATermUtils
.makeTermAppl( +++Individual URI+++),
ATermUtils.makeTermAppl( +++ C class URI +++ ) ); //Probabilistic
entailment
assertEquals( 0.28, tweetyCC.getLowerBound(), 0.0001 );
//Verifying the results
assertEquals( 0.72, tweetyCC.getUpperBound(), 0.0001 );
You might want to take a look at the JUnit test class [2] and the test
ontologies [3]. Hopefully I'll write something up fairly soon and this
won't be needed any more!
cheers,
--pavel
[1]
http://cvsdude.com/trac/clark-parsia/pronto/browser/tags/release-0.1/src/com/clarkparsia/pronto/ProntoReasoner.java
[2]
http://cvsdude.com/trac/clark-parsia/pronto/browser/tags/release-0.1/src/com/clarkparsia/pronto/ProntoLexicographicReasonerTest.java
[3]
http://cvsdude.com/trac/clark-parsia/pronto/browser/tags/release-0.1/test_data/lex_reasoner
asru83 at alice.it wrote:
>
> Dear Pellet users and developers,
> I am having difficulties in using Pronto because there are not
> tutorials about use of Pronto APIs: there are only Pronto APIs
> (without showing any correlations between classes or any examples
> about possible chains of invocations of methods) and theoretical
> explanation of probabilistic reasoning algorithm (without pratical
> examples with use of APIs).
> I would be helped
> Sorry for my bad English
> Thanks
> Andrea
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> 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