Defining cardinality of data property in OWL

允我心安 提交于 2019-11-28 12:06:19

问题


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?


回答1:


You use the axiom that you would with an object property (DL and Manchester syntaxes):

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 .

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.



来源:https://stackoverflow.com/questions/24188632/defining-cardinality-of-data-property-in-owl

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!