[Om] JSON Binding for OpenMath?

Tom Wiesing tom.wiesing at fau.de
Tue May 15 08:33:24 CEST 2018


Dear all, 

I see some problems with the existing two proposals. 
I have written this up in a bit more detail, and also made a concrete new proposal to address those issues. 

Kindly have a look at [1]. 

Greetings, 
Tom Wiesing

[1] https://github.com/tkw1536/OpenMath-JSON/blob/master/schema/openmath.md#an-openmath-json-encoding

> Hi, everyone.
> 
> I'm the author of the JS OpenMath module referred to below.  I was definitely not trying to create a standard encoding when writing that module, but rather just creating a library useful for my own purposes.  If a standard encoding were created, I would be glad to be a part of the efforts, and to update that module to read/write the standard encoding.
> 
> My experience lies more in building software than it does in building standards, but I'm still glad to contribute to the degree that I can.
> 
> Nathan
> 
>> On May 2, 2018, at 3:52 AM, Alberto González Palomo <alberto at matracas.org> wrote:
>> 
>> Michael Kohlhase wrote on 02/05/18 at 08:57:
>>> we have come across the need to communicate OpenMath Objects to JavaScript.
>>> We could go traditional and send over XML and have JS parse that into JS
>>> Objects, or we could use a JSON binding for OpenMath.
>>> It actually seems that Nathan Carter has already done something very
>>> much like that.  [1]
>>> Would it make sense to standardize a JSON binding of OpenMath? After
>>> all, JSON is one of the practical competitors for XML and used A LOT on
>>> the web.
>>> [1] https://lurchmath.github.io/openmath-js/site/
>> 
>>  For anyone else interested, here is a direct link to the docs: (please note that I'm not the author)
>> https://github.com/lurchmath/openmath-js/blob/master/openmath.litcoffee#openmath-module
>> 
>>  Some concrete examples:
>> https://github.com/lurchmath/openmath-js/blob/master/openmath-spec.litcoffee#should-decode-valid-simple-forms
>> 
>>  For instance, let's compare the encoding of $x+5$:
>> 
>>  - OpenMath:
>>    <OMOBJ xmlns="http://www.openmath.org/OpenMath"><OMA><OMS cd="arith1" name="plus"/><OMV name="x"/><OMI>5</OMI></OMA></OMOBJ>
>> 
>>  - openmath-js:
>>    {"t":"a", c:[ {"t":"sy", "cd":"arith1", "n":"plus"}, {"t":"v", "n":"x"}, {"t":"i", "v":"5"} ] }
>> 
>>  There is another way to encode XML as JSON, called JSONML, which is pretty much LISP with square brackets:
>> http://jsonml.org/
>> 
>>  - JSONML:
>>    ["OMOBJ", {"xmlns":"http://www.openmath.org/OpenMath"}, ["OMA", ["OMS", {"cd":"arith1", "name":"plus"}], ["OMV", {"name":"x"}], ["OMI", "5"] ]]
>> 
>>  As a standard encoding, I'd rather recommend JSONML because it is a straight mapping of the XML syntax and there are implementations of it for several programming languages. I've used it extensively for web applications, generating HTML and XML for both personal projects and work for customers, and it works well in practice.
>> 
>>  Cheers,
>> -- 
>>    Alberto González Palomo
>>    Toledo, España / Saarbrücken, Deutschland
>>    https://matracas.org
> 
> <ATT00001.txt>



More information about the Om mailing list