【问题标题】:OWL how to force all the instances of a specific class to have a specific relationshipOWL如何强制特定类的所有实例具有特定关系
【发布时间】:2015-04-05 21:19:34
【问题描述】:

我正在构建一个本体。

我有一个名为Vehicle

我有一个名为hasType对象属性

我有一个名为VehicleTypes

如何强制Vehicle 类中的所有实例具有一个且只有一个 VehicleTypes 实例

我尝试过的

我正在为 Protege 工作。

  1. 我将hasType 作为函数属性。

  2. 我添加了一个Equivalent To,它是这样的:hasType正好是1 VehicleTypes

请问够了吗?

【问题讨论】:

标签: semantic-web owl ontology protege


【解决方案1】:

使hasType 起作用是正确的举措,因为每个Vehicle 只能有一个VehicleType。但是,您需要将Vehicle hasType exactly 1 VehicleType 描述为subClassOf 关系而不是equivalentTo 关系。

子类关系的定义:

如果类描述 C1 被定义为类描述 C2 的子类,那么 C1 的类扩展中的个体集应该是 C2 的类扩展中的个体集的子集。

等价关系的定义:

将一个类描述链接到另一个类描述。这样一个类公理的含义是,所涉及的两个类描述具有相同的类扩展(即,两个类扩展都包含完全相同的一组个体)。

【讨论】:

  • 更清楚地说,如果您在VehiclehasType exactly 1 VehicleType 之间使用equivalent To 关系,那么任何只有一个VehicleType 作为属性的实例都是Vehicle 的实例。
【解决方案2】:

以下公理足以保证Vehicle 类中的所有实例都只有一个VehicleTypes 实例(曼彻斯特语法):

Class: Vehicle
    SubClassOf: hasType exactly 1 VehicleType

事实上,这是保证它的最小本体。如果不需要最小化,也可以通过以下方式强制执行:

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

例如,如果您使用不支持基数限制的推理器,这将很有用。

【讨论】:

    【解决方案3】:

    不要创建自己的 vehicleType 属性和 VehicleType 类,只需使用 rdf:Typerdfs:subClassOf

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

    如果你想说某些类是析取的,使用:

    :Car owl:disjointWith :Boat.
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2019-06-12
      • 1970-01-01
      • 2011-01-10
      • 2016-09-02
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-10-18
      相关资源
      最近更新 更多