integrating web services into interactive mathematical documents

17
Introduction Architecture Web Services Conclusion Integrating Web Services into Interactive Mathematical Documents CIAO workshop 2009 Christoph Lange , Florian Rabe, Jana Giceva Jacobs University, Bremen, Germany KWARC – Knowledge Adaptation and Reasoning for Content April 2, 2009 Lange, Rabe, Giceva (Jacobs University) Integrating Web Services into Interactive Mathematical Documents April 2, 2009 1

Upload: christoph-lange

Post on 18-Nov-2014

978 views

Category:

Technology


3 download

DESCRIPTION

CIAO 2009

TRANSCRIPT

Page 1: Integrating Web Services into Interactive Mathematical Documents

Introduction Architecture Web Services Conclusion

Integrating Web Services into InteractiveMathematical Documents

CIAO workshop 2009

Christoph Lange, Florian Rabe, Jana Giceva

Jacobs University, Bremen, GermanyKWARC – Knowledge Adaptation and Reasoning for Content

April 2, 2009

Lange, Rabe, Giceva (Jacobs University) Integrating Web Services into Interactive Mathematical DocumentsApril 2, 2009 1

Page 2: Integrating Web Services into Interactive Mathematical Documents

Introduction Architecture Web Services Conclusion

Interactive Documents

Mathematical Documents are everywhere on the web (e. g.MathWorld, PlanetMath, Wikipedia, . . . )But they lack interactivity!Examples of interactive services:

Do not just get any document that is available on the server,but a document that is adapted to your preferences, previousknowledge, field of application, . . .Solve exercisesEvaluate/compute/check expressions

Lange, Rabe, Giceva (Jacobs University) Integrating Web Services into Interactive Mathematical DocumentsApril 2, 2009 2

Page 3: Integrating Web Services into Interactive Mathematical Documents

Introduction Architecture Web Services Conclusion

Mathematical Web Services

Services for . . .flexibly adapting documents to varying audienceschecking users’ solutions to exercisesevaluating expressions, solving problems

. . . are available (e. g. MONET), but accessible from documents?

Yes, sometimes, but not really easy to integrate; most of the timeonly used in their native environment

Lange, Rabe, Giceva (Jacobs University) Integrating Web Services into Interactive Mathematical DocumentsApril 2, 2009 3

Page 4: Integrating Web Services into Interactive Mathematical Documents

Introduction Architecture Web Services Conclusion

The (non-mathematical) Web 2.0

Asynchronous communication (AJAX): web applications thatfeel like desktop applications (rich, responsive widgets)Mashups: integrate services into documentsFirst prominent example: HousingMaps = Craig’s List housingads + Google Maps

So how about a mathematical Web 2.0 with mashups of web services?

Lange, Rabe, Giceva (Jacobs University) Integrating Web Services into Interactive Mathematical DocumentsApril 2, 2009 4

Page 5: Integrating Web Services into Interactive Mathematical Documents

Introduction Architecture Web Services Conclusion

JOBAD: An Architecture for InteractiveDocuments

JavaScript API for OMDoc-based Active Documentsintegrated backend or independent web services

XHTML+MathML+OpenMath, JavaScript

GUI

menu

mouse

actionobjects Services

foldinglayers

keybddefinitionlookup

notationselection

elision unitconversion

unitconverter

contentdictionaries

notationcollection

renderer

initially generates

Document

Client Modules

Web Services

Lange, Rabe, Giceva (Jacobs University) Integrating Web Services into Interactive Mathematical DocumentsApril 2, 2009 5

Page 6: Integrating Web Services into Interactive Mathematical Documents

Introduction Architecture Web Services Conclusion

A Document Format that Enables Services

Math markup on the web:MathML (W3C standard supported by Mozilla/Firefox andOpera), both presentational and semantic (“content”) markupWe enforce some underspecified aspects of the specification

