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 2016/09/09 12:45:15 UTC
svn commit: r1760000 - in /jena/site/trunk/content/documentation/io:
index.mdtext rdf-binary.md rdf-output.mdtext streaming-io.mdtext
Author: andy
Date: Fri Sep 9 12:45:15 2016
New Revision: 1760000
URL: http://svn.apache.org/viewvc?rev=1760000&view=rev
Log:
Document RDF Binary
Added:
jena/site/trunk/content/documentation/io/rdf-binary.md
Modified:
jena/site/trunk/content/documentation/io/index.mdtext
jena/site/trunk/content/documentation/io/rdf-output.mdtext
jena/site/trunk/content/documentation/io/streaming-io.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=1760000&r1=1759999&r2=1760000&view=diff
==============================================================================
--- jena/site/trunk/content/documentation/io/index.mdtext (original)
+++ jena/site/trunk/content/documentation/io/index.mdtext Fri Sep 9 12:45:15 2016
@@ -22,14 +22,13 @@ can be integrated into both the parser a
- TriG
- N-Quads
- TriX
-- RDF Thrift
+- RDF Binary
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).
+RDF Binary is a binary encoding of RDF (graphs and datasets) that can be useful
+for fast parsing. See [RDF Binary using Apache Thrift](rdf-binary.html).
## Command line tools
Added: jena/site/trunk/content/documentation/io/rdf-binary.md
URL: http://svn.apache.org/viewvc/jena/site/trunk/content/documentation/io/rdf-binary.md?rev=1760000&view=auto
==============================================================================
--- jena/site/trunk/content/documentation/io/rdf-binary.md (added)
+++ jena/site/trunk/content/documentation/io/rdf-binary.md Fri Sep 9 12:45:15 2016
@@ -0,0 +1,113 @@
+Title: RDF Binary using Apache Thrift
+
+"RDF Binary" is a efficient format for RDF and RDF-related data using
+[Apache Thrift](https://thrift.apache.org/) as the binary encoding.
+
+The W3C standard RDF syntaxes are text or XML based. These incur costs in
+parsing; the most human-readable formats also incur high costs to write, and
+have limited scalability due to the need to analyse the data for pretty
+printing rather than simply stream to output.
+
+Binary formats are faster to process - they do not incur the parsing
+costs of text-base formats. "RDF Binary" defines basic encoding for RDF
+terms, then builds data formats for RDF graphs, RDF datasets, and for
+SPARQL result sets. This gives a basis for high-performance linked data
+systems.
+
+[Apache Thrift](https://thrift.apache.org/) provides an efficient,
+wide-used binary encoding layer with a large number of language bindings.
+
+For more details of [RDF Thrift](http://afs.github.io/rdf-thrift).
+
+This pages gives the details of RDF Binary encoding in [Apache Thrift](http://thrift.apache.org/).
+
+## Thrift encoding of RDF Terms {#encoding-terms}
+
+RDF Thrift uses the Thrift compact protocol.
+
+ struct RDF_IRI {
+ 1: required string iri
+ }
+
+ struct RDF_BNode {
+ 1: required string label
+ }
+
+ # Literals, in full form.
+ struct RDF_Literal {
+ 1: required string lex
+ 2: optional string datatype
+ 3: optional string langtag
+ }
+
+ struct RDF_Decimal {
+ 1: required i64 value ;
+ 2: required i32 scale ;
+ }
+
+ struct RDF_VAR {
+ 1: required string name
+ }
+
+ struct RDF_ANY { }
+
+ struct RDF_UNDEF { }
+
+ struct RDF_REPEAT { }
+
+ struct RDF_PrefixDecl {
+ 1: required string prefix ;
+ 2: required string uri ;
+ }
+
+ struct RDF_PrefixName {
+ 1: required string prefix ;
+ 2: required string localName ;
+ }
+
+ union RDF_Term {
+ 1: RDF_IRI iri
+ 2: RDF_BNode bnode
+ 3: RDF_Literal literal
+ 4: RDF_PrefixName prefixName
+ 5: RDF_VAR variable
+ 6: RDF_ANY any
+ 7: RDF_UNDEF undefined
+ 8: RDF_REPEAT repeat
+ # Value forms of literals.
+ 10: i64 valInteger
+ 11: double valDouble
+ 12: RDF_Decimal valDecimal
+ }
+
+## Thrift encoding of Graphs and Datasets {#encoding-graphs-datasets}
+
+ struct RDF_Triple {
+ 1: required RDF_Term S
+ 2: required RDF_Term P
+ 3: required RDF_Term O
+ }
+
+ struct RDF_Quad {
+ 1: required RDF_Term S
+ 2: required RDF_Term P
+ 3: required RDF_Term O
+ 4: optional RDF_Term G
+ }
+
+ union RDF_StreamRow {
+ 1: RDF_PrefixDecl prefixDecl
+ 2: RDF_Triple triple
+ 3: RDF_Quad quad
+ }
+
+## Thrift encoding of SPARQL Result Sets {#encoding-result-sets}
+
+ struct RDF_VarTuple {
+ 1: list<RDF_VAR> vars
+ }
+
+ struct RDF_DataTuple {
+ 1: list<RDF_Term> row
+ }
+
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=1760000&r1=1759999&r2=1760000&view=diff
==============================================================================
--- jena/site/trunk/content/documentation/io/rdf-output.mdtext (original)
+++ jena/site/trunk/content/documentation/io/rdf-output.mdtext Fri Sep 9 12:45:15 2016
@@ -14,7 +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 Binary](#rdf-thrift)
- [RDF/XML](#rdfxml)
- [Examples](#examples)
- [Notes](#notes)
@@ -57,7 +57,7 @@ are available as part of the standard se
* TriG
* NQuads
* TriX
-* RDF Thrift
+* RDF Binary
In addition, there are variants of Trutle, TriG for pretty printing,
streamed output and flat output. RDF/XML has variants for pretty printing
@@ -290,10 +290,11 @@ in ASCII (using `\u` escape sequences fo
| NTRIPLES_ASCII |
| NQUADS_ASCII |
-### RDF Thrift
+### RDF Binary
-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
+[This is a binary encoding](rdf-binary.html) using
+[Apache Thrift](https://thrift.apache.org/) for RDF Graphs
+and RDF Datasets, as well as SPARQL Result Sets, and it provides faster parsing
compared to the text-based standardised syntax such as N-triples, Turtle or RDF/XML.
| RDFFormat |
@@ -304,7 +305,7 @@ compared to the text-based standardised
`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.
+for dsicussion.
### RDF/XML
Modified: jena/site/trunk/content/documentation/io/streaming-io.mdtext
URL: http://svn.apache.org/viewvc/jena/site/trunk/content/documentation/io/streaming-io.mdtext?rev=1760000&r1=1759999&r2=1760000&view=diff
==============================================================================
--- jena/site/trunk/content/documentation/io/streaming-io.mdtext (original)
+++ jena/site/trunk/content/documentation/io/streaming-io.mdtext Fri Sep 9 12:45:15 2016
@@ -5,7 +5,7 @@ fashion. Streaming can be used for manip
provides high performance readers and writers for all standard RDF formats,
and it can be extended with custom formats.
-The [RDF Thrift](http://afs.github.io/rdf-thrift) provides the highest
+The [RDF Binary using Apache Thrift](rdf-binary.html) provides the highest
input parsing performance. N-Triples/N-Quads provide the highest
input parsing performance using W3C Standards.