0

我对 MathML 还很陌生,所以如果这是一个愚蠢的问题,我深表歉意。我想将 MathML 3.0 嵌入到本体(RDF/OWL 等)中。但我希望等式中的变量引用本体中的实体。

例如,对于方程式 ( a + b ),其中aexampleontology#a表示,bexampleontology#b表示,我会执行以下操作:

<apply> <csymbol cd="arith1">加号</csymbol>

<ci id='exampleontology#a'>a</ci>

<ci id='exampleontology#b'>b</ci>

</申请>

我不确定嵌入这些引用的最合适方法是什么。

4

4 回答 4

2

semanticweb.com上有关在 RDF 中编码数学表达式的相关问题的答案可能有助于实现预期目标。

它为数学对象以及数学表达式和 RDF 资源和属性之间的交叉引用引入了基于 OpenMath 的词汇表(另请参见RDF 的 OpenMath 内容字典)。由于 OpenMath 还与严格内容 MathML 完全兼容,因此很容易在两种表示之间进行转换。

于 2013-03-25T19:23:01.250 回答
1

传统上,MathML 和 OWL 都使用它们自己独立的特定标签(例如:)序列化为 XML <owl:Class rdf:about="exampleontology#A"/>。所以这是不可能的,你必须找到一个解决方法。

您可以做的是创建一个本体,然后通过 OWL 注释属性(例如mathml)链接一些 MathML 代码。然后,您可以稍后通过访问注释属性的值来检索 MathML 代码。

例如,如果您将以下代码块保存为 .owl 文件并使用 Protege 4 打开它,您应该能够理解该模式:

<?xml version="1.0"?>
<!DOCTYPE rdf:RDF [
<!ENTITY owl "http://www.w3.org/2002/07/owl#" >
<!ENTITY demo "http://www.example.org/demo.owl#" >
<!ENTITY xsd "http://www.w3.org/2001/XMLSchema#" >
<!ENTITY rdfs "http://www.w3.org/2000/01/rdf-schema#" >
<!ENTITY rdf "http://www.w3.org/1999/02/22-rdf-syntax-ns#" >
]>
<rdf:RDF xmlns="http://www.example.org/demo.owl#"
 xml:base="http://www.example.org/demo.owl"
 xmlns:demo="http://www.example.org/demo.owl#"
 xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
 xmlns:owl="http://www.w3.org/2002/07/owl#"
 xmlns:xsd="http://www.w3.org/2001/XMLSchema#"
 xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
<owl:Ontology rdf:about="http://www.example.org/demo.owl"/>

<owl:AnnotationProperty rdf:about="&demo;mathml"/>

<owl:Class rdf:about="&demo;a">
    <mathml rdf:datatype="&xsd;string">&lt;ci&gt;a&lt;/ci&gt;</mathml>
</owl:Class>
</rdf:RDF>
于 2013-03-06T09:16:44.507 回答
0
<apply> <csymbol cd="arith1">plus</csymbol>
<ci id='exampleontology#a'>a</ci>
<ci id='exampleontology#b'>b</ci>
</apply>

#不是 XML ID 中的有效字符,我认为这里最自然的方法是将您的本体等同于 OpenMath 内容字典然后您可以去

<apply> <csymbol cd="arith1">plus</csymbol>
<csymbol cd='exampleontology'>a</csymbol>
<csymbol cd='exampleontology>b</csymbol>
</apply>

csymbol 的内容作为内容字典中的符号名称。

您可以但不必使用 OpenMath 内容字典语法来描述系统,或者您可以直接将本体作为 OWL 进行管理。

例如,有一些旧文件开始了 rdf/owl 和 openmath 世界视图之间的一些映射

http://www.openmath.org/ontology/README

http://www.openmath.org/lists/index.html上的 openmath 列表可能是与对 OpenMath/MathML 和 RDF/OWL 感兴趣的人联系的最佳场所

于 2013-03-10T21:03:55.717 回答
0

最简单的方法是为 MathML 文字定义新的数据类型。假设http://www.w3c.org/datatypes/mathMLLiteral。(理想情况下它应该由 W3C 定义)

在 Turtle 格式中,它看起来像这样:

@prefix math:<http://example.org/ont/math#>

:APlusB a math:Addition
   math:serialization """<apply> <csymbol cd="arith1">plus</csymbol>
                         <ci id='exampleontology#a'>a</ci>
        <ci id='exampleontology#b'>b</ci>

        </apply> """^^<http://www.w3c.org/datatypes/mathMLLiteral> .

GeoSPARQL标准中使用了类似的编码模式,其中几何以 WKT 或 GML 编码。Geosparql 为每个引入了两种不同的数据类型:http ://www.opengis.net/ont/geosparql#wktLiteral和 < http://www.opengis.net/ont/geosparql#gmlLiteral

于 2014-04-12T21:01:07.947 回答