Lucas_Werkmeister_WMDE created this task.
Lucas_Werkmeister_WMDE added projects: Wikidata, Math, Wikidata-Query-Service, MediaWiki-extensions-WikibaseRepository.
Herald added a subscriber: Aklapper.
Herald added a project: Discovery.

TASK DESCRIPTION

Currently, we only export the MathML representation of a formula to RDF, not the original TeX string (T126349). This makes it impossible to efficiently query for statements with a certain math value – you have to use REGEX (CONTAINS is not enough, because the TeX annotation embedded in the MathML is not identical to the original TeX string). It also means that any external application that wants to use the TeX string based on the RDF export must use an XML parser to analyze the MathML and extract the TeX annotation.

I think we should add full value nodes for math values, with a structure a bit like this:

wd:Q4115189 a wikibase:Item;
  # ...
  wdt:P2534 "<math xmlns=\"http://www.w3.org/1998/Math/MathML\" display=\"block\" alttext=\"{\\displaystyle a}\">\n  <semantics>\n    <mrow class=\"MJX-TeXAtom-ORD\">\n      <mstyle displaystyle=\"true\" scriptlevel=\"0\">\n        <mi>a</mi>\n      </mstyle>\n    </mrow>\n    <annotation encoding=\"application/x-tex\">{\\displaystyle a}</annotation>\n  </semantics>\n</math>"^^<http://www.w3.org/1998/Math/MathML>.

wd:Q4115189 p:P2534 wds:Q4115189-af122b69-484b-2edd-1af8-f0a691b05039.

wds:Q4115189-af122b69-484b-2edd-1af8-f0a691b05039 a wikibase:Statement;
  ps:P2534 "<math xmlns=\"http://www.w3.org/1998/Math/MathML\" display=\"block\" alttext=\"{\\displaystyle a}\">\n  <semantics>\n    <mrow class=\"MJX-TeXAtom-ORD\">\n      <mstyle displaystyle=\"true\" scriptlevel=\"0\">\n        <mi>a</mi>\n      </mstyle>\n    </mrow>\n    <annotation encoding=\"application/x-tex\">{\\displaystyle a}</annotation>\n  </semantics>\n</math>"^^<http://www.w3.org/1998/Math/MathML>;
  psv:P2534 wdv:d961720c22709f7991be5be0ddf51c88.

wdv:d961720c22709f7991be5be0ddf51c88 a wikibase:MathValue;
  wikibase:mathML "<math xmlns=\"http://www.w3.org/1998/Math/MathML\" display=\"block\" alttext=\"{\\displaystyle a}\">\n  <semantics>\n    <mrow class=\"MJX-TeXAtom-ORD\">\n      <mstyle displaystyle=\"true\" scriptlevel=\"0\">\n        <mi>a</mi>\n      </mstyle>\n    </mrow>\n    <annotation encoding=\"application/x-tex\">{\\displaystyle a}</annotation>\n  </semantics>\n</math>"^^<http://www.w3.org/1998/Math/MathML>;
  wikibase:mathTeX "a"^^<http://latex.example/TODO>.

Side note: the “math” datatype currently seems to be missing completely from the RDF Dump Format page – once we’ve implemented this, we should rectify that.

See also the discussion on the request a query) page.


TASK DETAIL
https://phabricator.wikimedia.org/T195765

EMAIL PREFERENCES
https://phabricator.wikimedia.org/settings/panel/emailpreferences/

To: Lucas_Werkmeister_WMDE
Cc: Aklapper, Smalyshev, Physikerwelt, Lucas_Werkmeister_WMDE, Lahi, Gq86, Darkminds3113, GoranSMilovanovic, Maosef, QZanden, EBjune, merbst, LawExplorer, Avner, Gehel, Debenben, Jonas, FloNight, Xmlizer, jkroll, Wikidata-bugs, Jdouglas, Prod, aude, Tobias1984, fredw, Pkra, Manybubbles, scfc, Mbch331
_______________________________________________
Wikidata-bugs mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikidata-bugs

Reply via email to