首页 > 解决方案 > 对象属性断言的 Protege 推理

问题描述

我正在尝试使用推理器 Hermit 1.4.3 构建一个简单的本体来检查如何在 protege 中推断类表达式。

本体如下:

有两个类RobotHead,一个对象属性hasPart和一个类表达式,它表明某物是 Robot 的实例,那么它必须正好有 1 个 Head。

我想过滤掉实例化一个没有或不止一个头的机器人的情况。但是,当我设置 Alice 是一个机器人并且有 2 个头(head1head2)时,我预计上面的类表达式会出现不一致错误,而推理器似乎忽略了它。任何帮助将不胜感激。

OWL 功能语法中的代码如下所示:

Prefix(:=<http://test#>)
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#>)


Ontology(<http://test>

Declaration(Class(:Head))
Declaration(Class(:Robot))
Declaration(ObjectProperty(:hasPart))
Declaration(NamedIndividual(:Alice))
Declaration(NamedIndividual(:head1))
Declaration(NamedIndividual(:head2))
############################
#   Object Properties
############################

# Object Property: :hasPart (:hasPart)

ObjectPropertyDomain(:hasPart :Robot)
ObjectPropertyRange(:hasPart :Head)


############################
#   Classes
############################

# Class: :Robot (:Robot)

EquivalentClasses(:Robot ObjectExactCardinality(1 :hasPart :Head))


############################
#   Named Individuals
############################

# Individual: :Alice (:Alice)

ClassAssertion(:Robot :Alice)
ObjectPropertyAssertion(:hasPart :Alice :head1)
ObjectPropertyAssertion(:hasPart :Alice :head2)

# Individual: :head1 (:head1)

ClassAssertion(:Head :head1)

# Individual: :head2 (:head2)

ClassAssertion(:Head :head2)


)

标签: rdfowlprotegereasoningobject-properties

解决方案


推荐阅读