/** * Writes the given statement to the given {@link OutputStream} in the given format. * <p> * * @param st * The statement to be written. * @param output * The {@link OutputStream} to write the statement to. * @param dataFormat * The {@link RDFFormat} to use when writing the statement. * @throws RDFHandlerException * Thrown if there is an error writing the statement. * @throws UnsupportedRDFormatException * If no {@link RDFWriter} is available for the specified RDF format. */ public static void write(Statement st, OutputStream output, RDFFormat dataFormat) throws RDFHandlerException { write(st, output, dataFormat, new WriterConfig()); }
/** * Writes the given single statement to the given {@link Writer} in the given format. * <p> * * @param statement * A statement to be written. * @param output * The {@link Writer} to write the statement to. * @param dataFormat * The {@link RDFFormat} to use when writing the statement. * @throws RDFHandlerException * Thrown if there is an error writing the statement. * @throws UnsupportedRDFormatException * If no {@link RDFWriter} is available for the specified RDF format. */ public static void write(Statement statement, Writer output, RDFFormat dataFormat) throws RDFHandlerException { write(statement, output, dataFormat, new WriterConfig()); }
/** * Writes the given statements to the given {@link Writer} in the given format. * <p> * If the collection is a {@link Model}, its namespaces will also be written. * * @param model * A collection of statements, such as a {@link Model}, to be written. * @param output * The {@link Writer} to write the statements to. * @param dataFormat * The {@link RDFFormat} to use when writing the statements. * @throws RDFHandlerException * Thrown if there is an error writing the statements. * @throws UnsupportedRDFormatException * If no {@link RDFWriter} is available for the specified RDF format. */ public static void write(Iterable<Statement> model, Writer output, RDFFormat dataFormat) throws RDFHandlerException { write(model, output, dataFormat, new WriterConfig()); }
/** * Writes the given statements to the given {@link OutputStream} in the given format. * <p> * If the collection is a {@link Model}, its namespaces will also be written. * * @param model * A collection of statements, such as a {@link Model}, to be written. * @param output * The {@link OutputStream} to write the statements to. * @param dataFormat * The {@link RDFFormat} to use when writing the statements. * @throws RDFHandlerException * Thrown if there is an error writing the statements. * @throws UnsupportedRDFormatException * If no {@link RDFWriter} is available for the specified RDF format. */ public static void write(Iterable<Statement> model, OutputStream output, RDFFormat dataFormat) throws RDFHandlerException { write(model, output, dataFormat, new WriterConfig()); }
/** * Writes the given statements to the given {@link OutputStream} in the given format. * <p> * If the collection is a {@link Model}, its namespaces will also be written. * * @param model * A collection of statements, such as a {@link Model}, to be written. * @param output * The {@link OutputStream} to write the statements to. * @param dataFormat * The {@link RDFFormat} to use when writing the statements. * @throws RDFHandlerException * Thrown if there is an error writing the statements. * @throws UnsupportedRDFormatException * If no {@link RDFWriter} is available for the specified RDF format. */ public static void write(Iterable<Statement> model, OutputStream output, RDFFormat dataFormat) throws RDFHandlerException { write(model, output, dataFormat, new WriterConfig()); }
/** * Writes the given statement to the given {@link OutputStream} in the given format. * <p> * * @param st * The statement to be written. * @param output * The {@link OutputStream} to write the statement to. * @param dataFormat * The {@link RDFFormat} to use when writing the statement. * @throws RDFHandlerException * Thrown if there is an error writing the statement. * @throws UnsupportedRDFormatException * If no {@link RDFWriter} is available for the specified RDF format. */ public static void write(Statement st, OutputStream output, RDFFormat dataFormat) throws RDFHandlerException { write(st, output, dataFormat, new WriterConfig()); }
/** * Writes the given single statement to the given {@link Writer} in the given format. * <p> * * @param statement * A statement to be written. * @param output * The {@link Writer} to write the statement to. * @param dataFormat * The {@link RDFFormat} to use when writing the statement. * @throws RDFHandlerException * Thrown if there is an error writing the statement. * @throws UnsupportedRDFormatException * If no {@link RDFWriter} is available for the specified RDF format. */ public static void write(Statement statement, Writer output, RDFFormat dataFormat) throws RDFHandlerException { write(statement, output, dataFormat, new WriterConfig()); }
/** * Writes the given statements to the given {@link Writer} in the given format. * <p> * If the collection is a {@link Model}, its namespaces will also be written. * * @param model * A collection of statements, such as a {@link Model}, to be written. * @param output * The {@link Writer} to write the statements to. * @param dataFormat * The {@link RDFFormat} to use when writing the statements. * @throws RDFHandlerException * Thrown if there is an error writing the statements. * @throws UnsupportedRDFormatException * If no {@link RDFWriter} is available for the specified RDF format. */ public static void write(Iterable<Statement> model, Writer output, RDFFormat dataFormat) throws RDFHandlerException { write(model, output, dataFormat, new WriterConfig()); }
/** * Writes the given statement to the given {@link OutputStream} in the given format. * <p> * * @param st * The statement to be written. * @param output * The {@link OutputStream} to write the statement to. * @param dataFormat * The {@link RDFFormat} to use when writing the statement. * @throws RDFHandlerException * Thrown if there is an error writing the statement. * @throws UnsupportedRDFormatException * If no {@link RDFWriter} is available for the specified RDF format. */ public static void write(Statement st, OutputStream output, RDFFormat dataFormat) throws RDFHandlerException { write(st, output, dataFormat, new WriterConfig()); }
/** * Writes the given single statement to the given {@link Writer} in the given format. * <p> * * @param statement * A statement to be written. * @param output * The {@link Writer} to write the statement to. * @param dataFormat * The {@link RDFFormat} to use when writing the statement. * @throws RDFHandlerException * Thrown if there is an error writing the statement. * @throws UnsupportedRDFormatException * If no {@link RDFWriter} is available for the specified RDF format. */ public static void write(Statement statement, Writer output, RDFFormat dataFormat) throws RDFHandlerException { write(statement, output, dataFormat, new WriterConfig()); }
/** * Writes the given statements to the given {@link OutputStream} in the given format. * <p> * If the collection is a {@link Model}, its namespaces will also be written. * * @param model * A collection of statements, such as a {@link Model}, to be written. * @param output * The {@link OutputStream} to write the statements to. * @param dataFormat * The {@link RDFFormat} to use when writing the statements. * @throws RDFHandlerException * Thrown if there is an error writing the statements. * @throws UnsupportedRDFormatException * If no {@link RDFWriter} is available for the specified RDF format. */ public static void write(Iterable<Statement> model, OutputStream output, RDFFormat dataFormat) throws RDFHandlerException { write(model, output, dataFormat, new WriterConfig()); }
/** * Writes the given statements to the given {@link Writer} in the given format. * <p> * If the collection is a {@link Model}, its namespaces will also be written. * * @param model * A collection of statements, such as a {@link Model}, to be written. * @param output * The {@link Writer} to write the statements to. * @param dataFormat * The {@link RDFFormat} to use when writing the statements. * @throws RDFHandlerException * Thrown if there is an error writing the statements. * @throws UnsupportedRDFormatException * If no {@link RDFWriter} is available for the specified RDF format. */ public static void write(Iterable<Statement> model, Writer output, RDFFormat dataFormat) throws RDFHandlerException { write(model, output, dataFormat, new WriterConfig()); }
/** * Writes the given statements to the given {@link Writer} in the given format. * <p> * If the collection is a {@link Model}, its namespaces will also be written. * * @param model * A collection of statements, such as a {@link Model}, to be written. * @param output * The {@link Writer} to write the statements to. * @param baseURI * The base URI to relativize IRIs against. * @param dataFormat * The {@link RDFFormat} to use when writing the statements. * @throws RDFHandlerException * Thrown if there is an error writing the statements. * @throws URISyntaxException * If the baseURI is invalid * @throws UnsupportedRDFormatException * If no {@link RDFWriter} is available for the specified RDF format. */ public static void write(Iterable<Statement> model, Writer output, String baseURI, RDFFormat dataFormat) throws RDFHandlerException, UnsupportedRDFormatException, URISyntaxException { write(model, output, baseURI, dataFormat, new WriterConfig()); }
/** * Writes the given statements to the given {@link Writer} in the given format. * <p> * If the collection is a {@link Model}, its namespaces will also be written. * * @param model * A collection of statements, such as a {@link Model}, to be written. * @param output * The {@link Writer} to write the statements to. * @param baseURI * The base URI to relativize IRIs against. * @param dataFormat * The {@link RDFFormat} to use when writing the statements. * @throws RDFHandlerException * Thrown if there is an error writing the statements. * @throws URISyntaxException * If the baseURI is invalid * @throws UnsupportedRDFormatException * If no {@link RDFWriter} is available for the specified RDF format. */ public static void write(Iterable<Statement> model, Writer output, String baseURI, RDFFormat dataFormat) throws RDFHandlerException, UnsupportedRDFormatException, URISyntaxException { write(model, output, baseURI, dataFormat, new WriterConfig()); }
/** * Writes the given statements to the given {@link Writer} in the given format. * <p> * If the collection is a {@link Model}, its namespaces will also be written. * * @param model * A collection of statements, such as a {@link Model}, to be written. * @param output * The {@link Writer} to write the statements to. * @param baseURI * The base URI to relativize IRIs against. * @param dataFormat * The {@link RDFFormat} to use when writing the statements. * @throws RDFHandlerException * Thrown if there is an error writing the statements. * @throws URISyntaxException * If the baseURI is invalid * @throws UnsupportedRDFormatException * If no {@link RDFWriter} is available for the specified RDF format. */ public static void write(Iterable<Statement> model, Writer output, String baseURI, RDFFormat dataFormat) throws RDFHandlerException, UnsupportedRDFormatException, URISyntaxException { write(model, output, baseURI, dataFormat, new WriterConfig()); }
/** * Writes the given statements to the given {@link OutputStream} in the given format. * <p> * If the collection is a {@link Model}, its namespaces will also be written. * * @param model * A collection of statements, such as a {@link Model}, to be written. * @param output * The {@link OutputStream} to write the statements to. * @param baseURI * The base URI to relativize IRIs against. * @param dataFormat * The {@link RDFFormat} to use when writing the statements. * @throws RDFHandlerException * Thrown if there is an error writing the statements. * @throws URISyntaxException * If the baseURI is invalid * @throws UnsupportedRDFormatException * If no {@link RDFWriter} is available for the specified RDF format. */ public static void write(Iterable<Statement> model, OutputStream output, String baseURI, RDFFormat dataFormat) throws RDFHandlerException, UnsupportedRDFormatException, URISyntaxException { write(model, output, baseURI, dataFormat, new WriterConfig()); }
/** * Writes the given statements to the given {@link OutputStream} in the given format. * <p> * If the collection is a {@link Model}, its namespaces will also be written. * * @param model * A collection of statements, such as a {@link Model}, to be written. * @param output * The {@link OutputStream} to write the statements to. * @param baseURI * The base URI to relativize IRIs against. * @param dataFormat * The {@link RDFFormat} to use when writing the statements. * @throws RDFHandlerException * Thrown if there is an error writing the statements. * @throws URISyntaxException * If the baseURI is invalid * @throws UnsupportedRDFormatException * If no {@link RDFWriter} is available for the specified RDF format. */ public static void write(Iterable<Statement> model, OutputStream output, String baseURI, RDFFormat dataFormat) throws RDFHandlerException, UnsupportedRDFormatException, URISyntaxException { write(model, output, baseURI, dataFormat, new WriterConfig()); }
/** * Writes the given statements to the given {@link OutputStream} in the given format. * <p> * If the collection is a {@link Model}, its namespaces will also be written. * * @param model * A collection of statements, such as a {@link Model}, to be written. * @param output * The {@link OutputStream} to write the statements to. * @param baseURI * The base URI to relativize IRIs against. * @param dataFormat * The {@link RDFFormat} to use when writing the statements. * @throws RDFHandlerException * Thrown if there is an error writing the statements. * @throws URISyntaxException * If the baseURI is invalid * @throws UnsupportedRDFormatException * If no {@link RDFWriter} is available for the specified RDF format. */ public static void write(Iterable<Statement> model, OutputStream output, String baseURI, RDFFormat dataFormat) throws RDFHandlerException, UnsupportedRDFormatException, URISyntaxException { write(model, output, baseURI, dataFormat, new WriterConfig()); }
/** * @param connection connection to Sail repository * @param storedQueries pre-defined stored SPARQL query templates * @param writerProperties RDF4J RIO WriterConfig properties * @param verbose true when verbose mode enabled, otherwise false */ @SuppressWarnings("unchecked") public HttpSparqlHandler(SailRepositoryConnection connection, Properties storedQueries, Properties writerProperties, boolean verbose) { this.connection = connection; if (!verbose) { // Verbose mode disabled --> logs with level lower than WARNING will be discarded LOGGER.setLevel(Level.WARNING); } this.storedQueries = storedQueries; this.writerConfig = new WriterConfig(); if (writerProperties != null) { for (Map.Entry<Object, Object> me : writerProperties.entrySet()) { writerConfig.set((RioSetting) getStaticField(me.getKey().toString()), getStaticField(me.getValue().toString())); } } }