Please post JessTab-related message to the protege-owl or protege-discussion mailing list, as subscribers of the jess-users list don't necessarily know how JessTab maps Protege objects to Jess constructs and details of Protege (OWL) API (which you'd use to create classes and instances.)

The answers to your questions are in the JessTab and Jess manuals.

Basically, given the mapping from Protege to Jess, you'd probably write two rules that looks roughly like the following:

(defrule
(object (is-a Earthquake)(OBJECT ?earthquake)
(magnitude ?m&:(> ?m 6))(in ?country)(affect ?affected&:(not (member$ ?country ?affected)))) => (JessTab or Protege (OWL) API call to add ?country to the "affect" property of the ?earthquake instance)
)

(defrule
(object (is-a Earthquake)(in ?country)(affect ?affected&:(member$ ?country ?affected)) (object (is-a Country)(OBJECT ?country)(has-facility ?dam&:(JessTab function to check that ?dam is an instance of the Dam class) => (JessTab/Protege API call to check existence of Flood class. If not, create the Flood class, then create an instance of Flood and add ?country to the "affect" property of the Flood instance)
)

You can find the appropriate JessTab and Protege (OWL) API calls in their respective manuals. The Jess manual describes the syntax for making Java API calls.

Samson


Hemant Joshi wrote:
I have OWL with few classes and slots. I am new Jess and I would like to add few simple inference rules through JessTab.

Class Hazard has subclass Earthquake which has property magnitude
Class County has object property contains_facility which has Range of type Facility
Class Facility has a sub-class Dam

I want to create simple rule for instances X and Y like
1) If Earthquake.magnitude in county X "*is greater than or equal to*" 6
             If Earhquake *affects *county X and county X *has *Dam Y
Then *create new Hazard sub-class* called Flood (and show it affects county X)
     Else
             Earthquake *affects *county X

How do we write Jess rule to do arithmetic comparison and add class/instances based on that?

-Hemant


--
Samson Tu                    email: [EMAIL PROTECTED]
Senior Research Scientist    web: www.stanford.edu/~swt/
Stanford Medical Informatics phone: 1-650-725-3391
Stanford University          fax: 1-650-725-7944

--------------------------------------------------------------------
To unsubscribe, send the words 'unsubscribe jess-users [EMAIL PROTECTED]'
in the BODY of a message to [EMAIL PROTECTED], NOT to the list
(use your own address!) List problems? Notify [EMAIL PROTECTED]
--------------------------------------------------------------------

Reply via email to