[英]owl:functionalProperty & owl:differentFrom
I'd be grateful for some help on what I'd assumed was a very simple scenario; 对于我认为是一个非常简单的场景,我会感激一些帮助。 but being a relative newcomer to OWL and GraphDB I may have made some basic error.
但作为OWL和GraphDB的相对新手,我可能会犯一些基本错误。
I have a very simple Turtle-specified OWL example as follows: 我有一个非常简单的Turtle指定的OWL示例如下:
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix demo: <urn:demo> .
demo:Gender a owl:Class .
demo:Male a demo:Gender .
demo:Female a demo:Gender .
demo:Male owl:differentFrom demo:Female .
demo:Person a owl:Class .
demo:hasGender a owl:ObjectProperty, owl:FunctionalProperty;
rdfs:domain demo:Person;
rdfs:range demo:Gender .
demo:Per1 a demo:Person;
demo:hasGender demo:Male;
demo:hasGender demo:Female .
In essence, I have a class called Gender and assert that there are 2 distinct members Male and Female. 本质上,我有一个名为Gender的类,并声称有2个不同的成员男性和女性。
Then I define another class Person with a functional property hasGender whose range is Gender. 然后我定义另一个具有功能属性hasGender的Person,其范围是Gender。
Finally I assert an instance of Person, and also two separate assertions that it is both Male and Female. 最后,我断言了Person的一个实例,还有两个单独的断言,它们都是男性和女性。
Now as I understand it this is something of a contradiction; 据我了解,这是一个矛盾的事情; I've asserted that the hasGender property is functional so that, for a given Person, there should be only one gender.
我断言hasGender属性是有用的,因此,对于给定的Person,应该只有一个性别。 I've also asserted that Male and Female are different, so when I import this into GraphDB I was expecting it to fail because of this.
我也断言男性和女性是不同的,所以当我将它导入GraphDB时,我期待它因此而失败。
But GraphDB is happy to load both assertions. 但是GraphDB很乐意加载这两个断言。 Have I missed something?
我错过了什么吗?
When creating a repository : 创建存储库时 :
If you try to import your data, GraphDB will have to say: 如果您尝试导入数据,GraphDB将不得不说:
Could not import data; com.ontotext.trree.consistency.ConsistencyException: Consistency check eq_diff1_1 failed: urn:demoMale owl:differentFrom urn:demoMale urn:demoMale owl:sameAs urn:demoMale
Alternatively, unselect the checkbox, import your data and then execute: 或者,取消选中该复选框,导入数据,然后执行:
PREFIX sys: <http://www.ontotext.com/owlim/system#>
INSERT DATA { [] sys:consistencyCheckAgainstRuleset "owl2-rl" }
Another modelling approach is to create Male
and Female
as disjoint subclasses of Person
. 另一种建模方法是将
Male
和Female
创建为Person
不相交的子类。
Unlike owl:FunctionalProperty
, owl:AllDisjointClasses
is covered by OWL 2 QL . 与
owl:FunctionalProperty
不同, owl:AllDisjointClasses
由OWL 2 QL涵盖。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.