Lange, Rabe, Giceva (Jacobs University) Integrating Web Services into Interactive Mathematical DocumentsApril 2, 2009 6

Page 7: Integrating Web Services into Interactive Mathematical Documents

Introduction Architecture Web Services Conclusion

Switching between Alternative Displays<OMATTR>

<OMATP><OMS cd=" f o l d i n g " name="abbrev "/>Wpot(R)

</OMATP>−e2

4πε0R/2</OMATTR>

renders as<mact ion a c t i o n t y p e="abbrev " s e l e c t i o n ="1">

−e24πε0R/2Wpot(R)

</maction>

Here: prepared by the author. But also: undo/redo of documentchanges by other servicesLange, Rabe, Giceva (Jacobs University) Integrating Web Services into Interactive Mathematical DocumentsApril 2, 2009 7

Page 8: Integrating Web Services into Interactive Mathematical Documents

Introduction Architecture Web Services Conclusion

Grouping Subterms for Interactive Folding

Same as before, but always available (<mactionactiontype="folding">)Example:[1 + [2 · x ]] ; [1 + . . . ]

Lange, Rabe, Giceva (Jacobs University) Integrating Web Services into Interactive Mathematical DocumentsApril 2, 2009 8

Page 9: Integrating Web Services into Interactive Mathematical Documents

Introduction Architecture Web Services Conclusion

Cross-Linked Parallel Markup

<semantics><!-- a+b 2 c --><mrow xref="#E"><mi xref="#E.1">a</mi><mo xref="#E.0">+</mo><mrow xref="#E.2">

<msup xref="#E.2.1">

<mi xref="#E.2.1.1">b</mi>

<mn xref="#E.2.1.2">2</mn>

</msup>

<mo xref="#E.2.0">&#x2062;

<!-- INVISIBLE TIMES -->

</mo>

<mi xref="#E.2.2">c</mi>

</mrow><mo xref="#E.0">+</mo><mi xref="#E.3">d</mi>

</mrow>

<annotation-xml encoding="OpenMath"><OMA id="E"><OMS cd="arith1" name="plus"id="E.0"/>

<OMV name="a" id="E.1"/><OMA id="E.2">

<OMS cd="arith1" name="times"

id="E.2.0"/>

<OMA id="E.2.1">

<OMS cd="arith1" name="power"

id="E.2.1.0"/>

<OMV name="b" id="E.2.1.1"/>

<OMI id="E.2.1.2">2</OMI>

</OMA>

<OMV name="c" id="E.2.2"/>

</OMA><OMV name="d" id="E.3"/>

</OMA></annotation-xml>

</semantics>Lange, Rabe, Giceva (Jacobs University) Integrating Web Services into Interactive Mathematical DocumentsApril 2, 2009 9

Page 10: Integrating Web Services into Interactive Mathematical Documents

Introduction Architecture Web Services Conclusion

Lightweight Annotations for Flexible Elisions

In general: leave out information that distracts the reader orthat doesn’t fit on the paperIn particular: redundant brackets around strong-bindingoperatorsBut what if the reader is not yet familiar with certain operators?⇒ make it interactive

