Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
NSoiffer opened this issue Mar 1, 2019 · 5 comments
Closed

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

NSoiffer opened this issue Mar 1, 2019 · 5 comments
Labels
accessibility Issues related to improving accessibility enhancement New feature or request intent Issues involving the proposed "intent" attr

Comments

@NSoiffer
Copy link
Contributor

NSoiffer commented Mar 1, 2019

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.

@NSoiffer NSoiffer mentioned this issue Mar 5, 2019
@AdamSobieski
Copy link

AdamSobieski commented Mar 5, 2019

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.

@AdamSobieski
Copy link

AdamSobieski commented Mar 5, 2019

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>

@AdamSobieski
Copy link

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.

@davidcarlisle davidcarlisle added enhancement New feature or request MathML Core Issues affecting the MathML Core specification accessibility Issues related to improving accessibility labels Mar 30, 2019
This was referenced May 23, 2019
@fred-wang fred-wang removed the MathML Core Issues affecting the MathML Core specification label May 22, 2020
@fred-wang
Copy link

cc @joanmarie @asurkov

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

@davidcarlisle davidcarlisle added the intent Issues involving the proposed "intent" attr label Jun 17, 2022
@NSoiffer
Copy link
Contributor Author

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
Labels
accessibility Issues related to improving accessibility enhancement New feature or request intent Issues involving the proposed "intent" attr
Projects
None yet
Development

No branches or pull requests

4 participants