【问题标题】:DataProperties in Subclass expression子类表达式中的 DataProperties
【发布时间】:2018-05-08 12:50:12
【问题描述】:

我尝试使用内置于 graphdb 的 OWL2-RL 规则。我显然做错了什么或理解错了什么。这是我的玩具本体。

<?xml version="1.0"?>
<rdf:RDF xmlns="http://www.semanticweb.org/rlehmann/ontologies/2017/10/untitled-ontology-182#"
     xml:base="http://www.semanticweb.org/rlehmann/ontologies/2017/10/untitled-ontology-182"
     xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
     xmlns:owl="http://www.w3.org/2002/07/owl#"
     xmlns:xml="http://www.w3.org/XML/1998/namespace"
     xmlns:untitled-ontology-182="http://www.semanticweb.org/rlehmann/ontologies/2017/10/untitled-ontology-182#"
     xmlns:xsd="http://www.w3.org/2001/XMLSchema#"
     xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
     xmlns:ontology="http://www.some/ontology/">
    <owl:Ontology rdf:about="http://www.semanticweb.org/rlehmann/ontologies/2017/10/untitled-ontology-182"/>

    <!-- http://www.some/ontology/hasValue -->
    <owl:DatatypeProperty rdf:about="http://www.some/ontology/hasValue">
         <rdfs:range rdf:resource="http://www.w3.org/2001/XMLSchema#string"/>
    </owl:DatatypeProperty>

    <!-- http://www.some/ontology/ClassA -->
    <owl:Class rdf:about="http://www.some/ontology/ClassA"/>

    <!-- http://www.some/ontology/InvA -->
    <owl:NamedIndividual rdf:about="http://www.some/ontology/InvA">
        <rdf:type rdf:resource="http://www.some/ontology/ClassA"/>
        <ontology:hasValue rdf:datatype="http://www.w3.org/2001/XMLSchema#string">StringValue</ontology:hasValue>
    </owl:NamedIndividual>

    <!-- http://www.some/ontology/InvB -->
    <owl:NamedIndividual rdf:about="http://www.some/ontology/InvB">
        <ontology:hasValue rdf:datatype="http://www.w3.org/2001/XMLSchema#string">FooBar</ontology:hasValue>
    </owl:NamedIndividual>


    <owl:Restriction>
        <owl:onProperty rdf:resource="http://www.some/ontology/hasValue"/>
        <owl:someValuesFrom rdf:resource="http://www.w3.org/2001/XMLSchema#string"/>
        <rdfs:subClassOf rdf:resource="http://www.some/ontology/ClassA"/>
    </owl:Restriction>
</rdf:RDF>

如果我没有误解 OWL2-Profiles 中的表 2,这个本体应该在 OWL2 RL 配置文件中。我希望“InvB”被归类为 A 类。但事实并非如此。它实际上与推理器(HermiT,Pellet,...)有关,但与规则(Drools,Graphdb)无关,这是规范中的一个空白。

如何“修复”我的本体或有任何解决方法?

干杯,

罗伯特

【问题讨论】:

  • 可能是 GCI 中的问题:尽量不要在子类表达式的左侧使用匿名类。此外,它是否使用对象属性而不是数据属性?
  • 抱歉迟到的答案。

标签: owl graphdb


【解决方案1】:

不使用 GCI 左侧的匿名类不是我们的应用程序的选项。是的,对象属性可以完美运行。

经过一些研究,我们实际上发现,它永远不会那样工作。在对应于 RL-Profile 的 GraphDB .pie 文件中,只有一些规则的概念“//这些没有实现(并且可能无法实现)”。这包括OWL2 RL Section 4.3 Table 8 中定义的规则“dt-type2”。 RDF 第 3.1 节给出了为什么这不应该工作的实际答案。

  1. RDF 图

    RDF 图是一组 RDF 三元组。

    3.1 三元组

    一个 RDF 三元组由三个组件组成:

    • 主题,即IRI或空白节点

    • 谓词,它是一个 IRI

    • 对象,即 IRI、文字或空白节点

"FooBar"^^xsd:string rdf:type xsd:string 这根本是不允许的,但显然是必需的。

我们很不确定 w3c 的人除了 RDF 之外还有什么想法?!

就像现在一样,这种推理在 GraphDB 中根本行不通(而且通常在没有规则引擎上?)。但这不是 GraphDB 的错,而只是规范链上的一个缺口。

但是,我们在本体中做了一个变通方法,可以解决问题并为我们工作。我们只是

  • 为我们使用的数据类型定义了新概念
  • 将所有 DataProperties 转换为 ObjectProperties
  • 引入了新的 DataType 属性,其中域之一是新的数据类型概念和范围 xsd:xyz。例如 Property:hasStringValue Domain:string Range:xsd:string

这对我们有用。

【讨论】:

    猜你喜欢
    • 2021-04-05
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多