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?
Asked
Active
Viewed 2,009 times
1 Answers
4
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.

Joshua Taylor
- 84,998
- 9
- 154
- 353