Package org.opensextant.annotations
Interface DeepEyeStore
-
public interface DeepEyeStore
DeepEyeStore is an abstraction of a data store that stores records and annotations. For example, we built annotation stores implementing DeepEyeStore using MongoDB, Postgres, Elasticsearch and SQLite backends.- Author:
- ubaldino
-
-
Method Summary
Modifier and Type Method Description void
add(java.util.Collection<Annotation> aList)
add a list of entity annotations.void
add(Annotation A)
add a single Annotation.void
add(Record R)
Add new record.void
connect()
void
disconnect()
Record
findRecord(java.lang.String id)
find a single record.java.util.List<Annotation>
findSimilar(Annotation q)
given the shell of a annot, find similar records.java.util.List<Record>
findSimilar(Record q)
given the shell of a record, find similar records.void
save(Record R)
Suggested Save operation: check if exists, update if it does, otherwise insert.void
update(Annotation A)
Update an existing annotation.void
update(Record R)
The implementation of a record updatevoid
updateState(Record R)
Update only the state of a record
-
-
-
Method Detail
-
connect
void connect() throws DeepEyeException
- Throws:
DeepEyeException
-
disconnect
void disconnect()
-
add
void add(Record R) throws DeepEyeException
Add new record.- Throws:
DeepEyeException
-
update
void update(Record R) throws DeepEyeException
The implementation of a record update- Parameters:
R
- record to update- Throws:
DeepEyeException
- on failure to update Record
-
save
void save(Record R) throws DeepEyeException
Suggested Save operation: check if exists, update if it does, otherwise insert. This is typically adjustable behavior.- Parameters:
R
-- Throws:
DeepEyeException
- on failure to save Record, because system was down, lack of privileges, or inability to overwrite existing.
-
updateState
void updateState(Record R) throws DeepEyeException
Update only the state of a record- Throws:
DeepEyeException
-
findRecord
Record findRecord(java.lang.String id) throws DeepEyeException
find a single record. Avoid the overhead of a cursor for "findOne" query. Where you know you are looking for one or none.- Parameters:
id
-- Returns:
- Deepeye Record object
- Throws:
DeepEyeException
-
add
void add(Annotation A) throws DeepEyeException
add a single Annotation.- Throws:
DeepEyeException
-
add
void add(java.util.Collection<Annotation> aList) throws DeepEyeException
add a list of entity annotations.- Parameters:
aList
-- Throws:
DeepEyeException
-
update
void update(Annotation A) throws DeepEyeException
Update an existing annotation. This does nothing if the annotation does not exist in the database.- Throws:
DeepEyeException
-
findSimilar
java.util.List<Record> findSimilar(Record q) throws DeepEyeException
given the shell of a record, find similar records.- Throws:
DeepEyeException
-
findSimilar
java.util.List<Annotation> findSimilar(Annotation q)
given the shell of a annot, find similar records.
-
-