OWL how to force all the instances of a specific class to have a specific relationship

不问归期 提交于 2019-12-06 08:55:26

Making hasType functional is the right move since every Vehicle can only have one VehicleType. However, you need to describe Vehicle hasType exactly 1 VehicleType as a subClassOf relation rather than equivalentTo relation.

Definition of subclass relation:

if the class description C1 is defined as a subclass of class description C2, then the set of individuals in the class extension of C1 should be a subset of the set of individuals in the class extension of C2.

Definition of equivalent relation:

links a class description to another class description. The meaning of such a class axiom is that the two class descriptions involved have the same class extension (i.e., both class extensions contain exactly the same set of individuals).

The following axiom is sufficient to guarantee that all the instances from the Vehicle class have one and just one instance of VehicleTypes (in Manchester syntax):

Class: Vehicle
    SubClassOf: hasType exactly 1 VehicleType

This, in fact, is the minimal ontology that guarantees it. If you do not need to be minimal, you can also enforce it with the following:

ObjectProperty: hasType
    Characteristics: Functional
Class: Vehicle
    SubClassOf: hasType some VehicleType

This can be useful if you use a reasoner that does not support cardinality restrictions, for instance.

Don't create your own vehicleType property and VehicleType class, just use rdf:Type and rdfs:subClassOf:

:Car rdfs:subClassOf  :Vehicle.
:Boat rdfs:subClassOf :Vehicle.

Then if you want to say that certain classes are disjunctive, use:

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