Releases: ruby-rdf/json-ld
Release 3.0.0
Sync with updates from JSON-LD 1.1 Working Group
- Updates maps and term assignment to use
@none
. - Improve inverse context creation and
compact_iri
to use concatenated containers. - Change prioritization for values not matching a container to be after
@none
. - Don't force contents of
@graph
into an array. - Added support for
omitGraph
for framing, defaulting totrue
if processingMode isjson-ld-1.1
- The
omitDefault
flag now defaults tofalse
, and is indepdendent of processing mode. - Change to use
"@vocab": ""
semantics, and vocabulary expansion/compaction just as if the effective document base was specified as@vocab
. - Sort
@type
when looking for scoped contexts. - Make sure multiple objects with
@container: @graph
are maintained as multiple graphs. - Simplify processing mode conflicts to allow mixing different types of contexts.
- Support for lists of lists.
- Raise error if too many recursive contexts loaded.
- Have toRdf emit only valid triples, excluding anything invalid. Literal validity is based on the value being a string, language having the proper form, and datatype IRI being valid.
Release 2.2.0
- Relax dependencies for 3.0 release.
- Support expansion and compaction of simple named graphs (i.e., without an
@id
). - Support containers with both
@graph
and@id
or@index
. - Don't expand native types as IRIs.
- Improve exception messages on invalid framing values when expanding.
Release 2.1.7
Performance optimizations (thanks to @jperville.
Release 2.1.5
- Add support for
compactToRelative
flag. - Make simple_compact_iris the default (remove the option).
- Terms to map to IRIs ending with a gen-delim
(/ . [ ] @ :)
may be used as prefixes (in processingMode 1.1, only for simple term definitions). - Add
@prefix
keyword to expanded term definition in 1.1 processing mode. - Allow empty lists to be compacted using a term with type
@list
.
Release 2.1.3
- Support for Scoped Contexts.
- Term definitions can't have extra keys.
- Add JSON-LD 1.0 error checking on new @container values.
- Support for Property Nesting.
- Support for Type Maps and ID Maps.
Release 2.1.2
- Prep for RDF.rb 2.2 release.
- Include more options in jsonld exe.
- Use Numeric or Integer instead of Fixnum for Ruby 2.4.
- Use RDF::URI instead of RDF::URI.new to avoid automatically turning URIs into hashes during parse.
Release 2.1.1
Updates matching work-in-progress on updated JSON-LD Framing Spec.
- Change processing mode default to
json-ld-1.1
. - Special expansion code when mode is
json-ld-1.1-frame-expansion
. - Fix subject matching when
@type: {}
. - Deep frame matching.
- Support for named graph framing.
- Support list properties when framing.
Also:
- Added
Context.parse
which brings togetherContext.new.parse
.
Release 2.1.0
Version 2.1.0, requires RDF.rb ~> 2.1.
Release 2.0.1
Changes for Framing:
- Add support for
@reverse
in frames. - Add
framing
andkeep_free_floating_nodes
option to expand and use when expanding frame.
Support for pre-loaded contexts
In many cases, for small documents, processing time can be dominated by loading and parsing remote contexts. In particular, a small schema.org
example may need to download a large context and turn it into an internal representation, before the actual document can be expanded for processing. Using JSON::LD::Context.add_preloaded
, an implementation can perform this loading up-front, and make it available to the processor.
ctx = JSON::LD::Context.new().parse('http://schema.org/')
JSON::LD::Context.add_preloaded('http://schema.org/', ctx)
On lookup, URIs with an https
prefix are normalized to http
.
A context may be serialized to Ruby to speed this process using Context#to_rb
. When loaded, this generated file will add entries to the JSON::LD::Context::PRELOADED
.
Use json-ld-preloaded
gem to have popular contexts preloaded (note, this freezes these contexts at the time the gem is built).
- Add
Context::PRELOADED
, andContext.add_preloaded
. When parsing an otherwise loaded context, if it exists inPRELOADED
, use that instead of remotely loading it. Avoids potentially expensive context parsing for common cases. - Generate lazy-loaded Ruby for defining a context from a loaded context. Initializes
Context::PRELOADED
for the context base.
General
- Remove a lot of expensive debugging statements.
- Use frozen string literals
- Minimum Ruby version 2.2.2.
Release 2.0.0
Updates for RDF.rb 2.0
- Add support for
:logger
option for doing debug output and use in specs. - Use RDF::Util::Logger.
- Add expand, compact, flatten and format CLI commands. This duplicates the functionality of the
jsonld
command in therdf
command.