You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jena.apache.org by an...@apache.org on 2022/05/04 21:08:20 UTC
[jena-site] 04/06: JENA-2298, JENA-2299: Updates for RDFParser and RDFWriter
This is an automated email from the ASF dual-hosted git repository.
andy pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/jena-site.git
commit d917f662ca059597864b2aff91dee0f26ddc73fa
Author: Andy Seaborne <an...@apache.org>
AuthorDate: Wed Mar 2 23:34:42 2022 +0000
JENA-2298, JENA-2299: Updates for RDFParser and RDFWriter
---
source/documentation/io/rdf-input.md | 14 ++++++++------
source/documentation/io/streaming-io.md | 2 +-
2 files changed, 9 insertions(+), 7 deletions(-)
diff --git a/source/documentation/io/rdf-input.md b/source/documentation/io/rdf-input.md
index c6bec4cf2..dfe184527 100644
--- a/source/documentation/io/rdf-input.md
+++ b/source/documentation/io/rdf-input.md
@@ -118,14 +118,16 @@ Detailed control over the setup of the parsing process is provided by
For example, to read Trig data, and set the error handler specially,
+ Dataset dataset;
// The parsers will do the necessary character set conversion.
try (InputStream in = new FileInputStream("data.some.unusual.extension")) {
- RDFParser.create()
- .source(in)
- .lang(RDFLanguages.TRIG)
- .errorHandler(ErrorHandlerFactory.errorHandlerStrict)
- .base("http://example/base")
- .parse(noWhere);
+ dataset =
+ RDFParser.create()
+ .source(in)
+ .lang(RDFLanguages.TRIG)
+ .errorHandler(ErrorHandlerFactory.errorHandlerStrict)
+ .base("http://example/base")
+ .toDataset(noWhere);
}
## Logging
diff --git a/source/documentation/io/streaming-io.md b/source/documentation/io/streaming-io.md
index df6a9f4ea..dc93bbed3 100644
--- a/source/documentation/io/streaming-io.md
+++ b/source/documentation/io/streaming-io.md
@@ -22,7 +22,7 @@ into your project and passing an appropriate `InputStream`/`OutputStream`
implementation to Jena code e.g.
InputStream input = new ZstdCompressorInputStream(....);
- RDFParser.source(input).lang(Lang.NQ).parse(graph);
+ Graph graph = RDFParser.source(input).lang(Lang.NQ).toGraph();
## StreamRDF