W3C home > Mailing lists > Public > public-linked-json@w3.org > June 2018

Re: expansion algorithm 5.1.2.7

From: Gregg Kellogg <gregg@greggkellogg.com>
Date: Fri, 22 Jun 2018 14:22:41 -0700
Cc: public-linked-json@w3.org
Message-Id: <44677B65-90EE-4199-A12E-EF9054CF8EDE@greggkellogg.com>
To: Dorian Taylor <dorian.taylor.lists@gmail.com>
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

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