hi guys

i am new at Jess and i'm having some difficulties with the following matter.

i use JessTab in Protege 3.4.6 for my master-thesis.

i am no programmer, so i defined all the classes, objects and slots in
protege.
--------------------------------------------------------------------------------
my classes are: class: status (objects: ready, underConstruction)
class: process (objects: proc1, proc1.1, proc2, proc2.1)
my slots are: ID (type: STRING)-> here every object has as ID its name
hasSuccessor (type: OBJECT(process) )
hasStatus (type: OBJECT(status) )

also: proc1 (hasSuccessor proc1.1) and (hasStatus ready)
proc2 (hasSuccessor proc2.1) and (hasStatus underConstruction)
--------------------------------------------------------------------------------
now what i want to do is this:

i want to define a rule that only gives me the object(s) with the slot
hasSuccessor and the slot hasStatus:ready. so actually only the proc1 object
as a result.

this is what i've tried:

(defrule SuccessorStatusReady
        ?sta<- (object (is-a Status)
(ID "ready"))
        ?proc<-(object (is-a Process)
(hasSuccessor ?suc)
(hasStatus ?sta))
=>
(printout t "The Process: " (instance-name ?proc) " has Successor: "
(instance-name ?suc) " and Status: ready." crlf)
)

i also tried:

(defrule SuccessorStatusReady2
?proc<-(object (is-a Process)
(hasSuccessor ?suc)
(hasStatus ?sta&: ID "ready"))
=>
(printout t "The Process: " (instance-name ?proc) " has Successor: "
(instance-name ?suc) " and Status: ready." crlf)
)

i also thought maybe i could define a defglobal with the specific value of
the object and then set the defglobal in the hasStatus slot.

can you please help me? thank you!

p.s. before every rule i did mapclass, so jess can recognise the knowledge
from protege.

Reply via email to