Search Mailing List Archives


Limit search to: Subject & Body Subject Author
Sort by: Reverse Sort
Limit to: All This Week Last Week This Month Last Month
Select Date Range     through    

[protege-owl] How to bind SWRL rules with an instance of the Protege Pellet reasoner?

Mariusz Gwiazda mgwiazda at onet.eu
Mon May 19 01:17:56 PDT 2008


Dietsk,

Well I'm not expert of Protege Pellet reasoner implementation but I'll 
try to answer you.

1) You wrote: "I wonder whether Pellet Reasoner could run all SWRL rules"

What you mean by "all SWRL rules"? I think this reasoner can run all 
rules that Pellet can run. Pellet hasn't supported protege build-ins 
yet, so if you use that build-ins you should consider to run rules via 
SWRLTab API.

2) You wrote: "Would you please tell me how to let Jena reasoner know 
where SWRL rules writen by me is?(that is , should I write the special 
file containing SWRL rules ,if in this case,what name and where should 
the file be? Or, should I put SWRL rules in my source java code?)"

SWRL rules have to be in your OWL model that you bind with Pellet 
reasoner instance. So, you can put your rules directly in your ontology 
or create separate owl file with that rules and import it into your owl 
model. If you want to create swrl rules programmatically, you can use 
SWRLTab API [1].

3) You wrote: "Your sending me your source java code on the above work 
will be highly appreciated."

I don't have any special code to run swrl via Pellet. I created owl 
ontology with SWRL rules in Protege Editor. In my application I create 
owl model:

JenaOWLModel owlModel = ProtegeOWL.createJenaOWLModelFromURI(uri);

then I bind it to Pellet reasoner instance:

ReasonerManager reasonerManager = ReasonerManager.getInstance();
ProtegeReasoner reasoner = 
reasonerManager.createProtegeReasoner(owlModel, 
ProtegePelletJenaReasoner.class);

and finally, when I invoke reasoner methods, e. g.:

Collection propValues = reasoner.getRelatedIndividuals(indiv, 
(OWLObjectProperty) prop);

Pellet just use my swrl rules to infer property values.

Best wishes,
Mariusz


[1] http://protege.cim3.net/cgi-bin/wiki.pl?SWRLFactoryFAQ


qldiao wrote:
> Hi Mariusz,
> Thanks a lot.
> From the thread that you give me, I read the following message:
>
> ".....
> >> 2) Can this reasoners run SWRL rules?
> >>
> >>
> >
> > The SWRL rules are not converted in the current reasoner
> >implementations. We will have this feature soon for the OWL-API 
> reasoner.
> (answered by Tania)
> >
> and you wrote:
>
> Are you sure that Jena reasoner implementation doesn't fire SWRL 
> rules? In attached ontology is a class "Spadkodawca".
> Definition of this class is: "Osoba AND spadekOtwarto SOME xsd:dateTime".
> On this ontology is also SWRL rule: "umarlDnia(?x, ?y) ¡ú 
> spadekOtwarto(?x, ?y)".
> Instance "Jarek_Xksinski" has property "umarlDnia" but not property 
> "spadekOtwarto". Jena implementations returns that
> inferred type of this instance is "Spadkodawca",
> OWL-API doesn't return this information. For me it looks like this 
> SWRL rule is fired. But maybe I'm wrong.
> ....... "
>
> From the above message, I wonder whether Pellet Reasoner could run all 
> SWRL rules. Would you please tell me how to let Jena reasoner know 
> where SWRL rules writen by me is?(that is , should I write the special 
> file containing SWRL rules ,if in this case,what name and where should 
> the file be? Or, should I put SWRL rules in my source java code? )
> Your sending me your source java code on the above work will be highly 
> appreciated.
> Best wishes,
> Dietsk
>
> ÔÚ2008-05-18£¬"Mariusz Gwiazda" <mgwiazda at onet.eu> дµÀ£º
>
>     Dietsk,
>
>     Pellet (Jena implementation) in Protege just use SWRL rules during 
>     reasoning (e.g classifyTaxonomy() ) and doesn't have special method to 
>     operate on SWRL rules. SWRL rules are transfered to pellet automatically 
>     when you bind owl model to pellet. I think this is undocumented feature, 
>     more you can read in thread [1]
>
>     Best wishes,
>     Mariusz
>
>     [1] 
>     http://www.nabble.com/Difference-between-Pellet-reasoner-instances-td14361015.html#a14722869
>
>
>     qldiao wrote:
>     > Mariusz,
>     > Thank you very much for your reply.
>     > I know how to access a direct (Pellet) or a DIG-compliant (e.g RACER) 
>     > reasoners,but do not know how to run SWRL rules via Pellet use Jena 
>     > implementation. Once I get an instance of the Protege Pellet reasoner, 
>     > I can use the reasoner to get information for a particular OWl entity 
>     > with such methods as 
>     > reasoner.getSubclasses(),reasoner.getDescendantClasses
>     > (),reasoner.classifyTaxonomy() etc. However,I could not find any 
>     > method to bind SWRL rules with the reasoner? How I get the information 
>     > about the method of reasoner?
>     > Best wishes,
>     > Dietsk
>     >
>     >
>     > ÔÚ2008-05-18£¬"Mariusz Gwiazda" <mgwiazda at onet.eu> дµÀ£º
>     >
>     >     Dietsk,
>     >
>     >     Protege-OWL API provides programmatic access to a direct (Pellet) or a 
>     >     DIG-compliant (e.g RACER) reasoners [1]. There is two direct Pellet 
>     >     connection implementations. First based on Jena API 
>     >     (ProtegePelletJenaReasoner.class) and second based on OWL-API. If you 
>     >     want to run SWRL rules via Pellet use Jena implementation. It's also 
>     >     possibility to run SWRL rules using SWRLTab [2] that support SQWRL 
>     >     queries too.
>     >
>     >     Best wishes,
>     >     Mariusz
>     >
>     >     [1] http://protegewiki.stanford.edu/index.php/ProtegeReasonerAPI
>     >     [2] http://protege.cim3.net/cgi-bin/wiki.pl?SWRLTab
>     >
>     >
>     >
>     >         
>     >
>     >
>     >
>     > ------------------------------------------------------------------------
>     > Öйú ×î Ç¿ Íø ÓÎ --- Íø Ò× ÃÎ »Ã Î÷ ÓÎ £¬166 Íò Íæ ¼Ò Í¬ ʱ ÔÚ Ïß 
>     > <http://event.mail.163.com/chanel/click.htm?from=NO_26&domain=163>
>     > ------------------------------------------------------------------------
>     >
>     > _______________________________________________
>     > protege-owl mailing list
>     > protege-owl at lists.stanford.edu
>     > https://mailman.stanford.edu/mailman/listinfo/protege-owl
>     >
>     > Instructions for unsubscribing: http://protege.stanford.edu/doc/faq.html#01a.03 
>     >   
>
>         
>
>
>
> ------------------------------------------------------------------------
> ÉîÇ৵¿ãë´¨´óµØÕðÓöÄÑͬ°û£¡ 
> <http://mail.163.com/hd/all/redirect/sos.htm>
> ------------------------------------------------------------------------
>
> _______________________________________________
> protege-owl mailing list
> protege-owl at lists.stanford.edu
> https://mailman.stanford.edu/mailman/listinfo/protege-owl
>
> Instructions for unsubscribing: http://protege.stanford.edu/doc/faq.html#01a.03 
>   




More information about the protege-owl mailing list