Package org.apache.any23.filter
Class IgnoreTitlesOfEmptyDocuments
- java.lang.Object
- 
- org.apache.any23.filter.IgnoreTitlesOfEmptyDocuments
 
- 
- All Implemented Interfaces:
- AutoCloseable,- TripleHandler
 
 public class IgnoreTitlesOfEmptyDocuments extends Object implements TripleHandler ATripleHandlerthat suppresses output of theTitleExtractorunless some other triples could be parsed from the document. This is used when we don't want to have single-triple RDF documents around that contain only the title triple.- Author:
- Richard Cyganiak (richard@cyganiak.de)
 
- 
- 
Constructor SummaryConstructors Constructor Description IgnoreTitlesOfEmptyDocuments(TripleHandler wrapped)
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Will be called last and exactly once.voidcloseContext(ExtractionContext context)Informs the handler that no more triples will come from a previously opened context.voidendDocument(org.eclipse.rdf4j.model.IRI documentIRI)Informs the handler that the end of the document has been reached.voidopenContext(ExtractionContext context)Informs the handler that a new context has been established.voidreceiveNamespace(String prefix, String uri, ExtractionContext context)Invoked with a currently open context, notifies the detection of a namespace.voidreceiveTriple(org.eclipse.rdf4j.model.Resource s, org.eclipse.rdf4j.model.IRI p, org.eclipse.rdf4j.model.Value o, org.eclipse.rdf4j.model.IRI g, ExtractionContext context)Invoked with a currently open context, notifies the detection of a triple.voidsetContentLength(long contentLength)Sets the length of the content to be processed.voidstartDocument(org.eclipse.rdf4j.model.IRI documentIRI)
 
- 
- 
- 
Constructor Detail- 
IgnoreTitlesOfEmptyDocumentspublic IgnoreTitlesOfEmptyDocuments(TripleHandler wrapped) 
 
- 
 - 
Method Detail- 
startDocumentpublic void startDocument(org.eclipse.rdf4j.model.IRI documentIRI) throws TripleHandlerException- Specified by:
- startDocumentin interface- TripleHandler
- Throws:
- TripleHandlerException
 
 - 
openContextpublic void openContext(ExtractionContext context) throws TripleHandlerException Description copied from interface:TripleHandlerInforms the handler that a new context has been established. Contexts are not guaranteed to receive any triples, so they might be closed without any triple.- Specified by:
- openContextin interface- TripleHandler
- Parameters:
- context- an instantiated- ExtractionContext
- Throws:
- TripleHandlerException- if there is an errr opening the- ExtractionContext
 
 - 
receiveTriplepublic void receiveTriple(org.eclipse.rdf4j.model.Resource s, org.eclipse.rdf4j.model.IRI p, org.eclipse.rdf4j.model.Value o, org.eclipse.rdf4j.model.IRI g, ExtractionContext context) throws TripleHandlerExceptionDescription copied from interface:TripleHandlerInvoked with a currently open context, notifies the detection of a triple.- Specified by:
- receiveTriplein interface- TripleHandler
- Parameters:
- s- 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.
- Throws:
- TripleHandlerException- if there is an error receiving the triple.
 
 - 
receiveNamespacepublic void receiveNamespace(String prefix, String uri, ExtractionContext context) throws TripleHandlerException Description copied from interface:TripleHandlerInvoked with a currently open context, notifies the detection of a namespace.- Specified by:
- receiveNamespacein interface- TripleHandler
- Parameters:
- prefix- namespace prefix.
- uri- namespace IRI.
- context- namespace context.
- Throws:
- TripleHandlerException- if there is an error receiving the namespace.
 
 - 
closeContextpublic void closeContext(ExtractionContext context) Description copied from interface:TripleHandlerInforms the handler that no more triples will come from a previously opened context. All contexts are guaranteed to be closed before the final close(). The document context for each document is guaranteed to be closed after all local contexts of that document.- Specified by:
- closeContextin interface- TripleHandler
- Parameters:
- context- the context to be closed.
 
 - 
closepublic void close() throws TripleHandlerExceptionDescription copied from interface:TripleHandlerWill be called last and exactly once.- Specified by:
- closein interface- AutoCloseable
- Specified by:
- closein interface- TripleHandler
- Throws:
- TripleHandlerException- if there is an error closing the- TripleHandlerimplementation.
 
 - 
endDocumentpublic void endDocument(org.eclipse.rdf4j.model.IRI documentIRI) throws TripleHandlerExceptionDescription copied from interface:TripleHandlerInforms the handler that the end of the document has been reached.- Specified by:
- endDocumentin interface- TripleHandler
- Parameters:
- documentIRI- document IRI.
- Throws:
- TripleHandlerException- if there is an error ending the document.
 
 - 
setContentLengthpublic void setContentLength(long contentLength) Description copied from interface:TripleHandlerSets the length of the content to be processed.- Specified by:
- setContentLengthin interface- TripleHandler
- Parameters:
- contentLength- length of the content being processed.
 
 
- 
 
-