Hi,
Now I got another problem in writing conditiosn in rules of JessTab.
Assuming that we have these two triples : < Customer_Inst hasID Customer_Inst> and <CustomerID_Inst isMemberOf Queue_Inst>, which Customer_Inst, CustomerID_Inst and Queue_Inst all are individuals.
Now, given the Customer instance, I want to check whether the CustomerID_Inst (of Customer_Inst) isMemberOf ( has "isMemberOf" relation with ) Queue_Inst .
I don't know how I can write the second condition (specifying the relation between CustomerID and Queue). I have written the following rule, but I doesn't work, it will not fired.
(defrule MAIN::Rule-2
(object (is-a Customer) (is-a-name "Customer") (OBJECT ?objCustomer) (:NAME "Customer_Inst")
(hasCurrentState ?state&:(eq (isState ?state "Customer_Waiting") true))
(hasCustomerID ?objCustomerID &:(eq (isState ?state "CustomerID_Inst") true) )
)
(object (is-a CustomerID) (is-a-name "CustomerID") (OBJECT ?objCustomerID) (:NAME "CustomerID_Inst")
(isMemberOfQueue ?objQueue&:(eq (isState ?objQueue "Queue_Inst") true) )
)
=> .....
Does anyone have any idea?
regards,
Shahav
protege-owl-request at lists.stanford.edu wrote: Send protege-owl mailing list submissions to
protege-owl at lists.stanford.edu
To subscribe or unsubscribe via the World Wide Web, visit
https://mailman.stanford.edu/mailman/listinfo/protege-owl
or, via email, send a message with subject or body 'help' to
protege-owl-request at lists.stanford.edu
You can reach the person managing the list at
protege-owl-owner at lists.stanford.edu
When replying, please edit your Subject line so it is more specific
than "Re: Contents of protege-owl digest..."
Today's Topics:
1. How to define a rule in JessTab detecting and changing
relation between two instances? (shahab)
2. OWL restrictions (Priscilla Moraes)
3. Re: How to define a rule in JessTab detecting and changing
relation between two instances? (Jane Eisenstein)
4. Re: How to define a rule in JessTab detecting and changing
relation between two instances? (Martin O'Connor)
5. Re: OWL restrictions (Martin O'Connor)
6. Re: OWL restrictions (Priscilla Moraes)
7. Re: How to define a rule in JessTab detecting and changing
relation between two instances? (Samson Tu)
----------------------------------------------------------------------
Message: 1
Date: Tue, 24 Apr 2007 08:51:16 -0700 (PDT)
From: shahab
Subject: [protege-owl] How to define a rule in JessTab detecting and
changing relation between two instances?
To: protege-owl at lists.stanford.edu
Message-ID: <12431.39764.qm at web32910.mail.mud.yahoo.com>
Content-Type: text/plain; charset="iso-8859-1"
Hi everyone,
I do appreciate your help.
I am using JessTab to run rules,I have written a rule to change the value(string) of an instance :
(defrule Rule-1 ?obj1 <-(object (is-a Customer) (is-a-name "Customer") (:NAME "Customer_Inst") (hasState "Ready" )) => (slot-set ?obj1 hasState "waiting"))
But now I want to introduce (Ready, Waiting) as intsances of class "State".I have done it and now I have two instances Ready and Waiting . Also I have defined "hasState" as a slot of type of State.
But now I wonder how can I write similar rule (as above) to change the relation between Customer and Ready to a relation between Customer and Waiting?
---------------------------------
Ahhh...imagining that irresistible "new car" smell?
Check outnew cars at Yahoo! Autos.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.stanford.edu/pipermail/protege-owl/attachments/20070424/a39157ed/attachment.html
------------------------------
Message: 2
Date: Tue, 24 Apr 2007 14:55:54 -0300
From: "Priscilla Moraes"
Subject: [protege-owl] OWL restrictions
To: "Protege List"
Message-ID: <005c01c78699$d03d6030$ad5080c8 at Priscilla>
Content-Type: text/plain; charset="iso-8859-1"
Hello everybody!
I would like to know if there is some way that I can to export the Owl restrictions to Jess. In my ontology I can't.
Thanks!
Priscilla.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.stanford.edu/pipermail/protege-owl/attachments/20070424/b89bab5d/attachment.htm
------------------------------
Message: 3
Date: Tue, 24 Apr 2007 14:54:36 -0400
From: Jane Eisenstein
Subject: Re: [protege-owl] How to define a rule in JessTab detecting
and changing relation between two instances?
To: User support for the Protege-OWL editor
Message-ID: <564220DB-F4EA-401D-9D4D-CE3333491C30 at softweave.com>
Content-Type: text/plain; charset="us-ascii"
I am a newbie, but it is my understanding that SWRL can only assign a
value to a property that is not yet valued. Allowing properties to be
changed might invalidate previous inferences.
Does your rule perhaps add a second hasState property to the Customer
rather than changing the existing value?
Jane Eisenstein
On Apr 24, 2007, at 11:51 AM, shahab wrote:
> Hi everyone,
> I do appreciate your help.
> I am using JessTab to run rules,I have written a rule to change the
> value(string) of an instance :
> (defrule Rule-1 ?obj1 <-(object (is-a Customer) (is-a-name
> "Customer") (:NAME "Customer_Inst") (hasState "Ready" )) => (slot-
> set ?obj1 hasState "waiting"))
>> But now I want to introduce (Ready, Waiting) as intsances of class
> "State".I have done it and now I have two instances Ready and
> Waiting . Also I have defined "hasState" as a slot of type of State.
> But now I wonder how can I write similar rule (as above) to change
> the relation between Customer and Ready to a relation between
> Customer and Waiting?
>>>>> Ahhh...imagining that irresistible "new car" smell?
> Check out new cars at Yahoo! Autos.
> _______________________________________________
> 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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.stanford.edu/pipermail/protege-owl/attachments/20070424/1cab0304/attachment.html
------------------------------
Message: 4
Date: Tue, 24 Apr 2007 11:37:51 -0800
From: "Martin O'Connor"
Subject: Re: [protege-owl] How to define a rule in JessTab detecting
and changing relation between two instances?
To: jane at janeeisenstein.com, User support for the Protege-OWL editor
Message-ID: <462E5C8F.4020007 at stanford.edu>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
You are right - in SWRL this would not be valid. However, I think he is
using the JessTab (not the SWRLJessTab), which is not as formally
constrained (or as safe) as SWRL.
Martin
Jane Eisenstein wrote:
> I am a newbie, but it is my understanding that SWRL can only assign a
> value to a property that is not yet valued. Allowing properties to be
> changed might invalidate previous inferences.
>> Does your rule perhaps add a second hasState property to the Customer
> rather than changing the existing value?
>> Jane Eisenstein
>> On Apr 24, 2007, at 11:51 AM, shahab wrote:
>>> Hi everyone,
>> I do appreciate your help.
>> I am using JessTab to run rules,I have written a rule to change the
>> value(string) of an instance :
>> (defrule Rule-1 ?obj1 <-(object (is-a Customer) (is-a-name
>> "Customer") (:NAME "Customer_Inst") (hasState "Ready" )) => (slot-set
>> ?obj1 hasState "waiting"))
>>>> But now I want to introduce (Ready, Waiting) as intsances of class
>> "State".I have done it and now I have two instances Ready and Waiting
>> . Also I have defined "hasState" as a slot of type of State.
>> But now I wonder how can I write similar rule (as above) to change
>> the relation between Customer and Ready to a relation between
>> Customer and Waiting?
>>>>>>>>>> ------------------------------------------------------------------------
>> Ahhh...imagining that irresistible "new car" smell?
>> Check out new cars at Yahoo! Autos.
>>>>>> _______________________________________________
>> 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>>
------------------------------
Message: 5
Date: Tue, 24 Apr 2007 11:41:25 -0800
From: "Martin O'Connor"
Subject: Re: [protege-owl] OWL restrictions
To: User support for the Protege-OWL editor
Message-ID: <462E5D65.6000305 at stanford.edu>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Are you referring to the JessTab or the SWRLJessTab subcomponent of the
SWRLTab? The SWRLTab does not support most OWL restrictions at the
moment:
http://protege.cim3.net/cgi-bin/wiki.pl?SWRLRuleEngineBridgeFAQ#nid6QL
Martin
Priscilla Moraes wrote:
> Hello everybody!
>> I would like to know if there is some way that I can to export the Owl
> restrictions to Jess. In my ontology I can't.
> Thanks!
> Priscilla.
>>------------------------------------------------------------------------
>>_______________________________________________
>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>>
------------------------------
Message: 6
Date: Tue, 24 Apr 2007 17:03:47 -0300
From: "Priscilla Moraes"
Subject: Re: [protege-owl] OWL restrictions
To: "Protege List"
Message-ID: <008c01c786ab$add81e60$ad5080c8 at Priscilla>
Content-Type: text/plain; format=flowed; charset="utf-8";
reply-type=original
Hi Martin!
I'm using the SWRLJessTab in the Prot?g? 3.3 beta (where shows the subtab
"Restrictions" but don't works).
How can I to write the restrictions in the Jess directly? Are they must be
rules? Do you have any example?
Because I wrote the rules only, example:
OneWayDelay(?x) ? OneWayTool(?y) ? VoIP(?z) ? isMeasuredBy(?x, ?y) ?
requires(?z, ?x) ? needs(?z, ?y)
In this case, the property isMeasuredBy has restrictions. Some values to x
only can be acceptable to other some values ?y. Where can I say this?
Thank you so much!
Priscilla.
----- Original Message -----
From: "Martin O'Connor"
To: "User support for the Protege-OWL editor"
Sent: Tuesday, April 24, 2007 4:41 PM
Subject: Re: [protege-owl] OWL restrictions
>> Are you referring to the JessTab or the SWRLJessTab subcomponent of the
> SWRLTab? The SWRLTab does not support most OWL restrictions at the
> moment:
>http://protege.cim3.net/cgi-bin/wiki.pl?SWRLRuleEngineBridgeFAQ#nid6QL>> Martin
>> Priscilla Moraes wrote:
>>> Hello everybody!
>>>> I would like to know if there is some way that I can to export the Owl
>> restrictions to Jess. In my ontology I can't.
>> Thanks!
>> Priscilla.
>>>>------------------------------------------------------------------------
>>>>_______________________________________________
>>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
------------------------------
Message: 7
Date: Tue, 24 Apr 2007 13:18:28 -0700
From: Samson Tu
Subject: Re: [protege-owl] How to define a rule in JessTab detecting
and changing relation between two instances?
To: protege-owl at lists.stanford.edu
Message-ID:
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
shahab wrote:
> Hi everyone,
> I do appreciate your help.
> I am using JessTab to run rules,I have written a rule to change the
> value(string) of an instance :
> (defrule Rule-1 ?obj1 <-(object (is-a Customer) (is-a-name "Customer")
> (:NAME "Customer_Inst") (hasState "Ready" )) => (slot-set ?obj1 hasState
> "waiting"))
>> But now I want to introduce (Ready, Waiting) as intsances of class
> "State".I have done it and now I have two instances Ready and Waiting .
> Also I have defined "hasState" as a slot of type of State.
> But now I wonder how can I write similar rule (as above) to change the
> relation between Customer and Ready to a relation between Customer and
> Waiting?
>
?obj1 <- (object ...) gives you a binding to a fact, not the object. You
need to match (OBJECT ?obj1) as part of the pattern.
Assuming that you have a Jess function (isState ?state ?stateName) that
determines whether an individual ?state is a state with ?stateName
(e.g., "Ready"), and a function (getState ?stateName) that returns a
state individual with name ?stateName, you can write your rule as
(defrule Rule-1
(object (is-a Customer) (is-a-name "Customer")
(:NAME "Customer_Inst") (OBJECT ?obj1)
(hasState ?state&:(isState ?state "Ready")))
=> (slot-set ?obj1 hasState (getState "Waiting")))
Samson
--
Samson Tu email: swt at stanford.edu
Senior Research Scientist web: www.stanford.edu/~swt/
Stanford Medical Informatics phone: 1-650-725-3391
Stanford University fax: 1-650-725-7944
------------------------------
_______________________________________________
protege-owl mailing list
protege-owl at lists.stanford.eduhttps://mailman.stanford.edu/mailman/listinfo/protege-owl
End of protege-owl Digest, Vol 9, Issue 48
******************************************
---------------------------------
Ahhh...imagining that irresistible "new car" smell?
Check outnew cars at Yahoo! Autos.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.stanford.edu/pipermail/protege-owl/attachments/20070429/e338dcae/attachment.html>