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

Provide an OpenMath interface #19970

Open
slel opened this issue Jan 27, 2016 · 9 comments
Open

Provide an OpenMath interface #19970

slel opened this issue Jan 27, 2016 · 9 comments

Comments

@slel
Copy link
Member

slel commented Jan 27, 2016

OpenMath is a W3C standard for representing mathematical objects in XML (or binary)
format; the syntax and semantic for specific objects (polynomials, ...) is specified in
"content dictionaries", a standard collection of which is available at https://openmath.org .

Support for OpenMath serialization (importing from and exporting to OpenMath) would
improve the interoperability between SageMath and other mathematics software
(both ways: accessing other software from Sage, and accessing Sage from other software).

py-openmath
is an implementation of OpenMath for Python; it provides
a data structure for OpenMath expression trees (with serialization to from xml representation), together with converters between Python objects and OpenMath expression trees. The default converter can handle basic Python objects (integers, lists, ...) exported using the standard OpenMath content dictionaries. Additional conversions can be registered.

To install py-openmath using the openmath package on Pypi:

sage --pip install openmath

To export more SageMath objects the standard approach would be to use
the existing Content Dictionaries (or creating new ones if non existing), and manually implement the conversions for each type of Sage object.

An alternative approach is to use py-openmath's generic serialization to OpenMath. With it, any (picklable) Python object is converted to an OpenMath expression describes how to reconstruct the object from basic Python objects and global functions; it's based on Python's pickle protocol, and can be seen as an alternative pickle format.

See this demo.

By construction, the resulting OpenMath is "system-near"; importing or exporting from another system requires an additional translation step,
using alignments. The hope is that decoupling the serialization and the translation steps makes it easier to maintain the conversions. This is being explored as part of the Math-in-the-Middle research project; see e.g. these papers.

See also: #19971 "Provide an SCSCP interface".

CC: @alex-konovalov @JohnCremona @defeo @dimpase @slel @sagetrac-markuspf @mezzarobba @sagetrac-mkohlhase @nthiery @sagetrac-twiesing

Component: interfaces: optional

Keywords: OpenMath, interface, interoperability

Issue created by migration from https://trac.sagemath.org/ticket/19970

@slel slel added this to the sage-7.1 milestone Jan 27, 2016
@slel

This comment has been minimized.

@slel

This comment has been minimized.

@slel
Copy link
Member Author

slel commented Jul 1, 2016

Changed keywords from OpenMath to OpenMath, interface, interoperability

@slel
Copy link
Member Author

slel commented Jul 1, 2016

comment:3

Edit ticket description adding link to py-OpenMath.

@slel

This comment has been minimized.

@slel

This comment has been minimized.

@slel slel removed this from the sage-7.1 milestone Jul 11, 2018
@nthiery

This comment has been minimized.

@slel

This comment has been minimized.

@slel

This comment has been minimized.

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

No branches or pull requests

2 participants