Common Analysis System(CAS) Interfaces

## Common Analysis System (CAS) Interfaces

The CAS provides

- a set of methods for creating Feature Structures and setting / getting their Feature values, based on parameters referencing Types and Features.
- a link to the type system being used
- a container for the set of one or more "Views" - each view corresponding to a separate set of indexes, contained in a index repository. These indexes can be used to retrieve the Feature Structures that have already been created.
  - For each view:
    - a link to the indexes used to index Feature Structures
    - information about that view's (optional) Subject of Analysis (SofA).
    - convenience methods for adding Feature Structures to the view's indexes

### Type System

The Type System is a collection of types and features of each type, where the types are in a single type hierarchy. The type/feature information is collected from possibly multiple annotators that make up a UIMA pipeline, and the definitions are merged.

## Index Repository

Indexes provide a way to access those Feature Structures which have been indexed (added to the index, and not subsequently removed). Each CAS view has a separate set of indexes.

- FSIndexRepository - UIMA pipelines specify a set of index definitions to be used; these definitions are used for all views. In addition to user-specified indexes, there are two built-in indexes: the Annotation Index, and a default "bag" index that is used whenever no other index is defined, to enable retrieval of all indexed Feature Structures. When users add instances to the indexes, they do so for the indexes in just one view. Users may choose to index the same Feature Structure in multiple views, with one restriction: Feature Structures which are subtypes of AnnotationBase may only be added to the view where the Feature Structure was created. The FSIndexRepository instance per view allows access to the Feature Structures indexed in that view.
- FSIndex - represents a particular index over a type and its subtypes. There are three underlying kinds of indexes: Bag, Set, and Sorted. The Set and Sorted include a "comparator" which defines a compare order which is also used as the definition of "equal" for Sets.

### Built-in Feature Structure classes

This package holds the definition for many of the built-in Feature Structures.

The following classes are alternate interfaces for built-in Feature Structures; they remain for backwards compatibility.org.apache.uima.cas

alternate interfaces
UIMA v2 name org.apache.uima.cas | preferred org.apache.uima.jcas.cas
BooleanArrayFS | BooleanArray
ByteArrayFS | ByteArray
ShortArrayFS | ShortArray
IntegerArrayFS | IntegerArray
FloatArrayFS | FloatArray
LongArrayFS | LongArray
DoubleArrayFS | DoubleArray
SofaFS | Sofa
AnnotationBaseFS | AnnotationBase

### Constraints - used by filtered iterators

Iterators may be filtered, using constraints, specified using these interfaces.

- ConstraintFactor
- FeaturePath
- FeatureValuePath
- FSBooleanConstraint
- FSConstraint
- FSFloatConstraint
- FSIntConstraint
- FSMatchConstraint
- FSStringConstraint
- FSTypeConstraint

### Exception collections

Many of the exceptions that UIMA may throw are collected into groups here. These classes provide one level of indirection that permit IDE environments to conveniently locate and work with these.

exceptions
| Extends
CASException | UIMAException (checked)
CASRuntimeException | UIMARuntimeException