【问题标题】:JessTab in ProtegeProtege 中的 JessTab
【发布时间】:2019-06-09 11:27:41
【问题描述】:

我使用JessProtege,我创建了一个def template Personslots (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


    【解决方案1】:

    无法在程序的单次运行期间更改实例本身。但是您可以将它们保存到一个文件中,编辑该文件,然后重新加载它们。

    【讨论】:

    • hy,谢谢,请您澄清一下,我希望第二个 deftemplate 使用附加插槽(性别)扩展第一个实例并删除第一个并由第二个替换,并保持其关系(对象属性),谢谢
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-06-03
    • 2018-07-13
    • 2015-02-10
    • 1970-01-01
    • 2016-10-16
    • 1970-01-01
    相关资源
    最近更新 更多