Workflow for services/documents

see also janta and  poster.

1. The user makes a request for some unique id services/documents/ID.ext
2. Get Document from DocumentCommons (DocumentCommons.getDoc(ID))
  if document not in document commons (DocumentDoesNotExist)
   Retrieve document from backend (Retriever.getDoc(ID))
   Add document to document commons (DocumentCommons.addDoc(document))
3. Set the corresponding notations
4. Convert to suitable format (*.ext)
5. Return the document to the user

Janta Components

  • DocumentCommons?: Handles the collection of documents in-memory; provides different methods, for adding and extracting data from these documents and to create new documents
  • ContentCommons?: handles a collection of interlinked knowledge units (Infoms), all Infoms have a globally unique ID
    • includes a ContentGraph?
    • includes a ContentContainer?
    • addInfom(Infom)*: adds the Infom's abs-ID/Category/Properties/Relations to the ContentGraph? and the Infom (XOM Element) to the ContentContainer?; extracts child-Infoms from nested Infoms and replaces these child-Infoms with include-references (includes)** in the nested Infom
    • getAbsoluteID(relative-ID): returns the absolute IDs, which are generated from the ID of the document and the relative-ID of the Infom: "doc-ID/Infom-ID" (there is a XOM method for this)
    • getInfom(ID): returns the Infom with ID from ContentContainer? (used for flattening a narrative structure into a document, all other methods only return IDs)
    • getInfomID(ID, Context): returns the identifier for the variant for Infom with ID that matches the given Context best; the context parameters are matched to the Infom's properties in the ContentGraph?
    • Future: getExamplesFor(ID,int): retrieves identifiers for int examples for the Infom with ID
    • Future: getAllExamplesFor(ID,int): retrieves identifiers for all examples for the Infom with ID
    • Future: more sophisticated queries
  • ContentGraph?: represents categories, properties, and interrelation of Infoms
    • addID(ID): adds the ID of the Infom to the ContentGraph?
    • addCategory(ID, Category): adds the Infom's category
    • addProperties(ID, properties): adds properties of an Infoms
    • addRelation(ID, relations): add relations to other Infoms
    • getCategory(Infom): returns the category of the Infom, in OMDoc the name or type attribute of the XML element representing the infom
    • getProperties(Infom): returns all properties, in OMDoc all XML attributes (including cross-references to other Infoms)
    • getRelation(Infom): returns all relations of the Infom to other Infoms, e.g. for Theories the method parses the theory's imports
  • ContentContainer?: a map of Infoms (XOM Elements)
    • addInfom(ID, Infom): adds the ID as key and the Infom as value
    • getInfom(ID): Retrieves the Infom with ID and flattens it
    • flattenInfom(ID): replaces include-references (includes)** in the Infom with the referenced Infoms; returning a self-contained Infom with no include-references
  • Infom: XOM Element, any non-narrative element of a document (Theory or Statement, e.g. example, proof, definition, omtext, symbol, formulae, ...), NotationDefinitions? are not Infom, variants are not Infoms as they do not represent information of the documents but relations between Infoms
    • upper-level Infom: Are all Infoms that are retrieved without parsing nested Infoms; Infoms cannot include NarrativeStructures?
    • nested Infom: An infom that includes other Infoms, e.g. a theory can include example, definitions, ... , currently we do not go below statement level, e.g. we do not consider an example with a formulae as nested
    • a self-contained Infom, an Infom without include-references

  • Context: a list of key-value pairs, see JOMDoc
  • Retriever: retrieves a document from the backend (file or InputStream?)
    • getDoc(ID): retrieves the document and returns the XOM Document
  • FormatRender?: converts document into suitable XML format; is configure with format options (the optional extension of the ID in the request); currently we only support *.xhtml

(* No change management: Integration of documents into document commons is trivial. We only add documents, no cross-reference are constructured, no equalities are considered, no merging.

(** include-references (include) are represented by ref-elements in OMDoc, the replacing of includes with Infoms (called flattening or ref-contraction) and replacing of Infoms with includes (ref-expansion) is supported by JOMDoc