@Override public void parse(Graph target, InputStream serializedGraph, String formatIdentifier, IRI baseUri) { //The callback will add parsed triples to the target Graph ClerezzaTripleCallback ctc = new ClerezzaTripleCallback(); ctc.setGraph(target); Object input; int startSize = 0; if(logger.isDebugEnabled()){ startSize = target.size(); } long start = System.currentTimeMillis(); try { input = JsonUtils.fromInputStream(serializedGraph,"UTF-8"); } catch (IOException e) { logger.error("Unable to read from the parsed input stream",e); throw new RuntimeException(e.getMessage(), e); } try { JsonLdProcessor.toRDF(input,ctc); } catch (JsonLdError e) { logger.error("Unable to parse JSON-LD from the parsed input stream",e); throw new RuntimeException(e.getMessage(), e); } if(logger.isDebugEnabled()){ logger.debug(" - parsed {} triples in {}ms", target.size() - startSize, System.currentTimeMillis()-start); } }
@Override public void parse(Graph target, InputStream serializedGraph, String formatIdentifier, IRI baseUri) { // The callback will add parsed triples to the target MGraph final ClerezzaTripleCallback ctc = new ClerezzaTripleCallback(); ctc.setMGraph(target); Object input; int startSize = 0; if (logger.isDebugEnabled()) { startSize = target.size(); } final long start = System.currentTimeMillis(); try { input = JsonUtils.fromInputStream(serializedGraph, "UTF-8"); } catch (final IOException e) { logger.error("Unable to read from the parsed input stream", e); throw new RuntimeException(e.getMessage(), e); } try { JsonLdProcessor.toRDF(input, ctc); } catch (final JsonLdError e) { logger.error("Unable to parse JSON-LD from the parsed input stream", e); throw new RuntimeException(e.getMessage(), e); } if (logger.isDebugEnabled()) { logger.debug(" - parsed {} triples in {}ms", target.size() - startSize, System.currentTimeMillis() - start); } }
@Override public void parse(Graph target, InputStream serializedGraph, String formatIdentifier, IRI baseUri) { //The callback will add parsed triples to the target Graph ClerezzaTripleCallback ctc = new ClerezzaTripleCallback(); ctc.setGraph(target); Object input; int startSize = 0; if(logger.isDebugEnabled()){ startSize = target.size(); } long start = System.currentTimeMillis(); try { input = JsonUtils.fromInputStream(serializedGraph,"UTF-8"); } catch (IOException e) { logger.error("Unable to read from the parsed input stream",e); throw new RuntimeException(e.getMessage(), e); } try { JsonLdProcessor.toRDF(input,ctc); } catch (JsonLdError e) { logger.error("Unable to parse JSON-LD from the parsed input stream",e); throw new RuntimeException(e.getMessage(), e); } if(logger.isDebugEnabled()){ logger.debug(" - parsed {} triples in {}ms", target.size() - startSize, System.currentTimeMillis()-start); } }
throw new RuntimeException(e.getMessage(), e); } catch (IOException e) { throw new RuntimeException(e.getMessage(), e);
throw new RuntimeException(e.getMessage(), e); } catch (final IOException e) { throw new RuntimeException(e.getMessage(), e);
throw new RuntimeException(e.getMessage(), e); } catch (IOException e) { throw new RuntimeException(e.getMessage(), e);
errorHandler.error(e.getMessage(), -1, -1); throw new RiotException(e) ;