Skip to content

Allow annotation stores to include/depend on other annotation stores (stand-off STAM JSON files) #29

@proycon

Description

@proycon

Currently an annotation store in STAM JSON can reference annotation datasets
and resources in separate stand-off files. What is not yet possible, however,
is to reference annotations defined in other STAM JSON annotation stores.

This use-case was raised in #21 by @tenzin3, see the lead up discussion there.

In such a case, an annotation in store_a.store.stam.json makes reference (via
an annotation selector) to an annotation defined in store_b.store.stam.json.
That is currently not possible. I do think it is a fair use case and more
flexibility in using stand-off files fits nicely with STAM's stand-off
philosophy.

This issue proposes to expand the STAM model to allow this:

  • The @include mechanism in STAM JSON would be extended to allow including
    other annotation stores. In effect, an annotation store can then depend
    on on another by importing it, these includes are executed before loading any of its own annotations.
    Recursive includes would be allowed (allowing more complex dependency chains),
    but cyclic includes would be explicitly forbidden! Includes may (and are in fact encouraged to) reference the same
    stand-off resources and annotation data sets.

Possible syntax for this:

{
    "@type":"AnnotationStore",
    "@include": [ "store_b.stam.store.json", "store_c.stam.store.json" ],
    ...
}
  • On the implementation-side, when loaded into memory there is still always one
    AnnotationStore instance to work with at any given time. This would
    however serialize to multiple files. This requires some extra bookkeeping
    to be implemented, as for each annotation we need to know to what
    annotation store it should go. The implementation might define
    'substores' and keep map filenames to lists of annotation handles.
    This new bookkeeping would at the same time make splitting stores easier
    than it is in the currently implementation (where splitting is basically a fairly expensive deletion action).
    Merging and splitting becomes more reversible.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or requestreadyImplemented, pending release

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions