基于 rdf:type 的属性链推理

发布于 2024-08-18 08:12:48 字数 2200 浏览 6 评论 0原文

我试图让 Pellet 将属性从类传播到属于这些类的个体。例如,如果我的类 A 具有属性 X,个体 B 具有 rdf:type=Class A,则我希望个体 B 在运行推理器后具有属性 X。我正在使用 OWL 2 New 上引用的属性链包含技术功能页面。如果我在属性链中使用自己的自定义属性,则该技术可以完美工作,但如果我尝试使用 rdf:type 本身,则该技术不起作用。以下是我的 RDF/XML 的一些相关片段。

本体类(由 Jena 生成;注意“spread”属性,因为这就是我试图传播给 Person 类的个体的属性):

<rdf:Description rdf:about="http://family/person">
    <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Thing"/>
    <owl:sameAs rdf:resource="http://family/person"/>
    <rdfs:subClassOf rdf:resource="http://www.w3.org/2002/07/owl#Thing"/>
    <owl:equivalentClass rdf:resource="http://family/person"/>
    <owl:disjointWith rdf:resource="http://www.w3.org/2002/07/owl#Nothing"/>
    <j.1:spread rdf:resource="http://spread/specificSpread"/>
    <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/>
</rdf:Description>

“Spread”属性本身(由我手动编写,不是由 Jena 生成的,因为 Jena 的 API不支持对象属性链):

<rdf:Description rdf:about="http://spread/generalSpread">
    <owl:propertyChainAxiom rdf:parseType="Collection">
        <owl:ObjectProperty rdf:about="http://www.w3.org/1999/02/22-rdf-syntax-ns#type"/>
        <owl:ObjectProperty rdf:about="http://spread/generalSpread"/>
    </owl:propertyChainAxiom>
</rdf:Description>

在推理之前,俄狄浦斯人看起来像这样:

<rdf:Description rdf:about="http://family/Oedipus">
    <rdf:type rdf:resource="http://family/person"/>
</rdf:Description>

这个想法是,在推理之后,它看起来像这样:

<rdf:Description rdf:about="http://family/Oedipus">
    <rdf:type rdf:resource="http://family/person"/>
    <j.1:spread rdf:resource="http://spread/specificSpread"/>
</rdf:Description>

我有一种感觉,将 rdf:type 引用为 rdf:resource 是可能事情变得很棘手,因为我很确定它不是资源。但我不知道如何解决它。我也通过 Pellet 的命令行 lint 程序运行它,它似乎没有问题,除了它为 rdf:type 创建了一个显式条目,如下所示

<owl:ObjectProperty rdf:about="&rdf;type"/>

:暗示它不理解我对 rdf:type 的引用。

任何人都可以阐明可能发生的事情吗?我真的很感激任何人可以提供的帮助。

I am trying to get Pellet to propagate properties from classes down to the individuals belonging to those classes. For example, if I have Class A with Property X, and Individual B with rdf:type=Class A, I want Individual B to have Property X after running the reasoner. I'm using the technique of property chain inclusion referenced on the OWL 2 New Features page. This technique works perfectly if I use my own custom properties in the property chain, but it doesn't work if I try to use rdf:type itself. Here are some relevant snips of my RDF/XML.

