[Pellet-users] SWRL in Pellet

Evren Sirin evren at clarkparsia.com
Tue May 29 12:20:31 UTC 2007


On 5/24/07 10:35 AM, sjtirtha wrote:
>
> I send you my owl file. It includes also the rules in swrl. How about 
> the built-in Function support of SWRL in Pellet? Is it implemented 
> already?
No, we don't have any immediate plans to implement support for built-in 
functions. Any rule that uses built-in functions (or 
DatavaluedPropertyAtom) will currently be ignored by Pellet. And there 
was a bug in Pellet 1.4 regarding DL-safe rules which seems to affect 
the ontology you have. This is why you don't see no inferences. This bug 
is fixed in the current SVN and when I tried these rules I got the 
inferences regarding uncles and aunts (though it was very slow to get 
all the results and I didn't check for the completeness of answers).

Cheers,
Evren


>  
> Steve
>
>  
> On 5/24/07, *Evren Sirin* <evren at clarkparsia.com 
> <mailto:evren at clarkparsia.com>> wrote:
>
>     On 5/21/07 5:46 AM, sjtirtha wrote:
>     > Hi,
>     >
>     > I've posted  it once, but nobody answers.
>     >
>     > My code doesn't reason the rules, that I defined in
>     family_rules.owl .
>     >
>     > I don't get any error. I assume that OWL API parses the rules
>     correctly.
>     >
>     > Do I need to activate the rules engine inside the reasoner ? Is
>     there
>     > anything like that.
>     No, rule reasoning is turned on by default. What you do below
>     should get
>     the inferences caused by rules. If you could provide the rules
>     file and
>     specify which inferences is missing then we can take a look.
>
>     Cheers,
>     Evren
>     >
>     > Steve
>     >
>     >
>     ############################################################################
>     >
>     > String OWL_OBJ =
>     > "file:src/family_rules.owl"; *try* {
>     >
>     > System.
>     >
>     > /out/.println("Reading file " + OWL_OBJ + "..." );
>     >
>     > Reasoner reasoner =
>     >
>     > *new* Reasoner();
>     >
>     > OWLOntologyManager manager =
>     OWLManager./createOWLOntologyManager/();
>     >
>     > OWLOntology ontology = manager.loadOntology(URI./create/(OWL_OBJ));
>     >
>     > reasoner.setManager(manager);
>     >
>     > reasoner.loadOntologies(ontology);
>     >
>     > reasoner.getKB().realize();
>     >
>     > reasoner.getKB().printClassTree();
>     >
>     > OWLClass human = reasoner.getClass(URI./create/(
>     >
>     > " http://www.w3c.org/swrl/family .owl#human
>     > <http://www.w3c.org/swrl/family.owl#human>" ));
>     >
>     > OWLObjectProperty hasUncle =
>     reasoner.getObjectProperty(URI./create/(
>     >
>     > " http://www.w3c.org/swrl/family.owl#hasUncle
>     > <http://www.w3c.org/swrl/family.owl#hasUncle>"));
>     >
>     > OWLObjectProperty hasAunt = reasoner.getObjectProperty(URI./create/(
>     >
>     > " http://www.w3c.org/swrl/family.owl#hasAunt
>     > < http://www.w3c.org/swrl/family.owl#hasAunt>")); // get all
>     instances
>     > of human class
>     >
>     > Set individuals = reasoner.getIndividuals(human,
>     >
>     > *false*);
>     >
>     > System.
>     >
>     > /out/.println("Size: " + individuals.size()); *for*(Iterator i =
>     > individuals.iterator(); i.hasNext(); ) {
>     >
>     > OWLIndividual ind = (OWLIndividual) i.next();
>     >
>     > Set uncles = reasoner.getRelatedIndividuals(ind, hasUncle);
>     >
>     > Set aunties = reasoner.getRelatedIndividuals(ind, hasAunt);
>     >
>     > // print the results
>     >
>     > System.
>     >
>     > /out/.println("Name: " + ind.getURI().toString());
>     >
>     > System.
>     >
>     > /out/.println("\tUncles: " + uncles.size());
>     >
>     > System.
>     >
>     > /out/.println("\tAunties: " + uncles.size()); /*
>     >
>     > if(uncles != null)
>     >
>     > System.out.println("\tUncle: " + uncles.getURI().toString());
>     >
>     > if(aunties != null)
>     >
>     > System.out.println("\tAunt: " + aunties.getURI().toString());
>     >
>     > */
>     >
>     > System.
>     >
>     > /out/.println();
>     > }
>     > ####################################################################
>     >
>     ------------------------------------------------------------------------
>
>     >
>     > _______________________________________________
>     > Pellet-users mailing list
>     > Pellet-users at lists.owldl.com <mailto:Pellet-users at lists.owldl.com>
>     > http://lists.owldl.com/mailman/listinfo/pellet-users
>     > _______________________________________________
>     >
>     > Sponsored by Clark & Parsia, LLC http://clarkparsia.com/
>     <http://clarkparsia.com/>
>
>


More information about the Pellet-users mailing list