RE: Expansion Algorithm

> >> 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