Ontological Class (generated by Jena; note the "spread" property, as that is what I'm trying to propagate to the individuals of class Person):

<rdf:Description rdf:about="http://family/person">
    <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Thing"/>
    <owl:sameAs rdf:resource="http://family/person"/>
    <rdfs:subClassOf rdf:resource="http://www.w3.org/2002/07/owl#Thing"/>
    <owl:equivalentClass rdf:resource="http://family/person"/>
    <owl:disjointWith rdf:resource="http://www.w3.org/2002/07/owl#Nothing"/>
    <j.1:spread rdf:resource="http://spread/specificSpread"/>
    <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/>
</rdf:Description>

"Spread" property itself (written manually by me, not generated with Jena since Jena's API doesn't support object property chains):

<rdf:Description rdf:about="http://spread/generalSpread">
    <owl:propertyChainAxiom rdf:parseType="Collection">
        <owl:ObjectProperty rdf:about="http://www.w3.org/1999/02/22-rdf-syntax-ns#type"/>
        <owl:ObjectProperty rdf:about="http://spread/generalSpread"/>
    </owl:propertyChainAxiom>
</rdf:Description>

Before reasoning, the person Oedipus looks like this:

<rdf:Description rdf:about="http://family/Oedipus">
    <rdf:type rdf:resource="http://family/person"/>
</rdf:Description>

The idea is that, after reasoning, it would look something like this:

<rdf:Description rdf:about="http://family/Oedipus">
    <rdf:type rdf:resource="http://family/person"/>
    <j.1:spread rdf:resource="http://spread/specificSpread"/>
</rdf:Description>

I have a feeling that referring to rdf:type as an rdf:resource is probably where things are getting screwy since I'm pretty sure it's not a resource. But I'm not sure how to fix it. I ran it through Pellet's command line lint program as well and it didn't seem to have a problem with it except that it created an explicit entry for rdf:type that looked like this:

<owl:ObjectProperty rdf:about="&rdf;type"/>

Looks a little strange to me and might also be a hint that it doesn't understand my reference to rdf:type.

Can anyone shed any light on what might be going on? I'd really appreciate any help anyone could provide.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

话少心凉 2024-08-25 08:12:48

非常重要的编辑

事实上,属性传播在 OWL DL 领域是可能的。例如,如果您想使用值 simpleSpread 传播属性 spread (假设两者都已在 RDF 中定义),您可能会执行类似的操作(在 RDF/ XML):

  <rdf:Description rdf:about="http://family/person">
    <rdfs:subClassOf>
        <owl:hasValue rdf:resource="http://spread/simpleSpread"/>
        <owl:onProperty rdf:resource="http://spread/hasSpread"/>
        <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Restriction"/>
    </rdfs:subClassOf>
    <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/>
  </rdf:Description> 

不再那么重要

好的,为了信息的完整性,我将在这里发布相关的答案信息。这些内容来自与pellet-users 邮件列表上的人的交谈。该帖子已存档,并以我的初始消息开始。跟随线索了解详细发生的事情。

本质上,OWL DL 不允许对内置属性和数据类型进行“反射” 。允许这样做可能会违反 OWL DL 保证的多项式时间可判定性。为了实现这一点,您必须使用 OWL RL 配置文件 OWL Full,它平等地对待 OWL 中的所有内容,从而允许使用 rdf:type 进行推断。

这样做的主要问题是找到一个同时支持 DL 和 RL 的推理器(或推理器组合),因为 RL 比 DL 轻量得多且表达能力较差(更不用说不能保证在多项式时间内可判定)。

Very Important Edit

It actually turns out that property propagation IS possible within the realm of OWL DL. For example, if you want to propagate the property spread with the value simpleSpread (assuming both are already defined in your RDF), you might do something like this (in RDF/XML):

  <rdf:Description rdf:about="http://family/person">
    <rdfs:subClassOf>
        <owl:hasValue rdf:resource="http://spread/simpleSpread"/>
        <owl:onProperty rdf:resource="http://spread/hasSpread"/>
        <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Restriction"/>
    </rdfs:subClassOf>
    <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/>
  </rdf:Description> 

Not so important anymore

Okay so for information completeness, I'll post the relevant answer information here. This stuff comes from talking to people on the pellet-users mailing list. The thread is archived and starts with my initial message. Follow the thread to find out what happened in detail.

Essentially, OWL DL does not allow "reflection" upon built-in properties and datatypes. Allowing this could violate the polynomial time decidability guaranteed by OWL DL. In order to accomplish this, you have to use the OWL RL profile of OWL Full, which treats all things in OWL equally, thus allowing the use of an inference over rdf:type.

The major issue with this is finding a reasoner (or combination of reasoners) that support both DL and RL, since RL is much lighter-weight and less expressive than DL (not to mention not guaranteed to be decidable in polynomial time).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文