【问题标题】:How to represent maps in OWL?如何在 OWL 中表示地图?
【发布时间】:2021-10-03 12:40:01
【问题描述】:

这是我的本体的简化摘录:

    <owl:Class rdf:ID="Role" />
    <owl:Class rdf:ID="Location" />
    <owl:Class rdf:ID="SalaryRange">
      <rdfs:subClassOf rdf:resource="#HasLocation" />
    </owl:Class>
    <owl:Class rdf:ID="HasLocation" />
    <owl:ObjectProperty rdf:ID="location">
        <rdfs:domain rdf:resource="#HasLocation" />
        <rdfs:range rdf:resource="#Location" />
    </owl:ObjectProperty>
    <owl:DataProperty rdf:ID="salaryRangeOfRole">
        <rdfs:domain rdf:resource="#Role" />
        <rdfs:range rdf:resource="#SalaryRange" />
    </owl:DataProperty>

我现在如何确保SalaryRanges 中的Locations 对于Role 来说是唯一的?

我已经阅读了有关FunctionalPropertys 的信息,但不知道在这种情况下如何使用它。

【问题讨论】:

  • 我认为您必须定义通过类表达式建模的“本地功能”。你能举一个实例数据的例子吗?我现在不明白你的课程是如何“连接”的。一个角色有一个带位置的薪水范围?

标签: owl


【解决方案1】:

您在这里面临的挑战是,您基本上需要对RoleLocationSalaryRange 设置一个唯一约束。功能属性实际上是为单个属性定义的 - 除非您通过类表达式对某些功能属性进行建模。

实现此目的的一种简单方法(如果您使用的是 OWL)是通过键约束。我努力理解你的例子。因此,我进一步简化了您的示例,假设您有一个 SalaryRange ,其中 RoleLocation 需要是唯一的。我认为,如果您了解总体思路,您将能够对其进行修改以完全适合您的示例。

我们有您定义的 LocationRole 类。

<owl:Class rdf:about="Location"/>
<owl:Class rdf:about="Role"/>

然后我定义了对象属性rolelocation如下:

<owl:ObjectProperty rdf:about="location">
    <rdfs:domain rdf:resource="SalaryRange"/>
    <rdfs:range rdf:resource="Location"/>
</owl:ObjectProperty>
<owl:ObjectProperty rdf:about="role">
    <rdfs:domain rdf:resource="SalaryRange"/>
    <rdfs:range rdf:resource="Role"/>
</owl:ObjectProperty>

然后为确保SalaryRange 将具有唯一的角色和位置,您可以按如下方式强制执行:

<owl:Class rdf:about="SalaryRange">
    <owl:hasKey rdf:parseType="Collection">
        <rdf:Description rdf:about="location"/>
        <rdf:Description rdf:about="role"/>
    </owl:hasKey>
</owl:Class>

您可以与以下人员进行测试:

<owl:NamedIndividual rdf:about="location1">
    <owl:sameAs rdf:resource="location2"/>
</owl:NamedIndividual>

<owl:NamedIndividual rdf:about="location2"/>

<owl:NamedIndividual rdf:about="role1">
    <owl:sameAs rdf:resource="role2"/>
</owl:NamedIndividual>

<owl:NamedIndividual rdf:about="role2"/>

<owl:NamedIndividual rdf:about="salaryRange1">
    <location rdf:resource="location1"/>
    <role rdf:resource="role1"/>
</owl:NamedIndividual>

<owl:NamedIndividual rdf:about="salaryRange2">
    <location rdf:resource="location2"/>
    <role rdf:resource="role2"/>
</owl:NamedIndividual>

对于这些人,像 Hermit 这样的推理者会推断出 salaryRange1salaryRange2 是同一个人。但是,如果您声明 salaryRange1salaryRange2不同个人,则会出现不一致。

<rdf:Description>
    <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#AllDifferent"/>
    <owl:distinctMembers rdf:parseType="Collection">
        <rdf:Description rdf:about="salaryRange1"/>
        <rdf:Description rdf:about="salaryRange2"/>
    </owl:distinctMembers>
</rdf:Description>

要解决不一致的问题,您可以声明 role1role2 是不同的个体,或者 location1location2 是不同的个体。

【讨论】:

    猜你喜欢
    • 2016-11-08
    • 1970-01-01
    • 2016-04-29
    • 2017-06-23
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-12-05
    • 1970-01-01
    相关资源
    最近更新 更多