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] reloading swrl rules for re-execution

zhang weishan dr_zhangws at yahoo.com
Tue Jan 1 12:29:03 PST 2008


Hello Martin,
  Thank you for your information.
  I get problem with the reloading issue:
 It seems that sequence is working the same way as infer().
            bridge.importSWRLRulesAndOWLKnowledge();
            bridge.run();
 The instances in the ontology are updated periodically, but i always get the same reasoning result (same j value in my case), which should not be the case.
  Below is the method which is quite simple, and called in another class, 'bridge' is private attribute.
public HashSet<String> getAllSWRLInferred() {
        HashSet<String> set = new HashSet<String>();

        try {
        //    bridge.infer();
            bridge.importSWRLRulesAndOWLKnowledge();
            bridge.run();
        } catch (SWRLRuleEngineException e) {
            e.printStackTrace();
        }

        int i = bridge.getNumberOfInferredIndividuals();
        // System.out.println("getNumberOfInferredIndividuals: "+i);
        if (i > 0) {
            
            Set<OWLIndividual> infered = bridge.getInferredIndividuals();

            for (Iterator it = infered.iterator(); it.hasNext();) {
                set.add(it.next().toString());
            }
        }
        int j = bridge.getNumberOfInferredPropertyAssertionAxioms();
        System.out.println("getNumberOfInferred Property:  " + j);
        if (j > 0) {// System.out.println("getNumberOfInferredIndividuals "+i);
            Set<OWLPropertyAssertionAxiom> infered = bridge
                    .getInferredPropertyAssertionAxioms();

            for (Iterator it = infered.iterator(); it.hasNext();) {

                // System.out.println("...."+it.next());
                set.add(it.next().toString());
            }
        }
        
        return set;
    }





----- Original Message ----
From: Martin O'Connor <martin.oconnor at stanford.edu>
To: User support for  Protege-OWL editor <protege-owl at lists.stanford.edu>
Sent: Monday, December 31, 2007 3:58:04 AM
Subject: Re: [protege-owl] reloading swrl rules for re-execution



The method is importSWRLRulesandOWLKnowledge(). cf. [1]

Rule grouping is something I am working on but it is not currently 
available. Hopefully in a month or so I will have something. 
Parameterized rules are only a vague idea at the moment though we are 
thinking about it for a project that we are working on.

Martin

[1] 
http://protege.stanford.edu/download/prerelease_javadoc_owl/edu/stanford/smi/protegex/owl/swrl/SWRLRuleEngine.html

zhang weishan wrote:

> Hello Martin,
>   I could not find the loadSWRLRulesAndOWLKnowledge() method in the 
> SWRLRuleEngine interface. And running infer() method, and then 
> reset(), could not help.
>   I also found that there is infer(rulegroup) which is interesting, 
> how to use a rule group, any examples?
>   I remembered some time ago, there is a message say that there will 
> be dynamic rule support, or parameterized rule... Are these features 
> available?
>
>   Best,
>   Weishan
>  
>
>
> ----- Original Message ----
> From: Martin O'Connor <martin.oconnor at stanford.edu>
> To: protege-owl at lists.stanford.edu
> Sent: Sunday, December 30, 2007 5:46:28 AM
> Subject: Re: [protege-owl] reloading swrl rules for re-execution
>
>
> My suggestion about the infer() call may not be the best choice now 
> that I think of it because this call saves inferred knowledge back to
 
> the OWL model. Using the sequence:
>
> ruleEngine.loadSWRLRulesAndOWLKnowledge()
> ruleEngine.run()
>
> will do the inference but will not save the inferred knowledge to the
 
> OWL model, which I think is what you were looking for.
>
> Martin
>
> Quoting zhang weishan <dr_zhangws at yahoo.com 
> <mailto:dr_zhangws at yahoo.com>>:
>
> > Thank you Martin.
> > The whole Protege website is not accessible here. I noticed this 
> > happened several times during weekend...
> >
> >
> > ----- Original Message ----
> > From: Martin O'Connor <martin.oconnor at stanford.edu 
> <mailto:martin.oconnor at stanford.edu>>
> > To: protege-owl at lists.stanford.edu 
> <mailto:protege-owl at lists.stanford.edu>
> > Sent: Sunday, December 30, 2007 4:28:01 AM
> > Subject: Re: [protege-owl] reloading swrl rules for re-execution
> >
> >
> >
> > The web site works for me. Which pages are down for you?
> >
> > When you open an OWL model from a file it is effectively reloaded.
> > Also, if you do not save the inferred knowledge when running a rule
> > engine, a new call to infer() [1] will effectively reload the
 model.
> >
> > Martin
> >
> >
> > [1]
> > 
>
 http://protege.stanford.edu/download/prerelease_javadoc_owl/edu/stanford/smi/protegex/owl/swrl/SWRLRuleEngine.html
> >
> > Quoting zhang weishan <dr_zhangws at yahoo.com 
> <mailto:dr_zhangws at yahoo.com>>:
> >
> >> Dear All,
> >>  How to re-load the model in order to re-evaluate the rules? I
 need
> >
> >>  to update instances of some concepts and then check the and
 execute
> >
> >>  the related swrl rules.
> >>  Is the protege web site down? I could not access to any api docs.
> >>
> >>  Thank you,
> >>  Weishna
> >>
> >>
> >>
> >>
> >>
> >>
> >   
> > 
>
 ____________________________________________________________________________________
> >> Never miss a thing.  Make Yahoo your home page.
> >> http://www.yahoo.com/r/hs
> >
> >
> > _______________________________________________
> > protege-owl mailing list
> > protege-owl at lists.stanford.edu
 <mailto: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
> >
> >
> >
> >
> >
> >
> >       
> > 
>
 ____________________________________________________________________________________
> > Looking for last minute shopping deals?
> > Find them fast with Yahoo! Search.   
> >
 http://tools.search.yahoo.com/newsearch/category.php?category=shopping
>
>
> _______________________________________________
> protege-owl mailing list
> protege-owl at lists.stanford.edu
 <mailto: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
>
>
>
 ------------------------------------------------------------------------
> Never miss a thing. Make Yahoo your homepage. 
> <http://us.rd.yahoo.com/evt=51438/*http://www.yahoo.com/r/hs>
>
>------------------------------------------------------------------------
>
>_______________________________________________
>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 
>  
>

_______________________________________________
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 






      ____________________________________________________________________________________
Never miss a thing.  Make Yahoo your home page. 
http://www.yahoo.com/r/hs
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.stanford.edu/pipermail/protege-owl/attachments/20080101/8e8f079d/attachment.html>


More information about the protege-owl mailing list