Alternative JSON-LD Algorithms

I had mentioned that I had updated my processor to pass all (that I agree with anyway) of the tests using algorithms that were much closer to the earlier algorithms. You can find my alternative version of JSON-LD Algorithms here [1].

I couldn't have done this work without the excellent work of Markus in updating the spec. However, now that the API and the algorithms are separate, I think it's best if the algorithms are more descriptive then descriptive, so I've moved may of the places where exceptions should be raised (or errors returned) with MUST or MUST NOT language. Also, I was able describe things fairly simply without the use of an Inverse Context, but I did adopt much of the term definition nomenclature Marks introduced.

Expansion: This ends up being pretty much the same as Markus', without exceptions and some additional simplifications.

Context Processing: Also similar, but only uses an updating local context, and is more descriptive in the calls to Expand IRI. Also, note that it's not necessary that expansion result in an absolute IRI, as that is done recursively in Expand IRI when called from a different algorithm, allowing for terms to be defined WRT other terms.

IRI Expansion: This is more like the original algorithm, but simplified with recursion, and normative language about not continuing to expand the same term recursively, rather than using flags or a path array.

Value Expansion, Label Blank Nodes, Generate Blank Node Identifier: unchanged.

Compaction Algorithm: Much closer to the original algorithm, with added iteration over property generators.

IRI Compaction: Back to the original, including the use of Term Rank

Term Rank: Minor updates to original.

The <SHIFT><CTRL>-S key-combination will diff my version against the Dec 25th version of the spec, including most of Markus' recent changes.

Gregg Kellogg
gregg@greggkellogg.net

[1] http://json-ld.org/spec/latest/json-ld-api/alternate.html

Received on Monday, 7 January 2013 01:37:41 UTC