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

expansion algorithm 5.1.2.7

From: Dorian Taylor <dorian.taylor.lists@gmail.com>
Date: Fri, 22 Jun 2018 14:15:00 -0700
Message-Id: <D4775CA1-91B1-4A36-90D6-E143711A5449@gmail.com>
To: public-linked-json@w3.org
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?)

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?

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


Received on Friday, 22 June 2018 21:15:30 UTC

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