0

我刚从 TopBraid 切换到试用 Protege。

我有一个类似于这样的 RDF 的本体:

instances:some_thing1 a semapi:SomeClass ;
                               semapi:hasChainTo (
                                      [ 
                                            a semapi:SomeOtherClass ;
                                            semapi:hasChainTo (
                                                 [ ... ]
                                                 [ ... ]
                                            )
                                      ] 
                              ) .

这个想法是,这种嵌套的空白节点语法非常有效,因为链变得非常深,并且这种语法是流动的并且具有高度可读性和可维护性,因为链可能会不时更改并且可以添加新链。

不仅如此,我已经为结果图编写了查询。

问题是,如果我将其导入 Protege 然后将其保存回来,结果将重新格式化为:

   instance:some_thing1 rdf:type semapi:SomeClass ,
                               owl:NamedIndividual ;
                               semapi:hasChainTo [ ] .


   [ rdf:type semapi:SomeClass ;
       semapi:hasChainTo [ ]
   ] .

生成的 RDF 完全破坏了查询系统以及使用这种方法表示“链接”的其他好处。

有什么办法可以解决这个问题吗?如果不是,我可能会被迫切换回 TopBraid。

更新:这是问题的再现:

我写了bugTest.ttl然后在 Protege 中打开它并立即 Save As > Turtle > bugTestOutput.ttl

https://dl.dropboxusercontent.com/u/13814624/bugTest.ttl https://dl.dropboxusercontent.com/u/13814624/bugTestOutput.ttl

4

1 回答 1

1

简而言之,您的本体不是有效的 OWL 本体,Protégé 遵循“垃圾进垃圾出”的原则。由于一些坏数据正在进入(尽管 Protégé 确实试图挽救它),所以您会得到坏数据(实际上,只是挽救的数据)。您可以使用Manchester OWL Validator验证本体,但您需要选择 OWL 2 DL 配置文件以获得适当的诊断。在您的文档中,输出为:

本体和/或其导入之一不在 OWL 2 DL 配置文件中

进口关闭

Ontology IRI                                         Physical URI
OntologyID(OntologyIRI(<http://ideation.io/semapi>))

详细报告

IRI 类保留词汇的使用

SubClassOf(semapi:BaseClass rdfs:Class)

使用未声明的类

SubClassOf(semapi:BaseClass rdfs:Class)

除了你有一个三倍的事实:

<http://ideation.io/semapi>
      a       owl:Ontology .

在第一个文件中,这似乎根本不是 OWL 本体。例如,

semapi:BaseClass a rdfs:Class; 
                 rdfs:subClassOf rdfs:Class .

正在定义一些可以在 RDFS 词汇表中使用的类,但它没有声明任何owl:Classes。当你做类似的事情时

semapi:hasChainTo a owl:ObjectProperty; 
                  rdfs:domain semapi:BaseClass;
                  rdfs:range  semapi:BaseClass .

你有一个owl:ObjectPropertythat 将关联semapi:BaseClasses,其中每个也是一个rdfs:Class,所以你有一个将关联rdfs:Classes 的对象属性,但在 OWL DL 中,对象属性只能关联个人。您开始使用 RDF 列表的位置,即:

instances:Instance1 a semapi:DerivedClass;
                        semapi:hasChainTo (
                            [
                                a semapi:DerivedClass;
                                semapi:hasChainTo (
...

您使用 RDF 列表作为对象属性断言中的对象。然而,RDF 列表不能用于 OWL DL,因为它们也用于 OWL 的 RDF 序列化。那么,Protégé 似乎正在丢弃一堆对它没有意义的信息,因为它是 OWL 本体的 RDF 序列化。有人可能会争辩说,当 Protégé 不知道如何处理一些进入的 RDF 时,它应该保留它,但当 RDF 只是序列化事物的一种可能的序列化(OWL 本体)时,这确实是一个站不住脚的立场Protégé 所关心的。

Pellet 的lint工具会产生许多警告:

[Untyped classes]
- http://ideation.io/semapi#DerivedClass
- http://ideation.io/semapi#BaseClass
- http://www.w3.org/2000/01/rdf-schema#Class

[Untyped individuals]
- 6 BNode(s)

[Using rdfs:Class instead of owl:Class]
- http://ideation.io/semapi#DerivedClass
- http://ideation.io/semapi#BaseClass



=========================================================
OWL 2 DL violations found for ontology <http://ideation.io/semapi>:
Use of undeclared class: <http://ideation.io/semapi#BaseClass> [ObjectPropertyRange(<http://ideation.io/semapi#hasChainTo> <http://ideation.io/semapi#BaseClass>) in <http://ideation.io/semapi>]
Use of undeclared class: <http://ideation.io/semapi#DerivedClass> [ClassAssertion(<http://ideation.io/semapi#DerivedClass> _:genid5) in <http://ideation.io/semapi>]
Use of undeclared class: rdfs:Class [SubClassOf(<http://ideation.io/semapi#BaseClass> rdfs:Class) in <http://ideation.io/semapi>]
Use of undeclared class: <http://ideation.io/semapi#DerivedClass> [ClassAssertion(<http://ideation.io/semapi#DerivedClass> _:genid11) in <http://ideation.io/semapi>]
Use of undeclared class: <http://ideation.io/semapi#BaseClass> [SubClassOf(<http://ideation.io/semapi#DerivedClass> <http://ideation.io/semapi#BaseClass>) in <http://ideation.io/semapi>]
Use of undeclared class: <http://ideation.io/semapi#DerivedClass> [ClassAssertion(<http://ideation.io/semapi#DerivedClass> _:genid9) in <http://ideation.io/semapi>]
Use of undeclared class: <http://ideation.io/semapi#BaseClass> [SubClassOf(<http://ideation.io/semapi#BaseClass> rdfs:Class) in <http://ideation.io/semapi>]
Use of undeclared class: <http://ideation.io/semapi#DerivedClass> [ClassAssertion(<http://ideation.io/semapi#DerivedClass> _:genid1) in <http://ideation.io/semapi>]
Use of undeclared class: <http://ideation.io/semapi#BaseClass> [ObjectPropertyDomain(<http://ideation.io/semapi#hasChainTo> <http://ideation.io/semapi#BaseClass>) in <http://ideation.io/semapi>]
Use of undeclared class: <http://ideation.io/semapi#DerivedClass> [ClassAssertion(<http://ideation.io/semapi#DerivedClass> _:genid7) in <http://ideation.io/semapi>]
Use of reserved vocabulary for class IRI: rdfs:Class [SubClassOf(<http://ideation.io/semapi#BaseClass> rdfs:Class) in <http://ideation.io/semapi>]
Use of undeclared class: <http://ideation.io/semapi#DerivedClass> [ClassAssertion(<http://ideation.io/semapi#DerivedClass> _:genid3) in <http://ideation.io/semapi>]
Use of undeclared class: <http://ideation.io/semapi#DerivedClass> [SubClassOf(<http://ideation.io/semapi#DerivedClass> <http://ideation.io/semapi#BaseClass>) in <http://ideation.io/semapi>]
Use of undeclared class: <http://ideation.io/semapi#DerivedClass> [ClassAssertion(<http://ideation.io/semapi#DerivedClass> <http://ideation.io/instances#Instance1>) in <http://ideation.io/semapi>]


No OWL lints found for ontology <http://ideation.io/semapi>.

<http://ideation.io/semapi> does not import other ontologies.
于 2013-08-06T16:36:05.777 回答