Skip to main content

UIMA/CAS (Apache)

Overview

UIMA is a framework for building text analytics pipelines. The Common Analysis Structure (CAS) is its data model: a typed feature structure system where all annotations are subtypes of a base Annotation type that spans a region of a Subject of Analysis (SofA). UIMA provides type system inheritance, multiple views (SofAs), and index-based retrieval. WebAnno and INCEpTION are built on UIMA.

Type-by-Type Mapping

Core CAS Architecture

UIMA/CAS ConceptLayers EquivalentNotes
CAS (document container)pub.layers.expression (record)The CAS contains one or more SofAs plus all annotations. A Layers expression is the equivalent root container.
SofA (Subject of Analysis)pub.layers.expression.text + pub.layers.mediaUIMA supports multiple SofAs (e.g., original text + translation + audio). Layers handles this with separate expression records linked by pub.layers.alignment for parallel text, and mediaRef for multimedia.
View (named perspective)pub.layers.persona + separate annotation layersUIMA views partition annotations by perspective. Layers achieves this through persona-specific annotation layers with metadata.personaRef.
Type Systempub.layers.ontologyUIMA's type system descriptor defines annotation types with inheritance. Layers's ontology with typeDef and parentTypeRef provides equivalent type hierarchies.
Typepub.layers.ontology#typeDefA named type with features and parent type. typeKind + allowedRoles + allowedValues cover UIMA's feature declarations.
Feature (on a type)pub.layers.ontology#roleSlot + typeDef.allowedValuesUIMA features on types (e.g., entityType feature on NamedEntity type) map to role slots or allowed values on type definitions.
Annotation (base type)pub.layers.annotation#annotationThe base UIMA Annotation type has begin, end (character offsets) and a reference to its SofA. Layers's annotation has anchor.textSpan (begin/end) and the layer references an expression.
AnnotationBasepub.layers.annotation#annotationCommon fields: uuid, confidence, features.

UIMA Built-in Types

UIMA TypeLayers EquivalentNotes
uima.tcas.Annotationpub.layers.annotation#annotationBase annotation with span.
uima.tcas.DocumentAnnotationpub.layers.expressionDocument-level metadata.
uima.cas.TOPNo direct equivalent neededRoot of type hierarchy — implicit in Layers.
uima.cas.AnnotationBasepub.layers.annotation#annotationBase for all annotations.
uima.cas.FSArrayannotation.childIds or argumentRef[]Feature structure arrays.
uima.cas.StringList/IntegerListpub.layers.defs#featureMapTyped lists in features.

WebAnno/INCEpTION Annotation Types

These UIMA-based tools define standard annotation layers:

WebAnno/INCEpTION TypeLayers EquivalentNotes
de.tudarmstadt.ukp.dkpro.core.api.lexmorph.type.pos.POSannotationLayer(kind="token-tag", subkind="pos")POS tagging layer.
de.tudarmstadt.ukp.dkpro.core.api.ner.type.NamedEntityannotationLayer(kind="span", subkind="entity-mention")NER layer.
de.tudarmstadt.ukp.dkpro.core.api.syntax.type.dependency.DependencyannotationLayer(kind="graph", subkind="dependency")Dependency parsing.
de.tudarmstadt.ukp.dkpro.core.api.coref.type.CoreferenceChainclusterSet(kind="coreference")Coreference chains.
webanno.custom.* (user-defined layers)annotationLayer with custom kind/subkind via kindUriWebAnno allows custom annotation layers. Layers supports this through community-expandable kind/subkind via the URI+slug pattern.

UIMA Pipeline Architecture

UIMA ConceptLayers EquivalentNotes
Analysis Enginepub.layers.defs#annotationMetadata.toolThe producing tool/model is recorded in metadata.
Collection ReaderFirehose consumerLayers reads from the ATProto relay firehose instead of UIMA collection readers.
CAS ConsumerAppview indexerThe Layers appview indexes annotation records from the firehose.
Type PriorityAnnotation layer orderingLayers layers can reference each other via parentLayerRef for dependency ordering.
IndexAppview database indexesLayers delegates indexing to the appview's PostgreSQL/Elasticsearch/Neo4j stores.

UIMA Feature Structures

UIMA FS ConceptLayers EquivalentNotes
Feature structurepub.layers.defs#featureMapKey-value pairs on annotations.
Typed featurepub.layers.defs#feature (key + value)UIMA features are typed (String, Integer, etc.); Layers features are string-encoded with consumer-side parsing.
Feature structure inheritancepub.layers.ontology#typeDef.parentTypeRefType inheritance in the ontology system.
Range typepub.layers.ontology#roleSlot.fillerTypeRefsConstraints on what types a feature can hold.