Menu

Publication API Structures

Eric Smith

Draft 2014-11-19

Basic Types

ID

An integer serving as the primary key of a table.

Target URI

Within Tradamus, each entity can be uniquely identified by means of a URI-like string (e.g. "edition/2" or "annotation/1234").

In some cases, these URIs may include a fragment to further specify the target. Thus, "parallel/11#3" specifies to the portion of "parallel/11" which draws from "witness/3". For a Canvas-targetted annotation, the fragment can specify the portion of the Canvas which is targetted (e.g. "canvas/12#xywh=10,10,320,240" to target a rectangular area within "canvas/12").

Publication

The highest-level object within the publication API. Represents the published form of an Edition.

{
   "id": ID,
   "edition": ID of Edition,
   "title": string,
   "type": "PDF", "TEI", "DYNAMIC", "OAC", or "XML",
   "creator": User ID,
   "creation": timestamp,
   "modification": timestamp,
   "sections": array of Section IDs
   "permissions": array of long-form Permissions
}

Section

Main level of organisation within a Publication. In its simplest form, represents a chapter, but there are also more specialised Section types such as indices and tables of contents.

{
   "id": ID,
   "publication": ID of Publication,
   "title": string,
   "type": "TEXT", "ENDNOTE", "FOOTNOTE", "INDEX", or "TABLE_OF_CONTENTS",
   "index": integer, index of Section within its Publication
   "decoration": array of Rule objects,
   "layout": array of Rule objects,
   "sources": array of Outline IDs,
   "template": string
}

Rule

A transformation rule which includes a selector (typically a set of tags or annotation types), and an action which is performed on all annotations which match said condition. The simplest case of an action would be a CSS rule, but an action could be any sort of instruction which is meaningful to the front-end publication module.

{
   "id": ID,
   "section": ID of Section,
   "selector": string,
   "action": string
}


Related

Wiki: Technical

MongoDB Logo MongoDB