【问题标题】:Encoding mathematical properties in RDF在 RDF 中编码数学属性
【发布时间】:2014-06-11 00:24:12
【问题描述】:

我一直在尝试找到添加关系的解决方案,例如 X 将单元 A 放入现有本体中,但是找不到解决方案,所以远。

现有的知识图 - RDF - 有许多概念和关系。为了提高推理的准确性,我们正在尝试为少数几个概念添加一些关键属性。

示例:

概念 X 导致概念 Y。而且,我们现在知道概念 Y 始终具有属性 ABC

请建议如何为知识图中的少数概念添加这种关系 - RDF

【问题讨论】:

标签: math encoding rdf


【解决方案1】:

正如我在对Functions to manipulate RDF collections in SPARQL 的回答中提到的,您可以在 SPARQL 中做一些数学运算,它是一种用于 RDF 的查询语言。对于编码任意数学公式(这是标题所暗示的),您可能还对

感兴趣

文泽尔、肯和海纳·莱因哈特。 “Mathematical Computations for Linked Data Applications with OpenMath。”联合诉讼 第 24 届 OpenMath 研讨会和第 7 届数学用户研讨会 接口 (MathUI)。 2012.

所有这一切,您在此处描述的内容(某些属性的值将具有小于某个数字的值),在 OWL 中是可以表达的。您的具体情况是:

概念 X 导致概念 Y。而且,我们现在知道概念 Y 始终具有属性 ABC

我不确定你所说的一个概念导致另一个概念是什么意思,但你可以说 Y 的每个 instance 对于属性 ABC 的值都小于 30。这很简单。这是公理(曼彻斯特语法)

Y subClassOf ABC only xsd:integer[

在 DL 语法中:

Y ⊑ ∀ABC.xsd:整数[

在 Protégé 中看起来像:

在 OWL 本体的 RDF 表示中(在 Turtle 和 RDF/XML 中):

@prefix :      <https://stackoverflow.com/q/24134785/1281433/facets#> .
@prefix owl:   <http://www.w3.org/2002/07/owl#> .
@prefix rdf:   <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix xsd:   <http://www.w3.org/2001/XMLSchema#> .
@prefix rdfs:  <http://www.w3.org/2000/01/rdf-schema#> .

:ABC    a       owl:DatatypeProperty .

<https://stackoverflow.com/q/24134785/1281433/facets>
        a       owl:Ontology .

:Y      a                owl:Class ;
        rdfs:subClassOf  [ a                  owl:Restriction ;
                           owl:allValuesFrom  [ a                     rdfs:Datatype ;
                                                owl:onDatatype        xsd:integer ;
                                                owl:withRestrictions  ( [ xsd:maxExclusive
                                                                  30 ] )
                                              ] ;
                           owl:onProperty     :ABC
                         ] .
<rdf:RDF
    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
    xmlns="https://stackoverflow.com/q/24134785/1281433/facets#"
    xmlns:owl="http://www.w3.org/2002/07/owl#"
    xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema#">
  <owl:Ontology rdf:about="https://stackoverflow.com/q/24134785/1281433/facets"/>
  <owl:Class rdf:about="https://stackoverflow.com/q/24134785/1281433/facets#Y">
    <rdfs:subClassOf>
      <owl:Restriction>
        <owl:onProperty>
          <owl:DatatypeProperty rdf:about="https://stackoverflow.com/q/24134785/1281433/facets#ABC"/>
        </owl:onProperty>
        <owl:allValuesFrom>
          <rdfs:Datatype>
            <owl:onDatatype rdf:resource="http://www.w3.org/2001/XMLSchema#integer"/>
            <owl:withRestrictions rdf:parseType="Collection">
              <rdf:Description>
                <xsd:maxExclusive rdf:datatype="http://www.w3.org/2001/XMLSchema#integer"
                >30</xsd:maxExclusive>
              </rdf:Description>
            </owl:withRestrictions>
          </rdfs:Datatype>
        </owl:allValuesFrom>
      </owl:Restriction>
    </rdfs:subClassOf>
  </owl:Class>
</rdf:RDF>

【讨论】:

  • 感谢 Joshua:对此有明确的想法。在这种情况下,您能否帮助进行推理。比如,如果我的传入文档的 ABC 值为“25”-如何检索“Y”?同样以防万一,其他一些 Z 类具有相同的 ABC 属性“>30” - 如何根据属性 ABC 的值检索相应的类。感谢您的帮助。
  • 到目前为止,您所说的只是“如果某个东西是 Y,那么它的 ABC 值小于 30。”听起来你也想要另一个方向,所以“当且仅当它的 ABC 小于 30 时 Y?”只需将子类公理更改为等效的类公理即可。
  • 你好约书亚,我可以用 xsd 做数学吗?
  • @crapthings 这个问题并不完全清楚。 XSD 只是一个词汇表。但是 SPARQL 中的运算符确实可以处理许多具有 XSD 数据类型的文字。
猜你喜欢
  • 1970-01-01
  • 2015-03-07
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多