OpenMath / OMSTD

The OpenMath Standard (starting with OpenMath 2)
9 stars 5 forks source link

Referencing cdgroups #57

Closed davidcarlisle closed 6 years ago

davidcarlisle commented 6 years ago

I would like to propose adding one new optional attribute to (just) OMOBJ

cdgroup="http://.....cdg"

taking a URL to a cd group file. This would not affect the abstract OM object (or the binary encoding) but would bring the OM XML encoding in to line with the Strict Content MathML encoding and provide a far more usable way of defaulting URI for individual symbols in an object.

MathML3 says:

https://w3c.github.io/mathml/mathml.html#chapter2_interf.toplevel.atts

cdgroup | URI | none

specifies a CD group file that acts as a catalogue of CD bases for locating OpenMath content dictionaries of csymbol, annotation, and annotation-xml elements in this math element; see Section 4.2.3 Content Symbols <csymbol>. When no cdgroup attribute is explicitly specified, the document format embedding this math element may provide a method for determining CD bases. Otherwise the system must determine a CD base; in the absence of specific information http://www.openmath.org/cd is assumed as the CD base for all csymbol, annotation, and annotation-xml elements. This is the CD base for the collection of standard CDs maintained by the OpenMath Society.

We used cdgroup in mathml3 after considering and rejecting adding a cdbase attribute as cdbase is more or less unusable unless all symbols are at the same URL (openmath.org/cd in practice)

If for example you introduce your foobar cd with symbols aaa and bbb at a CDBase of example.com and want an FMP that says aaa=bbb

then you want

apply(relation1.eq,foobar.aaa,foobar.bbb)

In an OM1 style URI-free interpretation that was fine: any application processing the object is assumed implicitly to know some group of CDs and so can interpret this.

But the namespaces-style push to give everything an explicit URI leads to problems: either you set the CDBase of the object to openmath.org to use the standard symbols such as equality then have to explicitly give the example.com CDbase on all the new symbols, or the other way round make the cdbase for the object example.com and mark all the standard symbols with cdbase openmath.org.

The intention with the mathml3 cdgroup attribute is at example.org where you are introducing the cds make a cdgroup that lists (by cdurl) any standard and non standard cds that you wish to use then all your objects just need to have cdgroup=example.org/mycds.cdg and all cd names in the object can be unambiguously tied to any number of different base URI. That is, it rather closely matches the implicit intuition in OM1 that an application "knows" a group of CDs.

This has very low compatibility impact I think and brings the two xml encodings in to line so I'm suggesting milestone 2.0r2 even though it's probably on the limit of syntactic changes that could be considered at a revision.

kohlhase commented 6 years ago

I really like the idea, since

My only concern is whether a single CDGroup is enough. It was for MathML, since there is only really the mathml.cdg in the purview. Say that I want to send a MathML object via SCSCP, then I would have to have a mathml+scscp.cdg.

Therefore I suggest that we extend David's proposal and add a cdgroups attribute which contains a whitespace-separated list of cdgroup URIs.

davidcarlisle commented 6 years ago

multiple groups were considered for mathml3 but we didn't want to specify what to do if they had overlapping or inconsistent mappings etc. If Now in OM we extend past mathml3's extension then justifying it as "alignment with mathml" is harder.

In practice if you are writing a bunch of new Cds it isn't so much of an effort to make a (potentially growing) cdgroup of "all the cds I care about"

kohlhase commented 6 years ago

so you envision a world, where we have "personal cdgroups" That sounds reasonable. But then I think I would like to have an include feature for CDGroups, so that we can reuse work.

davidcarlisle commented 6 years ago

nested cdgroups are a natural way to go here but could be pushed to OM3 or at least OM2rnext to keep om2r2 on track

kohlhase commented 6 years ago

OK, then I will make an issue (outside the R2 milestone) for inclusion/nested cdgroups and we can just execute your change here.

kohlhase commented 6 years ago

I made #59 for the inclusion, but then noticed that before we can act on the cgroup attributed proposed here, we have to deal with uniqueness (see #60) and CDURL defaulting (see #59). Incidentally, these two are the prerequisites for getting inclusion to work, so we may as well do all together.

kohlhase commented 6 years ago

I am just wondering, do we need to add the equivalent mechanism for the binary encoding as well? I think not. @davidcarlisle can you confirm just to be sure? I do not really see a backwards-compatible way of doing that.

kohlhase commented 6 years ago

If that is correct, please have a look at #61, merge it, if you agree, and close this issue.

davidcarlisle commented 6 years ago

I don't know if there are any currently working implementations of the binary encoding, if we change anything there almost certainly won't be so I'd keep it unchanged unless absolutely necessary. It can't be needed here as it's documented as an aliasing mechanism equivalent to specifying cdurl as needed so if the binary encoding has to do that, so be it. I would guess anyone looking for the space savings of the binary encoding would in practice not put the URL on every symbol anyway and just implicitly assume some base sucah as openmath,org/cd.

I'll look at the PR...

On 7 October 2017 at 15:06, Michael Kohlhase notifications@github.com wrote:

If that is correct, please have a look at #61 https://github.com/OpenMath/OMSTD/pull/61, merge it, if you agree, and close this issue.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/OpenMath/OMSTD/issues/57#issuecomment-334937450, or mute the thread https://github.com/notifications/unsubscribe-auth/ABNcAgN8OxYzXm9fCkjkRh4hHXHpumwpks5sp4VdgaJpZM4PvqpL .

kohlhase commented 6 years ago

Yes, that was exactly what I thought, but (as we see in the schema) a second pair of eyes is helpful.

kohlhase commented 6 years ago

closing because David merged the PR