首页 文章

在 Protege 中导出推断的公理

提问于
浏览
2

我正在学习本体和 Protege 工具。我创建了 3 个 A,B 和 C 类的基本本体。

我使用 Equivalence 属性来声明类 A 相当于类 B.类 B 相当于类 C.然后我使用推理器(Pellet)来确定类 A 相当于类 C.

这种传递关系在 Protege 中完美运作。我可以看到黄色,A 类相当于 C 类和 vice-versa。

我想从 Protege 工具导出这个推断的公理。我转到“文件 - >导出推断公理作为本体”并在第一个屏幕上选择所有选项,而不是在第二个屏幕上选择任何选项。最后,我将文件保存为 RDF/XML 语法中的 OWL。

现在,当我打开这个新文件时,我没有看到关于推断公理的任何三元组,i.e。 A 类相当于 C 类。事实上,它与我原来的本体论完全相同。

我不知道我错过了什么。我还尝试通过 Protege 的“活动本体选项卡”将导出的文件导入到我的原始本体中,然后将“文件 - >导出推断的公理作为本体”,但输出文件仍然不包含推断的三元组。当加载到 Protege 和推理器时,推理可以工作,但我希望 Protege 在 OWL 文件中导出这个推理。

可能吗?我花了很多时间在这上面,并在互联网上环顾四周,但没有找到任何解决方案。我错过了一步吗?

顺便说一下,我使用了最新的 Protege 版本 5.2 并且还尝试了版本 4.3 以查看是否存在错误,但结果是一样的。

谢谢

我使用的本体就是这个。


///////////////////////////////////////////////////////////////////////////////////////
//
// Classes
//
///////////////////////////////////////////////////////////////////////////////////////

<!-- http://www.semanticweb.org/sesa388470/ontologies/2017/9/23/untitled-ontology-110#A -->

<owl:Class rdf:about="http://www.semanticweb.org/sesa388470/ontologies/2017/9/23/untitled-ontology-110#A">
    <owl:equivalentClass rdf:resource="http://www.semanticweb.org/sesa388470/ontologies/2017/9/23/untitled-ontology-110#B"/>
</owl:Class>

<!-- http://www.semanticweb.org/sesa388470/ontologies/2017/9/23/untitled-ontology-110#B -->

<owl:Class rdf:about="http://www.semanticweb.org/sesa388470/ontologies/2017/9/23/untitled-ontology-110#B">
    <owl:equivalentClass rdf:resource="http://www.semanticweb.org/sesa388470/ontologies/2017/9/23/untitled-ontology-110#C"/>
</owl:Class>

<!-- http://www.semanticweb.org/sesa388470/ontologies/2017/9/23/untitled-ontology-110#C -->

<owl:Class rdf:about="http://www.semanticweb.org/sesa388470/ontologies/2017/9/23/untitled-ontology-110#C"/>

更新 1:如果我在“文件 - >导出推断的公理作为本体”的最后一步中选择 OWL/XML 作为本体格式,我可以在生成的本体文件中看到以下内容。

<Declaration>
    <Class IRI="#A"/>
</Declaration>
<Declaration>
    <Class IRI="#C"/>
</Declaration>
<Declaration>
    <Class IRI="#B"/>
</Declaration>
<EquivalentClasses>
    <Class IRI="#A"/>
    <Class IRI="#B"/>
    <Class IRI="#C"/>
</EquivalentClasses>

以前我以 RDF/XML 格式导出本体。至少我可以看到 A,B 和 C 是等价的类。也许是 RDF 与 OWL 问题?

**更新 2:**我在 Protege Dev 列表中收到了以下回复。似乎推断的公理不是按照设计保存为 RDF/XML 格式的。

“OWL RDF/XML 语法不支持 n-ary 构造函数,比如等价类,因为所有内容都应该使用三元组表示(因为 RDF)。在你的例子中,推断的公理 EquivalentClasses(A B C)在 RDF [5](参见表 1)中序列化

A owl:equivalentClass B.

B owl:equivalentClass C.

其他格式,如 OWL/XML 或 OWL Functional-style 语法支持 n-ary 公理。这与你观察到的一致。

此外,在相关说明中,请考虑推断的公理生成器不保存由推理器产生的所有推断的公理。例如,如果你的本体有公理 A subClassOf B 和 B subClassOf C 那么推断的公理 A subClassOf C 将不会被保存,因为它跟随其他(推断的)公理 A subClassOf B 和 B subClassOf C.只有 non-redundant 推断的公理(这样做)不遵循其他推断的公理)得救。这是因为可能有太多推断的公理。“

[1] https://www.w3.org/TR/owl2-mapping-to-rdf/#Translation_of_Axioms_without_Annotations

1 回答

  • 1

    我明白你的意思。你希望在导出的本体中看到 A 和 C 之间的等价类公理,对吗?

    我可以重现它。看起来 Protege 编辑器假设它已经是一个断言的公理。至少,当我再次打开本体时,编辑器在类层次结构树中将其呈现为:

    输入本体:

    @prefix : <http://www.semanticweb.org/user/ontologies/2017/9/untitled-ontology-3#> .
    @prefix owl: <http://www.w3.org/2002/07/owl#> .
    @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
    @prefix xml: <http://www.w3.org/XML/1998/namespace> .
    @prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
    @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
    @base <http://www.semanticweb.org/user/ontologies/2017/9/untitled-ontology-3> .
    
    <http://www.semanticweb.org/user/ontologies/2017/9/untitled-ontology-3> rdf:type owl:Ontology .
    
    #################################################################
    #    Classes
    #################################################################
    
    ###  http://www.semanticweb.org/user/ontologies/2017/9/untitled-ontology-3#A
    :A rdf:type owl:Class ;
       owl:equivalentClass :B .
    
    ###  http://www.semanticweb.org/user/ontologies/2017/9/untitled-ontology-3#B
    :B rdf:type owl:Class ;
       owl:equivalentClass :C .
    
    ###  http://www.semanticweb.org/user/ontologies/2017/9/untitled-ontology-3#C
    :C rdf:type owl:Class .
    
    ###  Generated by the OWL API (version 4.2.8.20170104-2310) https://github.com/owlcs/owlapi
    

    在 Protege 中导出推断的公理和 re-opening 之后:

    在此输入图像描述

    它可能是一个错误,也可能是预期的行为。你应该先在 Protege 邮件列表上询问。

相关问题