W3C home > Mailing lists > Public > public-linked-json@w3.org > November 2011

Expansion Algorithm

From: Gregg Kellogg <gregg@kellogg-assoc.com>
Date: Mon, 28 Nov 2011 22:41:34 -0500
To: Linked JSON <public-linked-json@w3.org>
Message-ID: <6AA4F5DA-E2B8-4F35-B942-06F310B877BF@greggkellogg.net>
I've been implementing the Value Expansion algorithm, and I think that the procedure is somewhat incomplete.

Basically, the algorithm considers three cases, Arrays, Objects and everything else.

Array expansion needs to consider that there might be a @list coercion. However, as a corner case, lists within lists probably shouldn't be expanded, since it is unambiguous that they represent a list. This is an unlikely corner case, and we could go either way. Basically, I implement the following:

* (as currently stated) process each item in the array recursively using this algorithm
* If the associated key has a @list coercion rule, wrap the array in an an object with a '@list' key referencing the expanded array.

Object expansion should expand every value, not just those that have keys that are subject to datatype or list coercion. Some examples:

	{"@iri": "foaf:Person"} -- needs to expand to a full IRI
	{"@list": ["a"]} -- needs to expand list contents
	{"@literal": "1", "@datatype": "xsd:string"} -- needs to expand the datatype IRI
	@subject, @type, @iri -- need to have values expanded, even though they're not coerced themselves

Also, native types such as Integer, Boolean and Double/Decimal should probably be expanded to an explicit literal form. We need to provide a reference to the normalized form lexical form for each of these datatypes as well.

There's also the question of resolving relative IRIs: mostly, they should be resolved against @base, but @type should be resolved against @vocab.

I can make the spec changes, but I want to be sure that this is generally accepted.

Received on Tuesday, 29 November 2011 03:42:27 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 16:18:32 UTC