[protege-owl] SWRL parsing incorrectly

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[protege-owl] SWRL parsing incorrectly

Vei-Chung Liang
I am trying to the following SWRL rule

hasBrother(?x1, ?x2)  ?  hasAge(?x1, ?age1)  ?  hasAge(?x2, ?age2)  ?
swrlb:greaterThan(?age2, ?age1)  ?  hasOlderBrother(?x1, ?x2)

But by examing the Jess Rule, the result is not quite right:

(defrule Rule-2 (hasBrother ?x1 ?x2) (hasAge ?x1 ?age1) (hasAge ?x2 ?age2)
(swrlb:greaterThan (?age2 ?age1)  => (assert (hasOlderBrother ?x1 ?x2)) )

The SWRL build-in is translated into (swrlb:greaterThan (?age2 ?age1), which
seems to be incorrect translation.

Moreover, if I really want to make this thing work in Jess,
my hand-written rule is:

(defrule Rule-2 (hasBrother (b1 ?x1) (b2 ?x2))
        (hasAge (name ?x1) (age ?age1))
                (hasAge (name ?x2) (age ?age2&:(< ?age2 ?age1)))
               
        => (assert (hasOlderBrother (younger ?x1) (older ?x2) ))
            (printout t ?x1 " " hasOlderBrother " " ?x2 crlf))


Any thoughts?

Thanks,

VC,

-------------------------------------------------------------------------
To unsubscribe go to http://protege.stanford.edu/community/subscribe.html

Reply | Threaded
Open this post in threaded view
|

[protege-owl] Re: SWRL parsing incorrectly

Martin O'Connor

As I mentioned in a response a few days ago, built-ins are not working
properly in the current build (322). I have fixed the problem and the fixes
will be available in the next build, or you can download the latest code
from the Protégé-OWL and SWRL-Jess-Bridge Subversion repositories.

Martin

-----Original Message-----
From: [hidden email]
[mailto:[hidden email]] On Behalf Of Vei-Chung Liang
Sent: Thursday, June 22, 2006 12:05 PM
To: [hidden email]
Subject: [protege-owl] SWRL parsing incorrectly

I am trying to the following SWRL rule

hasBrother(?x1, ?x2)  ?  hasAge(?x1, ?age1)  ?  hasAge(?x2, ?age2)  ?
swrlb:greaterThan(?age2, ?age1)  ?  hasOlderBrother(?x1, ?x2)

But by examing the Jess Rule, the result is not quite right:

(defrule Rule-2 (hasBrother ?x1 ?x2) (hasAge ?x1 ?age1) (hasAge ?x2 ?age2)
(swrlb:greaterThan (?age2 ?age1)  => (assert (hasOlderBrother ?x1 ?x2)) )

The SWRL build-in is translated into (swrlb:greaterThan (?age2 ?age1), which
seems to be incorrect translation.

Moreover, if I really want to make this thing work in Jess,
my hand-written rule is:

(defrule Rule-2 (hasBrother (b1 ?x1) (b2 ?x2))
        (hasAge (name ?x1) (age ?age1))
                (hasAge (name ?x2) (age ?age2&:(< ?age2 ?age1)))
               
        => (assert (hasOlderBrother (younger ?x1) (older ?x2) ))
            (printout t ?x1 " " hasOlderBrother " " ?x2 crlf))


Any thoughts?

Thanks,

VC,

-------------------------------------------------------------------------
To unsubscribe go to http://protege.stanford.edu/community/subscribe.html

-------------------------------------------------------------------------
To unsubscribe go to http://protege.stanford.edu/community/subscribe.html