rdf - 对象属性断言的 Protege 推理
问题描述
我正在尝试使用推理器 Hermit 1.4.3 构建一个简单的本体来检查如何在 protege 中推断类表达式。
本体如下:
有两个类Robot和Head,一个对象属性hasPart和一个类表达式,它表明某物是 Robot 的实例,那么它必须正好有 1 个 Head。
我想过滤掉实例化一个没有或不止一个头的机器人的情况。但是,当我设置 Alice 是一个机器人并且有 2 个头(head1和head2)时,我预计上面的类表达式会出现不一致错误,而推理器似乎忽略了它。任何帮助将不胜感激。
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)
)
解决方案
推荐阅读
- javascript - React Ref 对象在第二次调用后自行重置
- vb.net - 迭代字典,同时修改它的值(但不是它的键)
- ubuntu - Ubuntu 20.04 Dockerfile 得到 E: Unable to locate package yum 错误
- php - 可以从枚举的 HTML INPUT 值创建数字索引的 php 数组,而无需一一分配吗?
- python - 如何从用 Python 调用的外部程序获取输出?
- c# - 为什么限制我的游戏对象移动到相机框架会阻止移动?
- javascript - 努力在 Apps 脚本中修补 JSON 响应
- python-3.x - 从python中的xml文件中提取数据
- javascript - 创建每行的字符串数组
- html - 悬停/鼠标动作在具有边界半径的 SVG 的截止边界上触发