在OWL中定义数据属性的基数 [英] Defining cardinality of data property in OWL
问题描述
是否可以在OWL中定义数据属性的基数? 例如,考虑具有数据属性"Age"的类"Person",是否可以声明数据属性"Age"必须具有单个值?
Is it possible to define the cardinality of data property in OWL? For instance considering a class "Person" with the data property "Age", is there a way to declare that the data property "Age" must have a single value?
推荐答案
您将使用对象属性(DL和Manchester语法)使用的公理:
You use the axiom that you would with an object property (DL and Manchester syntaxes):
人员⊑ = 1.hasAge
人 subClassOf 的年龄恰好为 1
Person ⊑ =1.hasAge
Person subClassOf hasAge exactly 1
这是一个带有这样的公理的小本体:
Here's a small ontology with just such axioms:
@prefix : <http://stackoverflow.com/q/24188632/1281433/people-have-exactly-one-age#> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
:Person a owl:Class ;
rdfs:subClassOf [ a owl:Restriction ;
owl:cardinality "1"^^xsd:nonNegativeInteger ;
owl:onProperty :hasAge
] .
<http://stackoverflow.com/q/24188632/1281433/people-have-exactly-one-age>
a owl:Ontology .
:hasAge a owl:DatatypeProperty .
在某些情况下,使用数据类型属性的确切基数限制实际上比使用对象属性更方便,因为推理者(应该能够)识别文字之间的不等式(例如2≠3和"foo"≠ "bar"),而个人可以有多个名字.
Using exact cardinality restrictions with datatype properties is actually a little more convenient with datatype properties than with object properties in some situations, because reasoners (should be able to) recognize inequality among literals (e.g., 2 ≠ 3 and "foo" ≠ "bar") automatically, whereas individuals can have multiples names.
这篇关于在OWL中定义数据属性的基数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!