Author: andy
Date: Tue Sep 2 07:24:46 2014
New Revision: 1621941
URL: http://svn.apache.org/r1621941
Log:
Documentation for RDF Thrift
Modified:
jena/site/trunk/content/documentation/io/index.mdtext
jena/site/trunk/content/documentation/io/rdf-input.mdtext
jena/site/trunk/content/documentation/io/rdf-output.mdtext
Modified: jena/site/trunk/content/documentation/io/index.mdtext
URL:
http://svn.apache.org/viewvc/jena/site/trunk/content/documentation/io/index.mdtext?rev=1621941&r1=1621940&r2=1621941&view=diff
==============================================================================
--- jena/site/trunk/content/documentation/io/index.mdtext (original)
+++ jena/site/trunk/content/documentation/io/index.mdtext Tue Sep 2 07:24:46
2014
@@ -20,16 +20,21 @@ can be integrated into both the parser a
- RDF/JSON
- TriG
- N-Quads
+- RDF Thrift
-RDF/JSON is not JSON-LD - it is a direct encoding of RDF triples in JSON.
+RDF/JSON is different from JSON-LD - it is a direct encoding of RDF triples in
JSON.
See the [description of RDF/JSON](rdf-json.html).
+RDF Thrift is a binary encoding of RDF (graphs and datasets) that can be useful
+for fast parsing. See the
+[description of RDF Thrift](http://afs.github.io/rdf-thrift).
+
## Command line tools
There are scripts in Jena download to run these commands.
- `riot` - parse, guessing the syntax from the file extension.
- Assumed N-Quads/N-Triples from stdin.
+ Assumes N-Quads/N-Triples from stdin.
- `turtle`, `ntriples`, `nquads`, `trig`, `rdfxml` - parse a particular
language
These can be called directly as Java programs:
@@ -37,15 +42,17 @@ These can be called directly as Java pro
The file extensions understood are:
| Extension | Language |
-|-----------|-----------|
-| `.ttl` | Turtle |
-| `.nt` | N-Triples |
-| `.nq` | N-Quads |
-| `.trig` | TriG |
-| `.rdf` | RDF/XML |
-| `.owl` | RDF/XML |
-| `.jsonld` | JSON-LD |
-| `.rj` | RDF/JSON |
+|-----------|------------|
+| `.ttl` | Turtle |
+| `.nt` | N-Triples |
+| `.nq` | N-Quads |
+| `.trig` | TriG |
+| `.rdf` | RDF/XML |
+| `.owl` | RDF/XML |
+| `.jsonld` | JSON-LD |
+| `.trdf` | RDF Thrift |
+| `.rt` | RDF Thrift |
+| `.rj` | RDF/JSON |
`.n3` is supported but only as a synonym for Turtle.
@@ -57,13 +64,18 @@ These scripts call java programs in the
java -cp ... riotcmd.riot file.ttl
+This can be a mixture of files in difefrent syntaxes when file extensiosn
+are used to determine the file syntax type.
+
The scripts all accept the same arguments (type `"riot --help"` to
get command line reminders):
-- `--validate`: Checking mode: same as `--strict --sink --check=true`
+- `--syntax=NAME`; Explicitly set the input syntax for all files.
+- `--validate`: Checking mode: same as `--strict --sink --check=true`.
- `--check=true/false`: Run with checking of literals and IRIs either on or
off.
-- `--sink`: No output of triples or quads.
+- `--sink`: No output.
- `--time`: Output timing information.
+- `--out=FORMAT`: Output in a given syntax (this is streaming, not pretty
printing).
To aid in checking for errors in UTF8-encoded files, there is a
utility which reads a file of bytes as UTF8 and checks the encoding.
Modified: jena/site/trunk/content/documentation/io/rdf-input.mdtext
URL:
http://svn.apache.org/viewvc/jena/site/trunk/content/documentation/io/rdf-input.mdtext?rev=1621941&r1=1621940&r2=1621941&view=diff
==============================================================================
--- jena/site/trunk/content/documentation/io/rdf-input.mdtext (original)
+++ jena/site/trunk/content/documentation/io/rdf-input.mdtext Tue Sep 2
07:24:46 2014
@@ -33,7 +33,7 @@ The major classes in the RIOT API are:
| Class | Comment |
|-------|---------|
| RDFDataMgr | Main set of functions to read and load models and
datasets |
-| StreamManager | Handles the opening of typed input streams |
+| StreamManager | Handles the opening of typed input streams |
| StreamRDF | Interface for the output of all parsers |
| RDFLanguages | Registered languages |
| RDFParserRegistry | Registered parser factories |
@@ -41,10 +41,27 @@ The major classes in the RIOT API are:
### Determining the RDF syntax
The syntax of the RDF file is determined by the content type (if an HTTP
-request), then the file extension if there is no content type (or it's
-`text/plain`), which is assumed to be type returned for an unconfigured
+request), then the file extension if there is no content type. Content type
+`text/plain` is ignored; it is assumed to be type returned for an unconfigured
http server. The application can also pass in a declared language hint.
+The string name traditionally used in `model.read` is mapped to RIOT `Lang`
+as:
+
+| Jena reader | RIOT Lang |
+|----------------------|------------------|
+| `"TURTLE"` | `TURTLE` |
+| `"TTL"` | `TURTLE` |
+| `"Turtle"` | `TURTLE` |
+| `"N-TRIPLES"` | `NTRIPLES` |
+| `"N-TRIPLE"` | `NTRIPLES` |
+| `"NT"` | `NTRIPLES` |
+| `"RDF/XML"` | `RDFXML` |
+| `"N3"` | `N3` |
+| `"JSON-LD"` | `JSONLD` |
+| `"RDF/JSON"` | `RDFJSON` |
+| `"RDF/JSON"` | `RDFJSON` |
+
The following is a suggested Apache httpd .htaccess file:
AddType text/turtle .ttl
@@ -56,6 +73,7 @@ The following is a suggested Apache http
AddType text/trig .trig
AddType application/n-quads .nq
+ AddType application/rdf+thrift .trdf
### Example 1 : Common usage
@@ -117,7 +135,7 @@ The `StreamManager` can be reconfigured
files. The default configuration used for the global `StreamManager` is
a file access class, wihere the current directory is that of the java
process, a URL accessor for reading from the web, and a
-class laoder-based accessor. Different setups can be built and used
+class loader-based accessor. Different setups can be built and used
either as the global set up,
There is also a `LocationMapper` for rewiting file names and URLs before
Modified: jena/site/trunk/content/documentation/io/rdf-output.mdtext
URL:
http://svn.apache.org/viewvc/jena/site/trunk/content/documentation/io/rdf-output.mdtext?rev=1621941&r1=1621940&r2=1621941&view=diff
==============================================================================
--- jena/site/trunk/content/documentation/io/rdf-output.mdtext (original)
+++ jena/site/trunk/content/documentation/io/rdf-output.mdtext Tue Sep 2
07:24:46 2014
@@ -14,6 +14,7 @@ See [Reading RDF](rdf-input.html) for de
- [Streamed Block Formats](#streamed-block-formats)
- [Line printed formats](#line-printed-formats)
- [N-Triples and N-Quads](#n-triples-and-n-quads)
+ - [RDF Thrift](#rdf-thrift)
- [RDF/XML](#rdfxml)
- [Examples](#examples)
- [Notes](#Notes)
@@ -55,6 +56,7 @@ are available as part of the standard se
* RDF/JSON
* TriG
* NQuads
+* RDF Thrift
In addition, there are variants of Trutle, TriG for pretty printing,
streamed output and flat output. RDF/XML has variants for pretty printing
@@ -85,6 +87,7 @@ as follows:
| `"N3"` | `N3` |
| `"JSON-LD"` | `JSONLD` |
| `"RDF/JSON"` | `RDFJSON` |
+| `"RDF/JSON"` | `RDFJSON` |
## Formats
@@ -103,6 +106,7 @@ an `RDFFormat` internally. The normal w
| RDFXML | RDF/XML, pretty printed |
| JSONLD | JSON-LD |
| RDFJSON | |
+| RDFTHRFT | RDF Thrift |
Pretty printed RDF/XML is also known as RDF/XML-ABBREV
@@ -154,7 +158,6 @@ Fully pretty printed formats can't not b
of all of the data to be written in order to choose the short forms. This
limits
their use in fully scalable applications.
-
Some formats can be written streaming style, where the triples or quads
are partially grouped together by adjacent subject or graph/subject
in the output stream.
@@ -285,6 +288,22 @@ in ASCII (using `\u` escape sequences fo
| NTRIPLES_ASCII |
| NQUADS_ASCII |
+### RDF Thrift
+
+The [RDF Thrift](http://afs.github.io/rdf-thrift) format is a binary encoding
of RDF Graphs
+and RDF Datasets, as well as SPARQL Result Sets, that can provide efficient
parsing
+compared to the text-based standardised syntax such as N-triples, Turtle or
RDF/XML.
+
+| RDFFormat |
+|------------------|
+| RDFTHRIFT |
+| RDFTHRIFT_VALUES |
+
+`RDFTHRIFT_VALUES` is a variant where numeric values are written as values,
+not as lexcial format and datatype. See the
+[description of RDF Thrift](http://afs.github.io/rdf-thrift)
+for details.
+
### RDF/XML
RIOT supports output in RDF/XML. RIOT RDFFormats defaults to pretty printed
RDF/XML,