public interface SemanticAnalysisService
| Modifier and Type | Method and Description |
|---|---|
List<OccurrenceGroup> |
analyze(CoreSession session,
DocumentModel doc)
Synchronous analysis of a document (without linking).
|
List<OccurrenceGroup> |
analyze(CoreSession session,
String textContent)
Synchronous analysis of pre-extracted text content (without linking).
|
void |
clearProgressStatus(String repositoryName,
DocumentRef docRef)
Mark the status as complete (even though the document might still be
under processing).
|
void |
createLinks(DocumentModel document,
CoreSession session,
List<OccurrenceGroup> occurrenceGroups)
Save semantic links in the repository to materialize the occurrence
relationships between documents and entities
|
ProgressStatus |
getProgressStatus(String repositoryName,
DocumentRef docRef)
Return a description of the state of the analysis of the document or null
if no analysis is in progress.
|
boolean |
isActive() |
void |
launchAnalysis(String repositoryName,
DocumentRef docRef)
Launch an asynchronous analysis of a document.
|
void |
launchSynchronousAnalysis(DocumentModel doc,
CoreSession session)
Launch a analysis of a document and wait for the result before returning.
|
void |
scheduleSerializationTask(SerializationTask task)
Asynchronously save the result of the analyze using a dedicated
sequential thread.
|
boolean isActive()
List<OccurrenceGroup> analyze(CoreSession session, String textContent) throws IOException, ClientException
session - used to create in-memory prefetched entity suggestions if
available in the analysis engine response.textContent - the text to send to the enginesIOException - if the engine is not reachable or failsClientException - if the in-memory creation of prefetched entity
suggestions fails (very unlikely)List<OccurrenceGroup> analyze(CoreSession session, DocumentModel doc) throws IOException, ClientException
session - used to create in-memory prefetched entity suggestions if
available in the analysis engine response.doc - the document to analyze (must be attached to an active core
session to extract the text content)ClientException - if the text extraction failsIOException - if the engine is not reachable or failsvoid scheduleSerializationTask(SerializationTask task)
task - a DTO that contains the reference of a document and the
occurrence groups to link to itvoid launchAnalysis(String repositoryName, DocumentRef docRef) throws ClientException
repositoryName - the repository where the document is storeddocRef - the reference of the document to analyzeClientException - if a property of the document to analyze is not
available due to a database connection issue for instance.void launchSynchronousAnalysis(DocumentModel doc, CoreSession session) throws ClientException, DereferencingException, IOException
doc - the document to analyzeClientException - if a property of the document to analyze is not
available due to a database connection issue for instance.IOException - if the connection to the analysis engine fails, or if
the engine it-self failsDereferencingException - if the dereferencing process fails (e.g.
due to a network failure to a remote knowledge base).ProgressStatus getProgressStatus(String repositoryName, DocumentRef docRef)
docRef - void clearProgressStatus(String repositoryName, DocumentRef docRef)
void createLinks(DocumentModel document, CoreSession session, List<OccurrenceGroup> occurrenceGroups) throws ClientException, IOException
IOException - if the remote entity sources fail during lookupsClientException - if the document repository fails during local
lookups or saving entities and occurrencesCopyright © 2011 Nuxeo SA. All Rights Reserved.