-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Semantic Embedding Examples
Volker Sorge edited this page Apr 14, 2015
·
19 revisions
Some simple examples of embedded semantic tree. Note that for readability the attributes have been abbreviated
Original MathML:
<math>
<mn>5</mn>
<mo>=</mo>
<mn>3</mn>
<mo>+</mo>
<mn>2</mn>
</math>
Semantically enriched MathML:
<math>
<mrow semantic-type="relseq" semantic-role="equality" id="6" semantic-content="1" semantic-children="0,5">
<mn semantic-type="number" semantic-role="integer" id="0" semantic-parent="0">5</mn>
<mo semantic-type="relation" semantic-role="equality" id="1" semantic-operator="relseq,=" semantic-parent="1">=</mo>
<mrow semantic-type="infixop" semantic-role="addition" id="5" semantic-content="3" semantic-children="2,4" semantic-parent="5">
<mn semantic-type="number" semantic-role="integer" id="2" semantic-parent="2">3</mn>
<mo semantic-type="operator" semantic-role="addition" id="3" semantic-operator="infixop,+" semantic-parent="3">+</mo>
<mn semantic-type="number" semantic-role="integer" id="4" semantic-parent="4">2</mn>
</mrow>
</mrow>
</math>
Observe that for the semantic interpretation the original MathML tags are pretty irrelevant. E.g., writing numbers as identifiers still yields the same semantic markup.
Original MathML:
<math>
<mi>5</mi>
<mo>=</mo>
<mi>3</mi>
<mo>+</mo>
<mi>2</mi>
</math>
Enriched MathML:
<math>
<mrow semantic-type="relseq" semantic-role="equality" id="6" semantic-content="1" semantic-children="0,5">
<mi semantic-type="number" semantic-role="integer" id="0" semantic-parent="0">5</mi>
<mo semantic-type="relation" semantic-role="equality" id="1" semantic-operator="relseq,=" semantic-parent="1">=</mo>
<mrow semantic-type="infixop" semantic-role="addition" id="5" semantic-content="3" semantic-children="2,4" semantic-parent="5">
<mi semantic-type="number" semantic-role="integer" id="2" semantic-parent="2">3</mi>
<mo semantic-type="operator" semantic-role="addition" id="3" semantic-operator="infixop,+" semantic-parent="3">+</mo>
<mi semantic-type="number" semantic-role="integer" id="4" semantic-parent="4">2</mi>
</mrow>
</mrow>
</math>