Examples of ExtractionResultImpl


Examples of org.apache.any23.extractor.ExtractionResultImpl

        compositeTripleHandler.addChild(verifierTripleHandler);
        final CountingTripleHandler countingTripleHandler = new CountingTripleHandler();
        compositeTripleHandler.addChild(countingTripleHandler);
        final ByteArrayOutputStream out = new ByteArrayOutputStream();
        compositeTripleHandler.addChild( new NTriplesWriter(out) );
        final ExtractionResult extractionResult = new ExtractionResultImpl(
                extractionContext, extractor, compositeTripleHandler
        );
        extractor.run(extractionParameters, extractionContext, is, extractionResult);
        compositeTripleHandler.close();
        logger.info(out.toString());
View Full Code Here

Examples of org.apache.any23.extractor.ExtractionResultImpl

  public void extract(URI uri, String filePath)
    throws IOException, ExtractionException, TripleHandlerException {
    ByteArrayOutputStream baos = new ByteArrayOutputStream();
    final TripleHandler tHandler = new RDFXMLWriter(baos);
    final ExtractionContext extractionContext = new ExtractionContext("rdf-jsonld", uri);
    final ExtractionResult result = new ExtractionResultImpl(extractionContext, extractor, tHandler);
    extractor.setStopAtFirstError(false);
    try {
      extractor.run(
              ExtractionParameters.newDefault(),
              extractionContext,
              this.getClass().getResourceAsStream(filePath),
              result
      );
    } finally {
      logger.debug(baos.toString());
      tHandler.close();
      result.close();
    }
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.