/** * 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.setVerifyData(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"), ""); } }
private void upload(URI graphURI, Resource context) throws Exception { RepositoryConnection con = dataRep.getConnection(); con.setAutoCommit(false); try { RDFFormat rdfFormat = Rio.getParserFormatForFileName(graphURI.toString(), RDFFormat.TURTLE); RDFParser rdfParser = Rio.createParser(rdfFormat, dataRep.getValueFactory()); rdfParser.setVerifyData(false); rdfParser.setDatatypeHandling(DatatypeHandling.IGNORE); // rdfParser.setPreserveBNodeIDs(true); RDFInserter rdfInserter = new RDFInserter(con); rdfInserter.enforceContext(context); rdfParser.setRDFHandler(rdfInserter); URL graphURL = new URL(graphURI.toString()); InputStream in = graphURL.openStream(); try { rdfParser.parse(in, graphURI.toString()); } finally { in.close(); } con.setAutoCommit(true); } finally { con.close(); } }
rdfParser.setVerifyData(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.setVerifyData(false);
rdfParser.setVerifyData(false);
.getParser(); rdfParser.setVerifyData(true);
.getParser(); rdfParser.setVerifyData(true);
RDFFormat rdfFormat = Rio.getParserFormatForFileName(graphURI.toString()).orElse(RDFFormat.TURTLE); RDFParser rdfParser = Rio.createParser(rdfFormat, dataRep.getValueFactory()); rdfParser.setVerifyData(false); rdfParser.setDatatypeHandling(DatatypeHandling.IGNORE);
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"), ""); } }
RDFFormat rdfFormat = Rio.getParserFormatForFileName(graphURI.toString(), RDFFormat.TURTLE); RDFParser rdfParser = Rio.createParser(rdfFormat, dataRep.getValueFactory()); rdfParser.setVerifyData(false); rdfParser.setDatatypeHandling(DatatypeHandling.IGNORE);
rdfParser.setVerifyData(true);
.getValueFactory()); rdfParser.setVerifyData(true);
.getValueFactory()); rdfParser.setVerifyData(true);
RDFFormat rdfFormat = Rio.getParserFormatForFileName(graphURI.toString(), RDFFormat.TURTLE); RDFParser rdfParser = Rio.createParser(rdfFormat, dataRep.getValueFactory()); rdfParser.setVerifyData(false); rdfParser.setDatatypeHandling(DatatypeHandling.IGNORE);