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

RE: Expansion Algorithm

From: Markus Lanthaler <markus.lanthaler@gmx.net>
Date: Sun, 4 Dec 2011 15:11:52 +0800
To: "'Linked JSON'" <public-linked-json@w3.org>
Cc: "'Gregg Kellogg'" <gregg@kellogg-assoc.com>
Message-ID: <005101ccb254$02961910$07c24b30$@lanthaler@gmx.net>
> >> Object expansion should expand every value, not just those that have
> >> keys that are subject to datatype or list coercion. Some examples:
> >
> > What exactly do you mean by "should expand every value"?
> 
> As stated, the algorithm recurses through arrays to objects or strings,
> for objects, expands values of keys, only if the key is the target of a
> @datatype coercion in the context. Thus, if "foo" => "bar", and "foo"
> was declared with an IRI datatype, it would expand "bar" into an IRI.

OK, now I've understood what you meant. Thanks


> But, looking at the algorithm again, I think my examples are mostly
> covered. The remaining issues have to do with values that are not
> arrays or objects. Also, it should be clear that the determination of
> key coercion caries through to @list, @iri, @datatype and array
> processing.
> 
> 1) Does {"foaf:age": 54} cause 54 to be expanded to {"@literal": "54",
> "@datatype": "xsd:string}. IMO, I think that non-string types such as
> boolean, integer and numeric are not subject to expansion, in spite of
> any coercion.

.. but it should be expanded when normalizing a document.


> 2) {"foaf:homepage", {"@iri": "ex:home"} should cause "ex:home" to be
> expanded, whether or not "foaf:homepage" is subject to  coercion

Agree


> 3) {"@subject": "ex:home", "@type": "foaf:Document"} should cause both
> "ex:home" and "foaf:Document" to be expanded

Agree


> 4) {"foo": ["ex:bar", "ex:baz"]} should cause all or none of  ex:bar
> and ex:baz to be expanded, depending on coercion rules for "foo". This
> isn't clear now, as when doing array expansion, there's no discussion
> of a "closest" key.

If "foo" is coerced to @iri then all the array item should be expanded,
otherwise none.


> 5) {"foo": {"@list": ["ex:bar", "ex:baz"]}, same argument as for 4).

Same here, just if "foo" is coerced to @iri.



--
Markus Lanthaler
@markuslanthaler
Received on Sunday, 4 December 2011 07:12:30 UTC

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