Processing and Publishing Content Math with
            JOMDoc and JOBAD
                 Content Math Training Camp 2010


                           Christoph Lange

                      Jacobs University, Bremen, Germany
            KWARC – Knowledge Adaptation and Reasoning for Content


                              July 07, 2010




      Lange (Jacobs)               Processing and Publishing Content Math with JOMDoc and JOBAD
                                                                                    July 07, 2010   1/14
JOMDoc – Java API (not only) for OMDoc

http://jomdoc.omdoc.org (maintainer: Vyacheslav Zholudev) – a
library of 300+ Java classes featuring . . .
     Java object model (one class per XML element) for OMDoc (and
     MathML and OpenMath for formulæ), plus many other services:
     Schema validation
     Renderer: OpenMath/Content MathML → Presentation MathML
     (pattern-matching XML notation definitions), context-sensitive
     Rest of OMDoc → XHTML+RDFa (XSLT)
     Document restructuring: e. g. flattening/modularizing
     documents



          Lange (Jacobs)      Processing and Publishing Content Math with JOMDoc and JOBAD
                                                                               July 07, 2010   2/14
How to use JOMDoc


Download or check out from http://jomdoc.omdoc.org
   Binary distribution
         JAR file ready for inclusion into Java projects
         executable shell script for validation, rendering, document
         restructuring
         GUI frontend for rendering
    Source code (Eclipse-ready)
Contribute: Trac project management site, mailing list




          Lange (Jacobs)         Processing and Publishing Content Math with JOMDoc and JOBAD
                                                                                  July 07, 2010   3/14
JOMDoc’s Notation Definitions
<notation>
  <prototype> <!-- the content markup pattern -->
    <om:OMA>
      <om:OMS cd="arith1" name="divide"/>
      <expr name="arg1"/>
      <expr name="arg2"/>
    </om:OMA>
  </prototype>
  <rendering> <!-- the presentation markup fragment -->
    <m:mfrac>
      <render name="arg1"/>
      <render name="arg2"/>
    </m:mfrac>
  </rendering>
</notation>

                               render(a)
render(divide(a, b))           render(b)

              Lange (Jacobs)               Processing and Publishing Content Math with JOMDoc and JOBAD
                                                                                            July 07, 2010   4/14
Applications using JOMDoc



   TNTBase (→ other talk): versioned XML database with special
   services for OMDoc
   SWiM (semantic wiki powering http://wiki.openmath.org)
   Urs Holzer’s Gemse (MathML editor): Content MathML →
   Presentation MathML preview




        Lange (Jacobs)      Processing and Publishing Content Math with JOMDoc and JOBAD
                                                                             July 07, 2010   5/14
JOBAD – Interactive Documents


Now we can render OMDoc documents – let’s make them
interactive!
     On-demand adaptation to the user’s presentation preferences
     (e. g. brackets, notation)
     On-demand information lookup without leaving the document
JOBAD, the JavaScript API for OMDoc-based Interactive Documents
http://jomdoc.omdoc.org/wiki/JOBAD (maintainer: Christoph
Lange)




          Lange (Jacobs)     Processing and Publishing Content Math with JOMDoc and JOBAD
                                                                              July 07, 2010   6/14
JOBAD Architecture
                                                  integrated backend
           external services or data   (MMT: logics; TNTBase: lecture notes; …)
             ext. repositories
                                                                                            initially
             Wolfram|Alpha                      ontology/               notation            generates
   Web                                          definitions            collection
                other CAS
Services
              unit converter
                                                proxy                 renderer
               linked data
               … others …

               menu layers         folding/       computation/               definition
              mouse keybd          visibility       rewriting                 lookup
   Client
 Modules                        action
                      GUI       objects                   Services

Document                XHTML+MathML+OpenMath, JavaScript
      (dashed lines denote old services being ported or new services being developed)
            Lange (Jacobs)                Processing and Publishing Content Math with JOMDoc and JOBAD
                                                                                           July 07, 2010   7/14
JOBAD – Customizing Display




       Lange (Jacobs)   Processing and Publishing Content Math with JOMDoc and JOBAD
                                                                         July 07, 2010   8/14
JOBAD – Looking up Information (1)




       Lange (Jacobs)   Processing and Publishing Content Math with JOMDoc and JOBAD
                                                                         July 07, 2010   9/14
JOBAD – Looking up Information (2)




       Lange (Jacobs)   Processing and Publishing Content Math with JOMDoc and JOBAD
                                                                         July 07, 2010   10/14
JOBAD – Rewriting the Document (Unit
Conversion)




       Lange (Jacobs)   Processing and Publishing Content Math with JOMDoc and JOBAD
                                                                         July 07, 2010   11/14
JOBAD – Local Discussion Forums




       Lange (Jacobs)   Processing and Publishing Content Math with JOMDoc and JOBAD
                                                                         July 07, 2010   12/14
TNTBase + JOMDoc + JOBAD Integrated




(JOMDoc rendering XHTML+MathML+RDFa, JOBAD providing
definition lookup and semantic navigation)

        Lange (Jacobs)    Processing and Publishing Content Math with JOMDoc and JOBAD
                                                                           July 07, 2010   13/14
Conclusion



 JOMDoc: Java API and command line for validating, rendering,
         transforming, etc. OMDoc and other Content Math –
           http://jomdoc.omdoc.org
  JOBAD: JavaScript-based architecture for integrating services
         into interactive documents –
           http://jomdoc.omdoc.org/wiki/JOBAD




        Lange (Jacobs)      Processing and Publishing Content Math with JOMDoc and JOBAD
                                                                             July 07, 2010   14/14

