This task consists of four bigger sections. The tasks are ordered by their order of implementation.
For readability, some of the bigger tasks contain a written overall description.
This task is for discussion, clarification and estimation of efforts.
(I) For MathML in Math extension MediaWiki/Wikipedia:
- https://phabricator.wikimedia.org/T310211 : Make 'only MathML rendering' interface available on MediaWiki/MediaWiki as a setting (without SVG rendering) Estimate 2
- https://phabricator.wikimedia.org/T327386 : Create a Full Coverage Test for TexVC(PHP)
- https://phabricator.wikimedia.org/T329620 : Fix Chem support, to be clarified: partly covered atm when test MMLGenerationTexUtilTest.php is active
- https://phabricator.wikimedia.org/T327388 : Generate and Update reference MathML (from Mathoid/LaTeXML) for the current tests
- https://phabricator.wikimedia.org/T327391 : Fix TexVC parsetree related issues
- https://phabricator.wikimedia.org/T331998 : Fix further issues detected during visual comparisons
- https://phabricator.wikimedia.org/T327393 : Implement a comparison algorithm which can compare different MathML outputs for automated testing
- https://phabricator.wikimedia.org/T328752 Implement a comparison algorithm which can compare different MathML for scienctifc resulst (to be clarified)
- https://phabricator.wikimedia.org/T327392 : Implement full coverage MathML parsing and mappings
Mini:
- fix Exception throwing by LocalChecker to $this->valid = false and warning or error (done)
- some class-based unittests for the base mml classes
(II) For Wikidata / Wikipedia Semantics Import:
AnnoMaTex is used for Formula Annotation.
Formula Concepts are integrated in LaTeX of formula: <math display="block" qid=Q35875>E=m\,c^2</math> in Wikitext source code.
Each of the constants (E,m,c) can point to another wikidata concept (by the ‘defining formula’ property (P 2534)).
The in-depth info for an annotated formula (in example above) can be fetched by retrieving a Wiki-special page which holds all the annotations. (Edit: This is an example of the special-page looks like in a wiki ??)The Wikidata item the qid points to, holds MathML which contains the intent annotations.
In a nutshell: it is the qid which is added to a formula on a Wikipage determines the Intents, these are located as annotations of the MathML on the Wikidata page the qid points to.
The feature for annotating Wikidata pages of formulas with intents has yet to be developed. //
- Create a list of the already available annotated formula with wikidata qids, which can be used for our tests. (optional)
- Develop the feature for annotating Wikidata items with intents (is there a validation necessary here? or some type of GUI based forms?) (maybe a follow-up project for the far future)
- Annotate the wikidata elements to which the list points to with Intent annotations within Wikidata / Wikibase . (This can be done by annomathtex, however I don't think it relates to this project)
I think in section (II) there is no work to be done.
(III) Math extension composing the final MathML for Screenreaders :
Intents for formulas are not generated by the Math extension itself. It gets the annotation of from Wikidata, see (II).
If formulas have qid-semantic-annotations with annotated intents in corresponding Wikidata items, the formulas are considered as non-default configuration.
For these formulas the intent attributes get read from a Wikipage(Special:Pages) which can be created by the Math extension for each Wikidata item.
- Find a way to annotate Wikidata Items with Intent in Wikipedia page
- Implement the Intent Grammar (similar to the MathML-Nodes currently), so MathML by TexVC(PHP) can contain Intent elements
- For formulas with qids-semantic-annotations, fetch the SpecialPage, check for intent annotations
- The MathML is generated for each formula with TexVC, if there are intents in the special-page, they parsed (does this contain validation of the annotated attributes?) and added to the final MathML which is delivered to Screenreaders (also here, what happens if there are multiple nested qid-annotations for a formula): Alignment of Special Page content to MathML
- Build a minimal test which checks the generation of all necessary elements in MathML for intent
- Build a minimal test which checks the intent generation for the currently existing non-default intent items from Wikidata (these are 5-20 formula, these are the list items mentioned in II)
- It should have 100% test coverage for the intent grammar.
Alternative plan is in subtask since 21.06.23: Instead of composing MathML with intents in Math extension, browser extension written in Javascript shall do this.
(IV) Checking the generated speech in Wikipages:
- Speech to Text activation OR use Screenreader capabilities OR find another recent and suitable program which can create intents
- Define a set of cases and check the speech output, before and after our implementations
- https://phabricator.wikimedia.org/T327394: Evaluate Speech Output for MathML with Intent attributes ( to be clarified, but i think this would be enough for the current scope)
I think this has to be spelled out elswere. Maybe It would be good project to do in collaboration with a developer of a screenreader software.