Class IgnoreTitlesOfEmptyDocuments

  • All Implemented Interfaces:
    AutoCloseable, org.apache.any23.writer.TripleHandler

    public class IgnoreTitlesOfEmptyDocuments
    extends Object
    implements org.apache.any23.writer.TripleHandler
    A TripleHandler that suppresses output of the TitleExtractor unless 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 Detail

      • IgnoreTitlesOfEmptyDocuments

        public IgnoreTitlesOfEmptyDocuments​(org.apache.any23.writer.TripleHandler wrapped)
    • Method Detail

      • startDocument

        public void startDocument​(org.eclipse.rdf4j.model.IRI documentIRI)
                           throws org.apache.any23.writer.TripleHandlerException
        Specified by:
        startDocument in interface org.apache.any23.writer.TripleHandler
        Throws:
        org.apache.any23.writer.TripleHandlerException
      • openContext

        public void openContext​(org.apache.any23.extractor.ExtractionContext context)
                         throws org.apache.any23.writer.TripleHandlerException
        Specified by:
        openContext in interface org.apache.any23.writer.TripleHandler
        Throws:
        org.apache.any23.writer.TripleHandlerException
      • receiveTriple

        public 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,
                                  org.apache.any23.extractor.ExtractionContext context)
                           throws org.apache.any23.writer.TripleHandlerException
        Specified by:
        receiveTriple in interface org.apache.any23.writer.TripleHandler
        Throws:
        org.apache.any23.writer.TripleHandlerException
      • receiveNamespace

        public void receiveNamespace​(String prefix,
                                     String uri,
                                     org.apache.any23.extractor.ExtractionContext context)
                              throws org.apache.any23.writer.TripleHandlerException
        Specified by:
        receiveNamespace in interface org.apache.any23.writer.TripleHandler
        Throws:
        org.apache.any23.writer.TripleHandlerException
      • closeContext

        public void closeContext​(org.apache.any23.extractor.ExtractionContext context)
        Specified by:
        closeContext in interface org.apache.any23.writer.TripleHandler
      • close

        public void close()
                   throws org.apache.any23.writer.TripleHandlerException
        Specified by:
        close in interface AutoCloseable
        Specified by:
        close in interface org.apache.any23.writer.TripleHandler
        Throws:
        org.apache.any23.writer.TripleHandlerException
      • endDocument

        public void endDocument​(org.eclipse.rdf4j.model.IRI documentIRI)
                         throws org.apache.any23.writer.TripleHandlerException
        Specified by:
        endDocument in interface org.apache.any23.writer.TripleHandler
        Throws:
        org.apache.any23.writer.TripleHandlerException
      • setContentLength

        public void setContentLength​(long contentLength)
        Specified by:
        setContentLength in interface org.apache.any23.writer.TripleHandler