public class ReportingTripleHandler extends Object implements TripleHandler
TripleHandler that collects
various information about the extraction process, such as
the extractors used and the total number of triples.| Constructor and Description |
|---|
ReportingTripleHandler(TripleHandler wrapped) |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Will be called last and exactly once.
|
void |
closeContext(ExtractionContext context)
Informs the handler that no more triples will come from a
previously opened context.
|
void |
endDocument(org.openrdf.model.URI documentURI)
Informs the handler that the end of the document
has been reached.
|
Collection<String> |
getExtractorNames() |
int |
getTotalDocuments() |
int |
getTotalTriples() |
void |
openContext(ExtractionContext context)
Informs the handler that a new context has been established.
|
String |
printReport() |
void |
receiveNamespace(String prefix,
String uri,
ExtractionContext context)
Invoked with a currently open context, notifies the detection of a
namespace.
|
void |
receiveTriple(org.openrdf.model.Resource s,
org.openrdf.model.URI p,
org.openrdf.model.Value o,
org.openrdf.model.URI g,
ExtractionContext context)
Invoked with a currently open context,
notifies the detection of a triple.
|
void |
setContentLength(long contentLength)
Sets the length of the content to be processed.
|
void |
startDocument(org.openrdf.model.URI documentURI) |
public ReportingTripleHandler(TripleHandler wrapped)
public Collection<String> getExtractorNames()
public int getTotalTriples()
public int getTotalDocuments()
public String printReport()
public void startDocument(org.openrdf.model.URI documentURI)
throws TripleHandlerException
startDocument in interface TripleHandlerTripleHandlerExceptionpublic void openContext(ExtractionContext context) throws TripleHandlerException
TripleHandleropenContext in interface TripleHandlerTripleHandlerExceptionpublic void receiveNamespace(String prefix, String uri, ExtractionContext context) throws TripleHandlerException
TripleHandlerreceiveNamespace in interface TripleHandlerprefix - namespace prefix.uri - namespace URI.context - namespace context.TripleHandlerExceptionpublic void receiveTriple(org.openrdf.model.Resource s,
org.openrdf.model.URI p,
org.openrdf.model.Value o,
org.openrdf.model.URI g,
ExtractionContext context)
throws TripleHandlerException
TripleHandlerreceiveTriple in interface TripleHandlers - triple subject, cannot be null.p - triple predicate, cannot be null.o - triple object, cannot be null.g - triple graph, can be null.context - extraction context.TripleHandlerExceptionpublic void setContentLength(long contentLength)
TripleHandlersetContentLength in interface TripleHandlerpublic void closeContext(ExtractionContext context) throws TripleHandlerException
TripleHandlercloseContext in interface TripleHandlercontext - the context to be closed.TripleHandlerExceptionpublic void endDocument(org.openrdf.model.URI documentURI)
throws TripleHandlerException
TripleHandlerendDocument in interface TripleHandlerdocumentURI - document URI.TripleHandlerExceptionpublic void close()
throws TripleHandlerException
TripleHandlerclose in interface TripleHandlerTripleHandlerExceptionCopyright © 2010-2012 The Apache Software Foundation. All Rights Reserved.