|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.dfki.lt.hog.database.AnnotationDatabase
public abstract class AnnotationDatabase
This is an abstract class for a Deepthought annotation database independent of a specific underlying database system. This class uses concepts like Session and Document (identified via Strings) that are used to structure the Deepthought annotation database. In this Database, a session comprises a collection of a documents. A document itself is a collection (!) of XML annotations that are produced from different modules and can be accessed via annotation layer names.
Constructor Summary | |
---|---|
AnnotationDatabase()
Default Constructor: Creates an Annotation database object. |
|
AnnotationDatabase(java.lang.String databaseLocation)
Constructor with database location prefix as parameter. |
Method Summary | |
---|---|
abstract boolean |
addAnnotation(java.lang.String sessionID,
java.lang.String docName,
java.lang.String layerName,
org.w3c.dom.Node domTree)
Adds XML annotation (as DOM tree) for specified document. |
abstract boolean |
addAnnotation(java.lang.String sessionID,
java.lang.String docName,
java.lang.String layerName,
java.lang.String annotation)
Adds XML annotation (as String) for the specified document. |
abstract boolean |
addDocument(java.lang.String sessionID,
java.lang.String docName)
Adds a new, empty annotation collection for a document to the annotation database. |
protected abstract boolean |
addIndex(java.lang.String sessionID,
java.lang.String indexID,
java.lang.String indexPattern)
Adds an index to the annotation database. |
abstract boolean |
addSession(java.lang.String sessionID)
Adds a new session to the annotation database. |
abstract boolean |
addSession(java.lang.String sessionID,
org.w3c.dom.Node metaInfo)
Adds a new session to the annotation database. |
abstract boolean |
addSession(java.lang.String sessionID,
java.lang.String metaInfo)
Adds a new session to the annotation database. |
abstract void |
closeDatabase()
Closes the annotation database . |
abstract boolean |
deleteDocument(java.lang.String sessionID,
java.lang.String docName)
Deletes an annotation collection for a document from the annotation database. |
abstract boolean |
deleteSession(java.lang.String sessionID)
Deletes a session from the annotation database. |
abstract org.w3c.dom.Node |
getAnnotationAsDOM(java.lang.String sessionID,
java.lang.String docName,
java.lang.String Layer)
Returns the annotation for the specified document and layer as DOM tree. |
abstract java.lang.String |
getAnnotationAsString(java.lang.String sessionID,
java.lang.String docName,
java.lang.String Layer)
Returns the annotation for the specified document and layer as String. |
protected java.lang.String |
getDatabaseLocation()
Returns the database location prefix. |
abstract boolean |
openDatabase(java.lang.String connectString)
Opens the annotation database. |
void |
setDatabaseLocation(java.lang.String databaseLocation)
Sets the database location prefix. |
abstract long |
XUpdateQuery(java.lang.String sessionID,
java.lang.String query)
Executes an XUpdate `query'. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AnnotationDatabase()
public AnnotationDatabase(java.lang.String databaseLocation)
databaseLocation
- a String identifying the location of the database, e.g. URIMethod Detail |
---|
public void setDatabaseLocation(java.lang.String databaseLocation)
databaseLocation
- a String identifying the location of the database, e.g. URI.protected java.lang.String getDatabaseLocation()
public abstract boolean openDatabase(java.lang.String connectString) throws java.lang.Exception
connectString
- optional connection String for the underlying database
java.lang.Exception
public abstract void closeDatabase() throws java.lang.Exception
java.lang.Exception
public abstract boolean addSession(java.lang.String sessionID) throws java.lang.Exception
sessionID
- the session Identifier (single token starting with a non-numerical character)
java.lang.Exception
public abstract boolean addSession(java.lang.String sessionID, java.lang.String metaInfo) throws java.lang.Exception
sessionID
- the session Identifier (single token starting with a non-numerical character)metaInfo
- metainformation associated with the session (XML String)
java.lang.Exception
public abstract boolean addSession(java.lang.String sessionID, org.w3c.dom.Node metaInfo)
sessionID
- the session Identifier (single token starting with a non-numerical character)metaInfo
- metainformation associated with the session (DOM object)
public abstract boolean deleteSession(java.lang.String sessionID)
sessionID
- the session Identifier (single token starting with a non-numerical character)
public abstract boolean addDocument(java.lang.String sessionID, java.lang.String docName)
sessionID
- the session Identifier (single token starting with a non-numerical character)docName
- identifier of the added document (must be unique within the same session collection)
public abstract boolean deleteDocument(java.lang.String sessionID, java.lang.String docName)
sessionID
- the session Identifier (single token starting with a non-numerical character)docName
- identifier of the document to be deleted
public abstract boolean addAnnotation(java.lang.String sessionID, java.lang.String docName, java.lang.String layerName, java.lang.String annotation)
sessionID
- the session Identifier (single token starting with a non-numerical character)docName
- identifier of the document for which annotation is to be addedlayerName
- name of the layer type (such as Tokens, NamedEntities etc.) of the annotationannotation
- the XML annotation as String
public abstract boolean addAnnotation(java.lang.String sessionID, java.lang.String docName, java.lang.String layerName, org.w3c.dom.Node domTree)
sessionID
- the session Identifier (single token starting with a non-numerical character)docName
- identifier of the document for which annotation is to be addedlayerName
- name of the layer type (such as Tokens, NamedEntities etc.) of the annotationdomTree
- the XML annotation as DOM object
public abstract java.lang.String getAnnotationAsString(java.lang.String sessionID, java.lang.String docName, java.lang.String Layer)
sessionID
- the session Identifier (single token starting with a non-numerical character)docName
- identifier of the document for which annotation is to be addedLayer
- name of the layer type (such as Tokens, NamedEntities etc.) of the annotation
public abstract org.w3c.dom.Node getAnnotationAsDOM(java.lang.String sessionID, java.lang.String docName, java.lang.String Layer)
sessionID
- the session Identifier (single token starting with a non-numerical character)docName
- identifier of the document for which annotation is to be retrievedLayer
- name of the layer type (such as Tokens, NamedEntities etc.) of the annotation
public abstract long XUpdateQuery(java.lang.String sessionID, java.lang.String query)
sessionID
- the session Identifier (single token starting with a non-numerical character)query
- the XUpdate query (XML syntax) as String
protected abstract boolean addIndex(java.lang.String sessionID, java.lang.String indexID, java.lang.String indexPattern)
sessionID
- the session Identifier (single token starting with a non-numerical character)indexID
- name of the index (must be unique within a collection)indexPattern
- pattern for the indexer to be generated
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |