繁体   English   中英

在 Protege 中导出推断公理

[英]Export inferred axiom in Protege

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

我使用 Equivalence 属性来说明 A 类等效于 B 类。B 类等效于 C 类。然后我使用推理器(Pellet)确定 A 类等效于 C 类。

这种传递关系在 Protege 中完美适用。 我可以在黄色中看到 A 类等同于 C 类,反之亦然。

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

现在,当我打开这个新文件时,我没有看到任何关于推断公理的三元组,即 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 list 上收到了以下回复。 似乎推断出的公理不是按设计以 RDF/XML 格式保存的。

" OWL RDF/XML 语法不支持像等效类这样的 n 元构造函数,因为一切都应该使用三元组表示(因为 RDF)。在您的示例中,推断的公理 EquivalentClasses(ABC) 在 RDF [1] 中序列化(参见表1) 到

A owl:equivalentClass B 。

碗:等价类 C 。

其他格式,如 OWL/XML 或 OWL 函数式语法支持 n 元公理。 这是根据你观察到的。

此外,在相关说明中,请注意推断公理生成器不会保存推理器生成的所有推断公理。 例如,如果你的本体有公理 A subClassOf B 和 B subClassOf C,那么推断的公理 A subClassOf C 将不会被保存,因为它遵循其他(推断的)公理 A subClassOf B 和 B subClassOf C。只有非冗余的推断公理(不遵循其他推断公理的)被保存。 这是因为推断的公理可能太多了。”

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

我明白你的意思。 您希望在导出的本体中看到 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 中重新打开后:

在此处输入图片说明

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

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM