private void indexTTLFile(File file, String baseURI) throws RDFParseException, RDFHandlerException, FileNotFoundException, IOException { log.info("Start parsing: " + file); RDFParser parser = new TurtleParser(); OnlineStatementHandler osh = new OnlineStatementHandler(); parser.setRDFHandler(osh); parser.setStopAtFirstError(false); parser.parse(new FileReader(file), baseURI); log.info("Finished parsing: " + file); }
private void indexTTLFile(File file, String baseURI) throws RDFParseException, RDFHandlerException, FileNotFoundException, IOException { log.info("Start parsing: " + file); RDFParser parser = new TurtleParser(); OnlineStatementHandler osh = new OnlineStatementHandler(); parser.setRDFHandler(osh); parser.setStopAtFirstError(false); if (baseURI == null) { parser.parse(new FileReader(file), ""); } else { parser.parse(new FileReader(file), baseURI); } log.info("Finished parsing: " + file); }
/** * Apply the options to the parser. * * @param p * The parser. */ synchronized public void apply(final RDFParser p) { p.setDatatypeHandling(datatypeHandling); p.setPreserveBNodeIDs(preserveBNodeIDs); p.setStopAtFirstError(stopAtFirstError); p.setVerifyData(verifyData); }
/** * Apply the options to the parser. * * @param p * The parser. */ synchronized public void apply(final RDFParser p) { p.setDatatypeHandling(datatypeHandling); p.setPreserveBNodeIDs(preserveBNodeIDs); p.setStopAtFirstError(stopAtFirstError); p.setVerifyData(verifyData); }
rdfParser.setStopAtFirstError(false);
rdfParser.setStopAtFirstError(false);
private void addData(final RepositoryConnection conn) throws IOException, RDFParseException, RepositoryException, RDFHandlerException { final RDFParser rdfParser = Rio.createParser(RDFFormat.NTRIPLES, conn.getValueFactory()); rdfParser.setVerifyData(true); rdfParser.setStopAtFirstError(true); rdfParser.setDatatypeHandling(RDFParser.DatatypeHandling.IGNORE); rdfParser.setRDFHandler(new RDFHandlerBase() { @Override public void handleStatement(Statement st) throws RDFHandlerException { try { conn.add(st); } catch (OpenRDFException e) { throw new RDFHandlerException(e); } } }); rdfParser.parse(getClass().getResourceAsStream("TestTicket276.n3"), ""); } }
rdfParser.setStopAtFirstError(true);
public SimpleRetriever(final URL url, final Repository repository, final Scutter scutter) { setUrl(url); setRepository(repository); setScutter(scutter); setFilter(new DefaultStatementFilter()); // Use the SAX2-compliant Xerces parser: System.setProperty("org.xml.sax.driver", "org.apache.xerces.parsers.SAXParser"); _parser = new RDFXMLParser(repository.getValueFactory()); _parser.setVerifyData(true); _parser.setStopAtFirstError(false); _handler = new SimpleDocumentHandler(_filter); }
/** * Utility method applies the options to the {@link RDFParser}. * * @param opts * The options. * @param p * The parser. */ public static void apply(final IRDFParserOptions opts, final RDFParser p) { p.setDatatypeHandling(opts.getDatatypeHandling()); p.setPreserveBNodeIDs(opts.getPreserveBNodeIDs()); p.setStopAtFirstError(opts.getStopAtFirstError()); p.setVerifyData(opts.getVerifyData()); }
/** * Utility method applies the options to the {@link RDFParser}. * * @param opts * The options. * @param p * The parser. */ public static void apply(final IRDFParserOptions opts, final RDFParser p) { p.setDatatypeHandling(opts.getDatatypeHandling()); p.setPreserveBNodeIDs(opts.getPreserveBNodeIDs()); p.setStopAtFirstError(opts.getStopAtFirstError()); p.setVerifyData(opts.getVerifyData()); }
rdfParser.setStopAtFirstError(false);
rdfParser.setStopAtFirstError(false);
rdfParser.setStopAtFirstError(true);
rdfParser.setStopAtFirstError(true);
private void addData(final RepositoryConnection conn) throws IOException, RDFParseException, RepositoryException, RDFHandlerException { final RDFParser rdfParser = Rio.createParser(RDFFormat.NTRIPLES, conn.getValueFactory()); rdfParser.setVerifyData(true); rdfParser.setStopAtFirstError(true); rdfParser.setDatatypeHandling(RDFParser.DatatypeHandling.IGNORE); rdfParser.setRDFHandler(new RDFHandlerBase() { @Override public void handleStatement(Statement st) throws RDFHandlerException { try { conn.add(st); } catch (OpenRDFException e) { throw new RDFHandlerException(e); } } }); rdfParser.parse(getClass().getResourceAsStream("TestTicket276.n3"), ""); } }
rdfParser.setStopAtFirstError(true);
rdfParser.setStopAtFirstError(true);
rdfParser.setStopAtFirstError(true);
rdfParser.setStopAtFirstError(true); rdfParser.setDatatypeHandling(RDFParser.DatatypeHandling.IGNORE);