Class BenchmarkTripleHandler

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

    public class BenchmarkTripleHandler
    extends Object
    implements org.apache.any23.writer.TripleHandler
    TripleHandler decorator useful to perform benchmarking.
    • Constructor Detail

      • BenchmarkTripleHandler

        public BenchmarkTripleHandler​(org.apache.any23.writer.TripleHandler tripleHandler)
        Constructor.
        Parameters:
        tripleHandler - a configured TripleHandler
    • Method Detail

      • report

        public String report()
        Returns the report as a human readable string.
        Returns:
        a human readable report.
      • 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
      • 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
      • closeContext

        public void closeContext​(org.apache.any23.extractor.ExtractionContext context)
                          throws org.apache.any23.writer.TripleHandlerException
        Specified by:
        closeContext 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
      • 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