<mact ion type=" e l i s i o n "><mspace/><mo f en c e=" t r u e " omdoc : egroup=" f en c e "omdoc : e l e v e l ="100">(</mo>

</maction>

Lange, Rabe, Giceva (Jacobs University) Integrating Web Services into Interactive Mathematical DocumentsApril 2, 2009 10

Page 11: Integrating Web Services into Interactive Mathematical Documents

Introduction Architecture Web Services Conclusion

Integrating Web Services

No fixed access pattern (REST vs. XML-RPC vs. SOAP), nofixed set of servicesThe server that serves a document is responsible for

advertising available servicesand shipping required JavaScript client code

<s c r i p t s rc=" . . / s c r i p t s / jobad . j s "/><s c r i p t type=" t e x t / j a v a s c r i p t ">j o b a d I n i t ( " contextmenu " ) ;j o b a d I n i t ( " e l i s i o n " ) ;j o b a d I n i t ( " d e f i n i t i o n −l ookup " , " Look up d e f i n i t i o n " ,

" h t tp : // jobad . mathweb . org / backend ? a c t i o n=d e f i n i t i o n −l ookup &cdbase=$cdbase&cd=$cd&name=$name" ) ;</ s c r i p t>

Lange, Rabe, Giceva (Jacobs University) Integrating Web Services into Interactive Mathematical DocumentsApril 2, 2009 11

Page 12: Integrating Web Services into Interactive Mathematical Documents

Introduction Architecture Web Services Conclusion

Rendering

Rendering as a service?! Shouldn’t you get that for free with anydocument?Prerequisite for making output from other serviceshuman-readable!content markup (OpenMath) → presentation markup(Presentation MathML)future work: more control over notation selection

Lange, Rabe, Giceva (Jacobs University) Integrating Web Services into Interactive Mathematical DocumentsApril 2, 2009 12

Page 13: Integrating Web Services into Interactive Mathematical Documents

Introduction Architecture Web Services Conclusion

Definition and Type Lookup

Input: ID of a symbol σ; output: content-markup definition (ortype declaration) of σ

Utilize HTTP content negotiation: request MIME typeapplication/xhtml+xml to get a rendered formulaAlternative: in-place expansion

Lange, Rabe, Giceva (Jacobs University) Integrating Web Services into Interactive Mathematical DocumentsApril 2, 2009 13

Page 14: Integrating Web Services into Interactive Mathematical Documents

Introduction Architecture Web Services Conclusion

Unit Conversion

Units in OpenMath: numbers multiplied with “unit symbols”(or arithmetic compositions of unit symbols, optionally with prefix)<OMA>

<OMS cd="arith1" name="times"/><OMI>1</OMI><OMS cd="units_metric1" name="metre"/>

</OMA>

OpenMath-based conversion service exists:Input: selected expression, target unit; output: convertedexpression (rendered)Future: preselect admissible conversions by client/servernegotiation

Lange, Rabe, Giceva (Jacobs University) Integrating Web Services into Interactive Mathematical DocumentsApril 2, 2009 14

Page 15: Integrating Web Services into Interactive Mathematical Documents

Introduction Architecture Web Services Conclusion

Integrated Backends

Theory: all services separate (clean conceptual model)Practice: multiple services in an integrated backend (moreefficient, both w. r. t. space and time)We are developing such integrated backends offering many (notall) services. The MMT system is one.

Lange, Rabe, Giceva (Jacobs University) Integrating Web Services into Interactive Mathematical DocumentsApril 2, 2009 15

Page 16: Integrating Web Services into Interactive Mathematical Documents

Introduction Architecture Web Services Conclusion

Conclusion

Architecture for interactive mathematical documentsReader can interactively adapt appearanceDocument interacts with web servicesKnowledge representation: MathML maxed out (but degradesgracefully)Initial set of local and remote services, server can advertieadditional servicesTry the demos at https://jomdoc.omdoc.org/wiki/JOBAD

Lange, Rabe, Giceva (Jacobs University) Integrating Web Services into Interactive Mathematical DocumentsApril 2, 2009 16

Page 17: Integrating Web Services into Interactive Mathematical Documents

Introduction Architecture Web Services Conclusion

Future WorkServices that we have thought about:

Notation selectionGuided tours (extension of lookup)Flattening (of theory imports)Search (this or similar formulae)Links to web resources (e. g. Wikipedia)Adaptive display of statement-level structures (proofs, rhetoricalstructures)EditingSaving (first adapt a document, then save that state on theserver)

Your wishes?Lange, Rabe, Giceva (Jacobs University) Integrating Web Services into Interactive Mathematical DocumentsApril 2, 2009 17