Encoding mathematical properties in RDF

核能气质少年 提交于 2019-12-18 09:01:03

问题


I have been trying to find a solution to adding relationships, such as X has unit A < 20 into an existing ontology, but, could not find a solution so far.

An existing knowledge graph - RDF - has many concepts and relationships. In an attempt improve the accuracy of inferences, we are trying to add some key properties to few of the concepts.

Example:

Concept X causes concept Y. And, we now know that concept Y has property ABC < 30 always.

Please suggest on how to add this kind of relationships for only few concepts in a knowledge graph - RDF


回答1:


As I mentioned in an answer to Functions to manipulate RDF collections in SPARQL, you can do some mathematics in SPARQL, which is a query language for RDF. For encoding arbitrary mathematical formulas (which is what the title suggests), you might also be interested in

Wenzel, Ken, and Heiner Reinhardt. "Mathematical Computations for Linked Data Applications with OpenMath." Joint Proceedings of the 24th Workshop on OpenMath and the 7th Workshop on Mathematical User Interfaces (MathUI). 2012.

All that said, what you're describing here (that the value of of some property will have a value less than a certain number), is expressible in OWL. Your particular situation was:

Concept X causes concept Y. And, we now know that concept Y has property ABC < 30 always.

I'm not sure what you mean by a concept causing another, but you can say that every instance of Y has only values less than 30 for the property ABC. That's pretty straightforward. It's the axiom (in Manchester syntax)

Y subClassOf ABC only xsd:integer[< 30]

and in DL syntax:

Y &sqsubseteq; ∀ABC.xsd:integer[< 30]

In Protégé that looks like:

and in the RDF representation of the OWL ontology (in Turtle and 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>


来源:https://stackoverflow.com/questions/24134785/encoding-mathematical-properties-in-rdf

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!