Skip to content

Metanorma collections

Nick Nicholas edited this page Sep 24, 2020 · 7 revisions

(This is WIP)

We will build up a rudimentary metanorma collection model, and then add features as we need it.

A Metanorma collection has the following grammar:

(flavour)-collection = element (flavour)-collection {
  bibdata,
  manifest,
  prefatory-content?,
  doc-container*
  final-content?
}

bibdata = element bibdata {
/* assume for now same content as in metanorma */
}

manifest = element manifest {
   element level {text}, /* e.g. "volume", "collection", "series" */
   element title {text}?,
   docref*,
   manifest*
}

docref = element docref {
  attribute fileref { text }?,   /* relative URI path */
  attribute id { xsd:IDREF }?,   /* anchor within this document */
  element identifier { text }    /* human identifier */
}

doc-container = element doc-container {
   attribute id { xsd:ID },
  (flavour)-standard
}

prefatory-content = element prefatory-content {
   clause+
}

final-content = element final-content {
   clause+
}

We are constraining metanorma collections to be flavour-specific.

Documents may be included in the collection object, or they may be referenced externally.

The manifest is a recursive arrangement of document references. Each document reference is either to an external file (with relative path; we would encourage a flat folder structure, for each of processing), or else to an internal doc-container identified by ID. (We wrap metanorma documents in doc-container so we don’t have to add ID anchors to metanorma roots.) There may be collection-specific attributes of documents that are not meant to be present in the standalone document; they should go inside docref.

Cross-references to other documents in the same collection will use the syntax * [[[myanchor,repo:(myrepo/mydoc)]]], as proposed in https://github.com/metanorma/metanorma/issues/57; myrepo shall be the special value "current-metanorma-collection", and mydoc shall be the value of docref/identifier corresponding to the target document.

docid is currently mandatory in the manifest: it’s how we identify the document type for the collection.