|
hi everybody, dear todd:
i like the relational approach but:
how do you assign unique values for the slot 'self'
?
is there any mechanism supported directly by jess (factid
?)
or do you have some class that
calculates the unique ids ?
this seems important to me e.g. when
asserting facts
dynamically during inference
process.
thanks
peter
..........
..........
/color>/fontfamily> Anyhow,
it helps to think like a relational database designer. Using objects, your
template might look something like: /fontfamily>/x-tabstops>/x-para-attrib>
(deftemplate
Person (field self) (field name) (field organization)) ; relates to
an Organization
(deftemplate Organization (field self) (field
name) (field location))
/fontfamily>/x-tabstops>/x-para-attrib>You
then write rules that look like relational database queries. For instance,
to get a Person's Organization you might do something like.... /fontfamily>/x-tabstops>/x-para-attrib> (defrule
person-organization (Person (organization ?org) ....) (Organization
(self ?org) .....) => ...)
It sounds like JESS has a way to
store a Java object reference in a field, which does roughly the same thing
as the self field I put into every object.
Hope this helps. /color>/fontfamily>/x-tabstops>/x-para-attrib> /color>^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
eTranslate, Inc. The Power of Language Todd Blanchard main
+1.415.970.7119 Chief Technology Architect fax
+1.415.371.0008 http://www.etranslate.com/ 500 Treat Street, Suite 100,
San Francisco, California 94110, U.S.A.
/fontfamily>/x-tabstops>/x-para-attrib>
|