Skip to content

Adding "semantics" to presentation MathML via "roles" #64

Closed

Description

@NSoiffer

On a call, we discussed a few ideas to help disambiguate the meaning of a presentation MathML element by adding an attribute that gives some meaning. We agreed that by default tags should have a default meaning. For example, msup probably means "power", but if it doesn't, some other meaning should be attached.

Note the default is not a good default in some simple cases:

  • the superscript is ′ (Unicode "prime" char)
  • the superscript is ° (Unicode degree char)

Some some thought needs to be given as to what the default really means. I think probably a power is a better default than is a power.

One possible direction is to have something similar to csymbol's definitionURL attribtue, but people didn't like that because it is too long. Another idea is to add something similar to ARIA's roles. Maybe a mathrole attribute (or mrole?). Rather than make up names for the values, I suggest we use an existing (extensible) website such as www.wikidata.org where the role value only points to the last part of the URL. E.g., the Jacobi symbol would just be mathrole="Q241015". The downside is that without following the link, you don't know what it means just looking at it. Similarly, as an author, the names are mnemonic and thus, are hard to remember. You'd need a tool in all likelihood to generate them. Potentially, a note (not the spec) would call out some specific examples (maybe a few hundred for K12 cases) so AT manufacturers and others at least have common cases they handle.

The alternative to using wikidata.org is OpenMath. The positive side is that it is already part of content MathML. The downside is that it doesn't seem that complete and is harder to update. For example, neither the Jacobi symbol nor the Legendre symbol seem to be part of OpenMath.

Note: the math on the web CG has a page with some ambiguous notations. That's a good place to check any proposal to make sure it deals with those cases.

Activity

  1. AdamSobieski commented on Mar 5, 2019

    @AdamSobieski

    On the topic of interrelating expressions' presentations and semantics: if we choose to add metadata to expressions, we could utilize id attributes on key elements of presentation and semantics markup to describe and relate the elements via expressions' metadata. That is, there could be a section of a mathematical expression with, for example, RDF/XML which describes and relates elements of presentation and semantics.

  2. AdamSobieski commented on Mar 5, 2019

    @AdamSobieski

    Here is an example of utilizing metadata to relate presentation and semantics:

    <math id="eq1">
      <semantics>
        <annotation-xml id="eq1-p-mathmlp" encoding="application/mathml-presentation+xml">
          <mrow id="E">
            <mrow id="E.1">
              <mo id="E.1.1">(</mo>
              <mi id="E.1.2">a</mi>
              <mo id="E.1.3">+</mo>
              <mi id="E.1.4">b</mi>
              <mo id="E.1.5">)</mo>
            </mrow>
            <mo id="E.2">&#x2062;<!--INVISIBLE TIMES--></mo>
            <mrow id="E.3">
              <mo id="E.3.1">(</mo>
              <mi id="E.3.2">c</mi>
              <mo id="E.3.3">+</mo>
              <mi id="E.3.4">d</mi>
              <mo id="E.3.5">)</mo>
            </mrow>
          </mrow>
        </annotation-xml>
        <annotation-xml id="eq1-s-mathmlc" name="contentequiv" encoding="application/mathml-content+xml">
          <apply id="S">
            <and id="S.2"/>
            <apply id="S.1">
              <xor id="S.1.3"/><ci id="S.1.2">a</ci><ci id="S.1.4">b</ci>
            </apply>
            <apply id="S.3">
              <xor id="S.3.3"/><ci id="S.3.2">c</ci><ci id="S.3.4">d</ci>
            </apply>
          </apply>
        </annotation-xml>
        <annotation-xml name="metadata" encoding="application/rdf+xml">
          <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
                   xmlns:mm="http://example.com/math-metadata/">
            <rdf:Description rdf:about="E">
              <mm:mapsTo rdf:resource="S" />
            </rdf:Description>
            <rdf:Description rdf:about="E.1">
              <mm:mapsTo rdf:resource="S.1" />
            </rdf:Description>
            <rdf:Description rdf:about="E.2">
              <mm:mapsTo rdf:resource="S.2" />
            </rdf:Description>
            <rdf:Description rdf:about="E.3">
              <mm:mapsTo rdf:resource="S.3" />
            </rdf:Description>
            ...
          </rdf:RDF>
        </annotation-xml>
      </semantics>
    </math>
  3. AdamSobieski commented on Mar 22, 2019

    @AdamSobieski

    What about hint instead of role? That is, the information in the attributes under discussion could be viewed as hints for algorithms which process MathML presentation into semantic representations.

  4. added
    enhancement
    MathML Core
    accessibility
    on Mar 30, 2019
  5. removed
    MathML Core
    on May 22, 2020
  6. fred-wang commented on May 22, 2020

    @fred-wang

    cc @joanmarie @asurkov

    Removing the "MathML Core" label, as I understand this is not something implementers are interested in at this point.

  7. added
    intent
    on Jun 17, 2022
  8. NSoiffer commented on Jun 21, 2022

    @NSoiffer
    ContributorAuthor

    Closing because this has been superseded by the intent idea.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    accessibilityenhancementintent

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions