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] [POSSIBLE VIRUS:###] Re: problem with SWRLRuleEngineBridge

Hrishikesh Sharma hrishikesh.sharma at gmail.com
Thu Aug 9 08:42:14 PDT 2007


Attached here is the cleaned-up printing code extracted from my overall
application. The class containing main() method is the BridgeWrapper class.
MyBridge extends SWRLJessBridge class. The ontology used in my work and a
corresponding repository file(needs to be edited) are also there.
The output is still wrong, and same as I quoted in yesterday's mail. If
getAssertedProperties() is well-tested indeed, then the bug has to be in my
code, help me catch it :-)

Regards
        Hrishikesh.


On 8/9/07, Martin O'Connor <martin.oconnor at stanford.edu> wrote:
>
> The getAssertedProperties call work fine for me with your ontology.
> Lots of code depends on the getAssertedProperties call (including the
> SWRLJessTab displays) so I would rewrite your printing code (which is
> very confusing).
>
> Martin
>
> (and Quoting Hrishikesh Sharma <hrishikesh.sharma at gmail.com >:
>
> > There seems to be a serious bug?? with with getAssertedProperties(). I
> > was suggested(see the mail chain below) to extend SWRLJessBridge class
> > to do what I required.
> > I am using the attached ontology and sample instances to run some rules.
>
> > When I use the Protege editor(front-end) and use JessTab and execute
> > JESS rule engine, I can see all the asserted properties, right ones,
> > in the appropriate pane as follows.
> >
> > (assert (needsBatAlarm Lenovo "true"))
> > (assert (needsCharging Lenovo "true"))
> > (assert (possCharging Lenovo "true"))
> >
> > While when I use SWRLJessBridge and enumerate all the asserted
> > properties, I get garbled output.
> >
> > Lenovo
> > true
> > Lenovo
> > true
> > Didier_Bourse
> > true
> > Lenovo
> > true
> >
> > The subclass that I implemented on your suggestion is also attached. I
> > am almost sure it is a bug with the bridge code. I desperately need to
> > have/demonstrate a standalone application in Java which uses
> > SWRLJessBridge. Please help.
> >
> > Regards
> >          Hrishikesh.
> >
> > On 7/25/07, Martin O'Connor < martin.oconnor at stanford.edu> wrote:
> >>
> >>
> >> The bridge is documented extensively here:
> >> http://protege.cim3.net/cgi-bin/wiki.pl?SWRLRuleEngineBridgeFAQ
> >>
> >> You can access protected methods using the standard Java subclassing
> >> technique, viz:
> >>
> >>
> >>
> >> public class MyBridge extends JessRuleEngineBridge
> >>
> >> {
> >>
> >>    .
> >>
> >>    public Set<RuleInfo> myGetImportedSWRLRules() { return
> >> getImportedSWRLRules(); }
> >>
> >>
> >>
> >> etc.
> >>
> >>
> >>
> >> Martin
> >>
> >>
> >>
> >>   _____
> >>
> >> From: protege-owl-bounces at lists.stanford.edu
> >> [mailto:protege-owl-bounces at lists.stanford.edu] On Behalf Of Hrishikesh
> >> Sharma
> >> Sent: Wednesday, July 25, 2007 7:21 AM
> >> To: protege-owl at lists.stanford.edu
> >> Subject: Re: [protege-owl] problem with SWRLRuleEngineBridge
> >>
> >>
> >> Essentially my problem is (at least) twofold:
> >> 1. The javadocs for SWRLRuleEngineBridge and SWRLJessBridge give too
> less
> >> information. Various methods I try to invoke based on some approximate
> >> understanding misfire!
> >> 2. How to get hold of the delta between new overall knowledge after a
> Jess
> >> run, and the old knowledge in Java code. In the front end, I am able to
> do
> >> same by examining the "Asserted Properties/Individuals" sub-tab within
> Jess
> >> Tab.
> >>
> >>
> >> Sincerely,
> >>
> >>         Hrishikesh.
> >>
> >>
> >> On 7/24/07, Martin O'Connor <martin.oconnor at stanford.edu> wrote:
> >>
> >>
> >> You are trying to call a protected method in this code fragment.
> >> Invoking through the SWRLJessBridge does not make it unprotected - only
> >> code inside the SWRLJessBridge can access it.
> >>
> >> Martin
> >>
> >> Hrishikesh Sharma wrote:
> >>
> >> > Hi,
> >> >     I am having problem with getAssertedProperties() method of
> >> > SWRLRuleEngineBridge Class. From the javadoc, I gather it is a
> >> > protected method. However, in the simple java code file attached,
> >> > where I invoke this method from a subclass called SWRLJessBridge, I
> >> > get a compilation error
> >> >
> >> > RunSwrlOnOnt.java:30: getAssertedProperties() has protected access in
> >> > edu.stanford.smi.protegex.owl.swrl.bridge.SWRLRuleEngineBridge
> >> >          Collection ass_p = bridge.getAssertedProperties ();
> >> >                                   ^
> >> > It is a bit surprising, for SWRLJessBridge is supposed to be subclass
> >> > and hence have access to protected methods of the superclass from
> >> > within objects of that type. Am I missing something trivial here? Or
> >> > is it a bug(missing 'extends' definition for SWRLJessBridge)? Or is
> >> > the method getAssertedProperties() an abstract method?
> >> >
> >> > Sincerely,
> >> >        Hrishikesh
> >
>
>
> _______________________________________________
> 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
>



-- 
- + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - +  - + - + - +
- + - + - + - + - + - +- + - + - +

Literature is my legal wife and medicine my mistress. When I get tired of
one, I spend the night with the other.

Anton Chekhov in a letter to Alexey Suvorin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.stanford.edu/pipermail/protege-owl/attachments/20070809/baa2bd94/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: exp.zip
Type: application/zip
Size: 7277 bytes
Desc: not available
URL: <http://mailman.stanford.edu/pipermail/protege-owl/attachments/20070809/baa2bd94/attachment.zip>


More information about the protege-owl mailing list