public class AnnotationQuery extends Object implements QueryNode
Modifier and Type | Class and Description |
---|---|
static class |
AnnotationQuery.AnnotationQueryExecutor |
Constructor and Description |
---|
AnnotationQuery(String annotationType,
List<Constraint> constraints)
Constructs a new Annotation Query.
|
AnnotationQuery(String annotationType,
Map<String,String> featureConstraints)
Constructs a new
AnnotationQuery . |
Modifier and Type | Method and Description |
---|---|
String |
getAnnotationType()
Gets the annotation type for this query.
|
List<Constraint> |
getConstraints()
|
QueryExecutor |
getQueryExecutor(QueryEngine engine)
Obtains a
QueryExecutor appropriate for this query node. |
String |
toString() |
public AnnotationQuery(String annotationType, Map<String,String> featureConstraints)
AnnotationQuery
.
Convenience variant of AnnotationQuery(String, List)
for cases where all predicates are of type
SemanticAnnotationHelper.ConstraintType#EQ
.annotationType
- the desired annotation type, for the annotations to
be matched.featureConstraints
- the constraints over the features of the
annotations to be found. This is represented as a Map
from feature
name (a String
) to feature value (also a String
).AnnotationQuery(String, List)
public AnnotationQuery(String annotationType, List<Constraint> constraints)
annotationType
- the type of annotation being sought.constraints
- a list of constraints placed on the feature values. An
empty constraints list will make no requests regarding the feature values,
hence it will match all annotations of the right type.public QueryExecutor getQueryExecutor(QueryEngine engine) throws IOException
QueryNode
QueryExecutor
appropriate for this query node. Each call
to this method will return a new QueryExecutor
.getQueryExecutor
in interface QueryNode
QueryExecutor
.IOException
- if the index files cannot be accessed.public String getAnnotationType()
public List<Constraint> getConstraints()
Map
from
feature name (a String
) to feature value (also a String
).Copyright © 2021 GATE. All rights reserved.