Re: expansion algorithm 5.1.2.7

On Jun 22, 2018, at 2:15 PM, Dorian Taylor <dorian.taylor.lists@gmail.com> wrote:
> 
> Hello list,
> 
> I’m in the middle of implementing the expansion algorithm <https://json-ld.org/spec/latest/json-ld-api/#algorithm-2>. §5.1.2.7 is a bit confusing:
> 
> • For each key/value pair in element where key expands to @type using the IRI Expansion algorithm, passing active context, key for value, and true for vocab:
>    • For each term which is a value of value ordered lexicographically, if term's term definition in active context has a local context, set active context to the result to the result of the Context Processing algorithm, passing active context and the value of the term's local context as local context.
> 
> I read this as:
> 
> • iterate over object keys, IRI-expanding as you go
> • if a key evaluates to `@type`, then its value should be one or more terms which are ultimately supposed to represent rdfs:Class resources (I assume we coerce this into an array?)

Any such inference is at the RDFS layer. For processing, you may find it easier to coerce most things to arrays, but that’s up to your implementation. 

> and now, the part that I’m not so sure about:
> 
> • sort the type/class term(s) lexicographically
> • check the active context for mappings for these terms
> • if any matching term definitions are found to contain an embedded context, supplant the active context with a merged copy.
> 
> Did I read that right?

Sounds about right. 

Gregg

> --
> Dorian Taylor
> Make things. Make sense.
> https://doriantaylor.com
> 

Received on Friday, 22 June 2018 21:23:09 UTC