Class Relation

  • All Implemented Interfaces:
    Serializable

    public final class Relation
    extends Object
    implements Serializable

    Relations provide a mechanism to link two Annotations. Relations are directional, i.e. they have a source and a target, and form a directed graph between annotations on the document. Relations can represent any type of link, but often represent syntactic (e.g. dependency relations), semantic (e.g. semantic roles), or pragmatic (e.g. dialog acts) information. Relations, like attributes, are stored as key value pairs with the key being the RelationType and the value being a String representing the label. Relations are associated with individual annotations (i.e. tokens for dependency relations, entities for co-reference).

    Author:
    David B. Bracewell
    See Also:
    Serialized Form
    • Constructor Detail

      • Relation

        public Relation​(@NonNull
                        @NonNull RelationType type,
                        @NonNull
                        @NonNull String value,
                        long target)
        Instantiates a new Relation.
        Parameters:
        type - the relation type
        value - the relation value
        target - the id of the target relation
    • Method Detail

      • getTarget

        public Annotation getTarget​(@NonNull
                                    @NonNull HString hString)
        Gets the target of the relation.
        Parameters:
        hString - the HString to use identify the target annotation.
        Returns:
        the target annotation.