OWL how to force all the instances of a specific c

2019-05-24 07:40发布

I am building an Ontology.

I have a Class called Vehicle

I have an Object Property called hasType

I have a Class called VehicleTypes

How can I force all the instances from Vehicle class to have one and just one instance of VehicleTypes

What I have tried

I am working on Protege.

  1. I made the hasType as a functional property.

  2. I added an Equivalent To which is like this: hasType exactly 1 VehicleTypes

Is that enough please?

3条回答
对你真心纯属浪费
2楼-- · 2019-05-24 08:09

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.

查看更多
该账号已被封号
3楼-- · 2019-05-24 08:19

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.
查看更多
老娘就宠你
4楼-- · 2019-05-24 08:20

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).

查看更多
登录 后发表回答