Annotation Management
The Annotation Back-End (ABE) service manages the entire life-cycle of annotation relationships between information objects, from their creation and collation to their retrieval, update, and deletion, independently from application-specific models of annotation content.
Clients may interact with the ABE service through a standard library of stubs generated automatically from the public service interfaces. They may also do so at a higher level of abstraction through the Annotation Back-end Library, an extension of the stub library which simplifies clients interaction with the service.
Contents
Annotation Relationships
Annotation relationships are specialisations of metadata relationships that give target objects the broad semantic of subjective and contextual assertions about source objects. More formally, annotation relationships are binary relationships with primary role is-described-by and secondary role is-annotated-by (IAB).
As specializations of metadata relationships, annotation relationships inherit all their properties:
- they are exclusive on their targets but repeatable on their sources: an annotation describes one and only one object even though the number of annotations for any given object may be unbounded;
- they preserve membership: an annotation belongs to a collection if and only if the annotated object does.
Annotation relationships induce a related specialization of the notion of collection: a collection is an annotation collection if it is a metadata collection of type IAB
. More formally, A
is an annotation collection for C
if:
-
A
is anIAB
-collection in the scope ofC
; - all the members of
A
are annotations of members ofC
, and -
A
is an annotation ofC
.
The definition of annotation relationships and annotation collections – as well as the relationships between these definitions and more generic notions in the gCube Information Model can be graphically illustrated as follows:
Annotation Model
The ABE service and library adopt a model of annotation content that is suitable for the exchange of potentially very heterogeneous annotations. In particular, the ABE exchange model complements arbitrary, application-specific notions of annotations with a small number of system-level and application-independent properties.
The model is defined in terms of XML serialisations of annotations and is in itself an extension of the exchange model adopted by Metadata Management services. In particular, it follows the same design pattern of grouping system-level properties into a header element and application-defined properties into a body element. The model is formally defined by the following schema:
<?xml version="1.0" encoding="UTF-8"?> <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://gcube-system.org/namespaces/annotationmanagement/abe/model" targetNamespace="http://gcube-system.org/namespaces/annotationmanagement/abe/model" elementFormDefault="qualified" attributeFormDefault="unqualified"> <xsd:import namespace="http://gcube-system.org/namespaces/metadatamanagement/mm/model"/> <xsd:element name="annotation" type="tns:annotationType"/> <xsd:complexType name="annotationType"> <xsd:sequence> <xsd:element name="header" type="tns:headerType" /> <xsd:element name="body" type="tns:bodyType" /> </xsd:sequence> </xsd:complexType> <xsd:complexType name="headerType"> <xsd:sequence> <xsd:element name="previous" type="xsd:string" minOccurs="0"/> </xsd:sequence> </xsd:complexType> <xsd:complexType name="bodyType"> <xsd:sequence> <xsd:any namespace="##other" processContents="lax"/> </xsd:sequence> </xsd:complexType> </xsd:schema>
Architecture
Within the gCube architecture, the ABE service is placed at the top of a stack of Information Organisation services, from Storage Management services to Content Management services and Metadata Management services. Its main role within the stack is one of mediation between the users of Information Presentation services and Metadata Management services one step below. In this role, the value it offers to its clients is one of specialisation and transparent aggregation of functionality available more generically for the management of metadata objects.
Design
The design of the service is distributed across three port-types: the Manager
, the Broker
, and the </code>Factory</code>.
Managers
The Manager
port-type manages annotations of objects which belong to a target collection. It is the preferred point of contact for clients that:
- wish to work with such annotations regardless of the annotation collections to which individual annotations belong;
- wish to work with annotations which belong to specific annotation collections.
Clients may create annotation collections for the target collection, and then add, update, retrieve or delete annotation from them. These operations map directly onto equivalent operations of the Metadata Management service and are offered to present a single point of contact for annotations. Clients may also retrieve annotations across multiple annotation collections, though of course no write operation is offered at this level of abstraction.
All operations process and produce bulk data to avoid the latency of finer-grained interactions. Similarly, all operations are conceptually overloaded to work either by-value – inputs and outputs are entirely included in message payloads – or else by-reference – input and outputs are throttled in ‘pages’ using the resultset abstraction. Finally, all operations are tolerant to fine-grained failures, through they record them and then report them as return values.
The Manager
is stateful, in that it maintains (in memory and on the local file system) summary information about the annotation collections of target collections. The information is grouped under local ‘proxies’ of the target collections, and the proxies are bound to the port-type interface on a per-request basis, in line with the implied resource pattern of WSRF. In particular, the pairing of the Manager
interface and collection proxies identifies WS-Resources informally referred to as Managers.
Managers are created in response to client requests to the Factory
[[#The Factory|port-type]. At the time and within the scope of their creation, a selection of the state of Managers is published in the Information System. In WSRF terminology, these are the Resource Properties that identify the target collection and their annotation collections and by which Managers can be discovered by clients.
Following publication, Managers are kept up-to-date with respect to the creation and deletion of annotation collections which do not occur through interaction with the Managers themselves. This form of maintenance is achieved by polling the Information System at regular intervals. During their lifetime, Managers satisfy client requests by interacting with WS-Resources and Running Instances of the Metadata Manager service. The interactions are based on best-effort and caching strategies.
Brokers
The Broker
port-type manages annotations of objects which belong to either one of a number of target collections. Clients may retrieve annotations for these objects regardless of the collections to which the objects or their annotations belong. For example, the Broker
is the recommended point of contact for clients that wish to browse the annotations of the results of a distributed search. Clients may also narrow their interaction to single target collections by obtaining a reference to dedicated Managers.
Like for Managers, the operations of the ,Broker
operate in bulk, either by-value or by-reference, and report fine-grained failures within return values. Similarly, the Broker
is stateful and its state is an aggregation of the state of the Manager
. In particular the local ‘collection proxies’ of Managers are grouped in collection sets, and then collections sets are bound to the Broker
into WS-Resources informally called Brokers.
Like Managers, Brokers are created by the Factory
[[#The Factory|port-type] persisted and publish the identifiers of the target collections in the bound set as a Resource Property. During their lifetime, Brokers also interact with WS-Resources and Running Instances of the Metadata Manager service. The interactions, however, occur indirectly, in that they are delegated to Managers dedicated to the collections in the collection set.
The Factory
The Factory
is the point of contact to the ABE for clients that wish to create Managers and Brokers for one or more target collections, starting from their public identifiers. In this role, it is stateless.
The ABE Library
The library offers a number of facilities for interacting with the port-types and WS-Resources of the ABE service.
First of all, it encapsulates stub-based interaction behind a local object-oriented interface. The interface is distributed across a set of classes which model remote port-types (AnnotationManager, AnnotationBroker) and related state abstractions (Collection
, AnnotationCollection
), or else manage configuration aspects of the interaction with the ABE, such as scope and security(AnnotationContext
).
Throughout, the library makes use of language features which are not found in the stubs automatically generated from the remote interfaces, including high-level models of inputs and outputs, method overloading, and parametric type-checking. Behind these abstractions, the library engages in optimised and best-effort interactions with factory and WS-Resources of the ABE service. In particular, it hides from clients the discovery or creation of WS-Resources, but not the existence of remote interactions and the possibility of their failure.
In addition, the library offers convenient object bindings for the XML representations of annotations that are required by the remote interface in input or produced by it in output. Clients that wish to do so can model annotations as objects with the advantages of expressiveness and early type checking which normally characterise data binding solutions. Bindings occurs within an extensible framework defined by a root class (BaseAnnotation
) that can be extended by classes which model particular types of annotations. In particular, the root class defines the protocol that subclasses implement to serialise their ‘body’ to and from the exchange model. The framework is built atop analogous frameworks offered by Metadata and ResultSet libraries, so that annotations are transparently suitable for use as generic metadata objects and as records of a resultset.
When it comes to actually manipulate annotations, the library provides annotation buffering so as to mediate between the fine-grained nature of operations in interactive sessions and the coarse-grained nature of interaction with the remote port-types. This may enable responsive user interfaces by concentrating bulk network interactions at distinguished 'commit' points which are entirely under client control. Specifically, clients that retrieve annotations from managers or brokers transparently fill buffers specific to individual annotation collections. They can then modify the buffered annotations locally for maximum responsiveness and commit the changes remotely before filling the buffer with the next retrieval operation.
Finally, the library offers built-in support for linking annotations of the same object into 'threads' similar to those typically formed by postings in mailing lists and discussion forums, or those associated with chains of versions.
Sample Usage
Interaction with the ABE service may be illustrated with some code samples. The samples are based on the ABE library, partly because it is the recommended way to interact with the service and partly because the use of plain stubs ought to be immediate from the documentation of the code.
THIS SECTION OF GCUBE DOCUMENTATION IS CURRENTLY UNDER UPDATE.