A Proposal for an OpenMath JSON encoding -- see doc/openmath.md for concrete examples and documentation.
The actual encoding can be found in src/schema/openmath.d.ts. It is implemented as a set of TypeScript Definitions.
It can also be compiled into a JSON Schema, for easy validation. This is achieved using ts-json-schema-generator. If yarn is installed locally, you can run:
# To install ts-json-schema-generator
yarn
# To generate a JSON Schema into src/schema/openmath.json
yarn saveschema
The Resulting File is committed in the repository.
Along with the encoding itself, this repository contains a TypeScript Implementation that can convert between the JSON and XML OpenMath encodings. This can be found in the src/convert/ folder.
Furthermore, an implementation that validates a given JSON object against the JSON Schema is also present. This is demonstrated in the form of a website and an API.
The demo website can be found at https://omjson.openmath.org.
The website can be run locally by typing:
cd server && yarn && yarn serveprod
or using the automated Docker Build tkw01536/openmath-json-demo:
docker run -p 3000:3000 tkw01536/openmath-json-demo
CC-BY-3.0. See LICENSE.