Processing and Publishing Content Math with JOMDoc and JOBAD

  • 1.
    Processing and PublishingContent Math with JOMDoc and JOBAD Content Math Training Camp 2010 Christoph Lange Jacobs University, Bremen, Germany KWARC – Knowledge Adaptation and Reasoning for Content July 07, 2010 Lange (Jacobs) Processing and Publishing Content Math with JOMDoc and JOBAD July 07, 2010 1/14
  • 2.
    JOMDoc – JavaAPI (not only) for OMDoc http://jomdoc.omdoc.org (maintainer: Vyacheslav Zholudev) – a library of 300+ Java classes featuring . . . Java object model (one class per XML element) for OMDoc (and MathML and OpenMath for formulæ), plus many other services: Schema validation Renderer: OpenMath/Content MathML → Presentation MathML (pattern-matching XML notation definitions), context-sensitive Rest of OMDoc → XHTML+RDFa (XSLT) Document restructuring: e. g. flattening/modularizing documents Lange (Jacobs) Processing and Publishing Content Math with JOMDoc and JOBAD July 07, 2010 2/14
  • 3.
    How to useJOMDoc Download or check out from http://jomdoc.omdoc.org Binary distribution JAR file ready for inclusion into Java projects executable shell script for validation, rendering, document restructuring GUI frontend for rendering Source code (Eclipse-ready) Contribute: Trac project management site, mailing list Lange (Jacobs) Processing and Publishing Content Math with JOMDoc and JOBAD July 07, 2010 3/14
  • 4.
    JOMDoc’s Notation Definitions <notation> <prototype> <!-- the content markup pattern --> <om:OMA> <om:OMS cd="arith1" name="divide"/> <expr name="arg1"/> <expr name="arg2"/> </om:OMA> </prototype> <rendering> <!-- the presentation markup fragment --> <m:mfrac> <render name="arg1"/> <render name="arg2"/> </m:mfrac> </rendering> </notation> render(a) render(divide(a, b)) render(b) Lange (Jacobs) Processing and Publishing Content Math with JOMDoc and JOBAD July 07, 2010 4/14
  • 5.
    Applications using JOMDoc TNTBase (→ other talk): versioned XML database with special services for OMDoc SWiM (semantic wiki powering http://wiki.openmath.org) Urs Holzer’s Gemse (MathML editor): Content MathML → Presentation MathML preview Lange (Jacobs) Processing and Publishing Content Math with JOMDoc and JOBAD July 07, 2010 5/14
  • 6.
    JOBAD – InteractiveDocuments Now we can render OMDoc documents – let’s make them interactive! On-demand adaptation to the user’s presentation preferences (e. g. brackets, notation) On-demand information lookup without leaving the document JOBAD, the JavaScript API for OMDoc-based Interactive Documents http://jomdoc.omdoc.org/wiki/JOBAD (maintainer: Christoph Lange) Lange (Jacobs) Processing and Publishing Content Math with JOMDoc and JOBAD July 07, 2010 6/14
  • 7.
    JOBAD Architecture integrated backend external services or data (MMT: logics; TNTBase: lecture notes; …) ext. repositories initially Wolfram|Alpha ontology/ notation generates Web definitions collection other CAS Services unit converter proxy renderer linked data … others … menu layers folding/ computation/ definition mouse keybd visibility rewriting lookup Client Modules action GUI objects Services Document XHTML+MathML+OpenMath, JavaScript (dashed lines denote old services being ported or new services being developed) Lange (Jacobs) Processing and Publishing Content Math with JOMDoc and JOBAD July 07, 2010 7/14
  • 8.
    JOBAD – CustomizingDisplay Lange (Jacobs) Processing and Publishing Content Math with JOMDoc and JOBAD July 07, 2010 8/14
  • 9.
    JOBAD – Lookingup Information (1) Lange (Jacobs) Processing and Publishing Content Math with JOMDoc and JOBAD July 07, 2010 9/14
  • 10.
    JOBAD – Lookingup Information (2) Lange (Jacobs) Processing and Publishing Content Math with JOMDoc and JOBAD July 07, 2010 10/14
  • 11.
    JOBAD – Rewritingthe Document (Unit Conversion) Lange (Jacobs) Processing and Publishing Content Math with JOMDoc and JOBAD July 07, 2010 11/14
  • 12.
    JOBAD – LocalDiscussion Forums Lange (Jacobs) Processing and Publishing Content Math with JOMDoc and JOBAD July 07, 2010 12/14
  • 13.
    TNTBase + JOMDoc+ JOBAD Integrated (JOMDoc rendering XHTML+MathML+RDFa, JOBAD providing definition lookup and semantic navigation) Lange (Jacobs) Processing and Publishing Content Math with JOMDoc and JOBAD July 07, 2010 13/14
  • 14.
    Conclusion JOMDoc: JavaAPI and command line for validating, rendering, transforming, etc. OMDoc and other Content Math – http://jomdoc.omdoc.org JOBAD: JavaScript-based architecture for integrating services into interactive documents – http://jomdoc.omdoc.org/wiki/JOBAD Lange (Jacobs) Processing and Publishing Content Math with JOMDoc and JOBAD July 07, 2010 14/14