Ticket #640 (closed defect: fixed)
Include cdbase in OpenMath output
| Reported by: | clange | Owned by: | vzholudev |
|---|---|---|---|
| Priority: | major | Milestone: | Release v1.3.0 |
| Component: | System Implementation (SI) | Version: | v0.1.4 |
| Keywords: | Cc: | kohlhase, frabe, dmisev | |
| Blocked By: | Blocking: | ||
| Due to close: | YYYY/MM/DD | Include in GanttChart: | no |
| Dependencies: | Due to assign: | YYYY/MM/DD |
Description
We would like to translate <OMS cd="..." name="..."/> into URIs (cf. #639). For that to work, we need an additional disambiguation aid: the CDBase. In OMDoc input documents this is usually not needed, as symbols are resolved via theory imports, but in the XHTML+MathML+OpenMath? output we need to make this information explicit for the JOBAD client.
(@Michael, @Florian, I'm just Ccing you FYI. You see that OpenMath?'s standard way of translating OMS to URIs can be really troublesome, especially when combined with OMDoc. I'm glad that with OMDoc 1.6 we can get rid of that mess.)
(@Slava, can you please "process" this ticket and delegate appropriate parts of the work to Dimitar? I would be available for a meeting on Monday if there are things to be discussed.)
In GenCS in TNTBase using OMDoc 1.3, the situation is always like this: Behind a cool URI like http://linkeddata.kwarc.info/gencs/dmath/en/sets-introduction, which redirects to a semi-cool TNTBase URI (e.g. http://alpha.tntbase.mathweb.org:8080/...) we have an OMDoc document, which contains a theory with the same name. The case of having more than one theory in a document does not occur in practice. It would get us into trouble, which I don't want to deal with now. OMDoc 1.6 with MMT will solve that problem for us.
When rendering an OMDoc document, JOMDoc knows what URI it has. In DOM this is done via Document.setDocumentURI/getDocumentURI; I don't recall the XOM way right now. TNTBase should set that to the "cool URI" of the document. So, JOMDoc knows that it is currently rendering e.g. http://linkeddata.kwarc.info/gencs/dmath/en/sets-introduction. And we can safely assume that the only theory in this document is named "sets-introduction". Thus we will have symbols like <OMS cd="sets-introduction" name="emptyset"/>. Therefore, the CDBase URI is the document's URI without the name of the document, i.e. http://linkeddata.kwarc.info/gencs/dmath/en. For the parallel markup output, the OMS thus has to be <OMS cdbase="http://linkeddata.kwarc.info/gencs/dmath/en" cd="sets-introduction" name="emptyset"/>, in order to make the OMS→URI construction from #639 work.
So far I have sketched this for symbols from the current document. When the current document uses symbols from another document, you somehow have to do the same construction, i.e. from a given <OMS cd="..." name="..."/> find out in what document the symbol has been declared.
Initially we can add a @cdbase attribute to every OMS. As @cdbase scopes like XML namespace (i.e. the closest ancestor @cdbase counts when there is no @cdbase on an OMS), we could post-process that and move common @cdbase values to parent nodes or even to the root of a formula.
