【发布时间】:2019-06-09 11:27:41
【问题描述】:
我使用Jess 和Protege,我创建了一个def template Person 和slots (name, age and adress),,我创建了另一个def template,其中extends 第一个带有附加插槽(性别),现在我想删除第一个并用新的替换它,我不想丢失实例,我希望第一个的实例被第二个扩展,我该怎么做?
谢谢你
我首先尝试使用函数"replace$"修改def模板的结构,但它不起作用,然后我尝试了函数"modify"但它只是修改了一个槽的值
(deftemplate Person (slot name(type string)) (slot age(type integer)) (slot adress(type string)))
(deftemplate Personne (slot name(type string)) (slot age(type integer)) (slot adress(type string)) (slot sexe (type string) ))
(assert( Person (name "Bryan") (age "25") (adress "New York")))
(assert( Person (name "Omar") (age "35") (adress "Algeria")))
(assert( Person (name "Sara") (age "30") (adress "Moroco")))
当我尝试将函数"replace$" 用于规则时,我没有语法错误,语法是正确的,但是当我做(运行)它不起作用时,没有执行任何规则。
【问题讨论】:
标签: jess