public abstract class QueryAnnotatorImpl extends Object implements EntityAnnotator
EntityAnnotator that uses a QueryCreator to query the DataService or
Resources. It leaves it up to concrete implementations how they wish to process the results by implementing
processQueryResults(Entity, Iterable, boolean).
See AbstractAnnotator for the most standard implementation of
processQueryResults(Entity, Iterable, boolean).
| Constructor and Description |
|---|
QueryAnnotatorImpl(String sourceRepositoryName,
AnnotatorInfo info,
QueryCreator queryCreator,
DataService dataService,
Resources resources,
CmdLineAnnotatorSettingsConfigurer cmdLineAnnotatorSettingsConfigurer) |
| Modifier and Type | Method and Description |
|---|---|
List<Entity> |
annotateEntity(Entity entity,
boolean updateMode)
Annotates a single entity.
|
List<Attribute> |
getAnnotatorAttributes()
Be aware that several calls to this function will give you the same auto identifiers every time
|
CmdLineAnnotatorSettingsConfigurer |
getCmdLineAnnotatorSettingsConfigurer() |
AnnotatorInfo |
getInfo() |
List<Attribute> |
getRequiredAttributes() |
protected abstract void |
processQueryResults(Entity inputEntity,
Iterable<Entity> annotationSourceEntities,
boolean updateMode)
Processes the query results.
|
boolean |
sourceExists() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcreateAnnotatorAttributespublic QueryAnnotatorImpl(String sourceRepositoryName, AnnotatorInfo info, QueryCreator queryCreator, DataService dataService, Resources resources, CmdLineAnnotatorSettingsConfigurer cmdLineAnnotatorSettingsConfigurer)
public AnnotatorInfo getInfo()
getInfo in interface AnnotatorAnnotatorInfo for the Annotatorpublic List<Attribute> getAnnotatorAttributes()
AnnotatorgetAnnotatorAttributes in interface AnnotatorAttribute for the attributes that get added by this Annotatorpublic boolean sourceExists()
sourceExists in interface EntityAnnotatorpublic List<Attribute> getRequiredAttributes()
getRequiredAttributes in interface EntityAnnotatorList that must be present in the source entity.public List<Entity> annotateEntity(Entity entity, boolean updateMode)
EntityAnnotatorannotateEntity in interface EntityAnnotatorentity - the entity to annotateupdateMode - boolean indicating if existing annotations should be updatedIterable for the annotated datapublic CmdLineAnnotatorSettingsConfigurer getCmdLineAnnotatorSettingsConfigurer()
getCmdLineAnnotatorSettingsConfigurer in interface EntityAnnotatorprotected abstract void processQueryResults(Entity inputEntity, Iterable<Entity> annotationSourceEntities, boolean updateMode)
inputEntity - the input entity that is being annotatedannotationSourceEntities - the entities resulting from the query on the annotation sourceCopyright © 2017. All rights reserved.