README.md in json-ld-1.1.7 vs README.md in json-ld-1.1.8
- old
+ new
@@ -11,10 +11,16 @@
JSON::LD can now be used to create a _context_ from an RDFS/OWL definition, and optionally include a JSON-LD representation of the ontology itself. This is currently accessed through the `script/gen_context` script.
Install with `gem install json-ld`
+### JSON-LD Streaming Profile
+This gem implements an optimized streaming writer used for generating JSON-LD from large repositories. Such documents result in the JSON-LD Streaming Profile:
+
+* Each statement written as a separate node in expanded/flattened form.
+* RDF Lists are written as separate nodes using `rdf:first` and `rdf:rest` properties.
+
## Examples
require 'rubygems'
require 'json/ld'
@@ -163,11 +169,11 @@
})
graph = RDF::Graph.new << JSON::LD::API.toRdf(input)
require 'rdf/turtle'
- graph.dump(:ttl, :prefixes => {:foaf => "http://xmlns.com/foaf/0.1/"})
+ graph.dump(:ttl, prefixes: {foaf: "http://xmlns.com/foaf/0.1/"})
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
<http://example.org/people#joebob> a foaf:Person;
foaf:name "Joe Bob";
foaf:nick ("joe" "bob" "jaybe") .
@@ -211,11 +217,11 @@
]
## RDF Reader and Writer
{JSON::LD} also acts as a normal RDF reader and writer, using the standard RDF.rb reader/writer interfaces:
- graph = RDF::Graph.load("etc/doap.jsonld", :format => :jsonld)
- graph.dump(:jsonld, :standard_prefixes => true)
+ graph = RDF::Graph.load("etc/doap.jsonld", format: :jsonld)
+ graph.dump(:jsonld, standard_prefixes: true)
`RDF::GRAPH#dump` can also take a `:context` option to use a separately defined context
As JSON-LD may come from many different sources, included as an embedded script tag within an HTML document, the RDF Reader will strip input before the leading `{` or `[` and after the trailing `}` or `]`.