TextGrid Aggregator Service

Resources

TextGrid Aggregator Service

The Aggregator is a service to export and convert TextGrid documents. It is able to recursively process collections, editions, and other TextGrid aggregations.

Methods

/epub/{object}?stylesheet&title&sid&sandbox

resource-wide template parameters
parameter value description

object

string

The TextGrid URI(s) of the object(s) to convert, separated by commas. Should be either TEI objects or aggregations of TEI (and maybe other) objects

Methods

GET

Converts the given TEI object or the aggregation of TEI objects to an E-Book in EPUB format

request query parameters
parameter value description

stylesheet

URL of an alternative stylesheet to use. Must be compatible.

title

string

Title if multiple root objects given

sid

string

Session ID for accessing protected objects

sandbox

boolean

Also access sandboxed data

available response representations:

/help

Methods

GET

Returns an auto-generated help page summarizing all available arguments.

available response representations:

/html/{object}?stylesheet&pi&refreshStylesheet&sid&embedded&css&linkPattern&mediatype&id&simulate&toc&sandbox

resource-wide template parameters
parameter value description

object

string

The TextGrid URIs of the TEI document(s) or aggregation(s) to transform, separated by commas

Methods

GET

Generates HTML output. This is typically fast, and it is also used at textgridrep.de.

request query parameters
parameter value description

stylesheet

If given, an alternative XSLT stylesheet to use. Must be a textgrid URI.

pi

boolean

Default: true

If true, check for an <?xsl-stylesheet?> processing instruction in the document to render. Only textgrid: URIs will be resolved.

refreshStylesheet

boolean

If true and a stylesheet has been given, force reloading the stylesheet, do not cache

sid

string

Session ID to access protected resources

embedded

boolean

If true, an HTML fragment consisting of a <div class='body'> element containing the contents of the HTML <body> will be returned, ready to be embedded in an existing HTML page

css

URL of the CSS that should be referenced in the HTML that is created

linkPattern

string

URL pattern for links. @URI@ will be replaced with the textgrid: URI.

mediatype

string

The requested content type. E.g., text/html or text/xml

id

string

An XML ID. If given, only this element will be transformed.

simulate

boolean

Default: false

If true, a full webpage that looks similar to textgridrep.de's browse view will be returned

toc

string

If given, generate a table of contents instead of a full HTML document

sandbox

boolean

Also access sandboxed data

available response representations:

/pdf/{object}?sid

resource-wide template parameters
parameter value description

object

Methods

GET

(BROKEN) the PDF export will currently not work on any installed instance of the service.

request query parameters
parameter value description

sid

string

available response representations:

/teicorpus/{uris}?attach&flat&title&sid&sandbox

resource-wide template parameters
parameter value description

uris

string

TextGrid URIs of the root objects, separated by commas

Methods

GET

Creates a TEI corpus of all the TEI documents (recursively) aggregated by the given aggregation

request query parameters
parameter value description

attach

boolean

Default: true

Whether to generate a Content-Disposition: attachment header

flat

boolean

Default: false

If true, no intermediate TEI corpus documents will be generated for intermediate aggregations, hierarchical structure will be lost

title

string

Title for the container if multiple root objects are given

sid

string

Session id for accessing restricted resources

sandbox

boolean

Also access sandboxed data

available response representations:

/text/{object}?sid&sandbox

resource-wide template parameters
parameter value description

object

string

The TextGrid URIs of the TEI document(s) or aggregation(s) to transform, separated by commas

Methods

GET

Generates plain text output.

request query parameters
parameter value description

sid

string

Session ID to access protected resources

sandbox

boolean

Also access sandboxed data

available response representations:

/version

Methods

GET

Produces an HTML page containing version and configuration information for the service instance.

available response representations:

/zip/{objects}?sid&title&filenames&metanames&dirnames&only&meta&transform&query&filter&target&start&stop&stream&sandbox

resource-wide template parameters
parameter value description

objects

string

The TextGridURIs of the TEI documents or aggregations to zip, separated by commas (,)

Methods

GET

Creates a ZIP containing the specified objects and everything that has been aggregated by them, optionally transformed and filtered. Links within supported XML documents will be rewritten to relative URLs if the target document is also packed into this ZIP. This method may take quite a while depending on the number of objects, and it will not start returning something until the metadata for everything that will be exported has been collected, so increase your timeouts ...

request query parameters
parameter value description

sid

string

Session ID to access protected resources

title

string

(optional) title for the exported data, currently only used for generating the filename. If none is given, the first title of the first object will be used.

filenames

string

Default: {parent|/}{author}-{title}*.{ext}

Pattern for the generated filenames in the ZIP files.

metanames

string

Default: {filename}.meta

Pattern for the filenames for the metadata files in the ZIP files.

dirnames

string

Default: {parent|/}{title}*

Pattern for the directory names generated for aggregations etc. This pattern applied to the parent aggregation is available as {parent} in filenames and metanames.

only

string (repeating)

If at least one only parameter is given, restrict export to objects with the given MIME types

meta

boolean

Default: true

Include metadata and aggregation files in the ZIP file.

transform

string

(EXPERIMENTAL) Transform each XML document before zipping. Values currently available are text, html, or the textgrid: URI of an XSLT stylesheet.

query

string

(EXPERIMENTAL) perform the given TGsearch query and use its result as root objects instead of the objects.

filter

string (repeating)

for query: additional filters

target

string

Default: both

if query is used, the query target (metadata, fulltext or both)

start

int

Default: 0

for query: start at result no.

stop

int

Default: 65535

for query: max. number of results

stream

boolean

Default: true

if true, favor fast results over ideal rewriting

sandbox

boolean

Also access sandboxed data

available response representations:

Representations

application/epub+zip

text/html

text/html

Either an XHTML document (expect HTML5 elements), or a XHTML fragment containing only the body, if the embedded parameter is true.

application/pdf

application/tei+xml

TEI corpus document

text/plain

A plain text document.

text/html

application/zip

The ZIP file returned will usually contain a content document plus a sidecar .meta file for each exported object. The .meta file contains the raw metadata according to the TextGrid metadata schema. For aggregations (editions, collections), we will typically create both a directory and an ORE content file containing the list of items. Additionally, a file called /.INDEX.imex will be included in the archive. This file contains the list of exported objects together with the local filename, the name of the local .meta file, the link rewriting method used, and the original TextGrid URI. You can use this file to re-import the whole set of files using the TextGridLab. See the Link Rewriter Library's documentation for an XML schema and description of the format. The ZIP file may contain ZIP comments refering to warning or informational messages during export.