Skip to content

Move expansion step 13.15 to out of the loop to step 14. #272

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Dec 24, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 26 additions & 12 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2958,19 +2958,28 @@ <h3>Algorithm</h3>
<a>entry</a> of <var>result</var>.</li>
</ol>
</li>
<li class="changed">For each key <var>nesting-key</var> in <var>nests</var>
</ol>
</li>
<li id="alg-expand-resolve-nest" class="changed">For each key <var>nesting-key</var> in <var>nests</var>
<ol>
<li>Initialize <var>nested values</var> to the value of <var>nesting-key</var>
in <var>element</var>, ensuring that it is an <a>array</a>.</li>
<li>For each <var>nested value</var> in <var>nested values</var>:
<ol>
<li>Initialize <var>nested values</var> to the value of <var>nesting-key</var>
in <var>element</var>, ensuring that it is an <a>array</a>.</li>
<li>For each <var>nested value</var> in <var>nested values</var>:
<ol>
<li>If <var>nested value</var> is not a <a>map</a>, or any key within
<var>nested value</var> expands to <code>@value</code>, an
<a data-link-for="JsonLdErrorCode">invalid @nest value</a> error
has been detected and processing is aborted.</li>
<li>Recursively repeat <a href="#alg-expand-each-key-value">step 13</a>
using <var>nested value</var> for <var>element</var>.</li>
</ol>
<li>If <var>nested value</var> is not a <a>map</a>, or any key within
<var>nested value</var> expands to <code>@value</code>, an
<a data-link-for="JsonLdErrorCode">invalid @nest value</a> error
has been detected and processing is aborted.</li>
<li>Recursively repeat steps <a href="#alg-expand-each-key-value">13</a>
and <a href="#alg-expand-resolve-nest">14</a>
using <var>nested value</var> for <var>element</var>.
<div class="note">By invoking steps <a href="#alg-expand-each-key-value">13</a>
and <a href="#alg-expand-resolve-nest">14</a> on <var>nested value</var>
we are able to unfold arbitrary levels of nesting, with results being merged into
<var>result</var>.
Step <a href="#alg-expand-each-key-value">13</a> iterates through each
entry in <var>nested value</var> and expands it, while collecting new
<var>nested values</var> found at each level, until all nesting has been extracted.</div>
</li>
</ol>
</li>
Expand Down Expand Up @@ -6938,6 +6947,11 @@ <h2>Changes since Candidate Release of 12 December 2019</h2>
<li>Added missing keywords to step <a href="#ctd-invalid-entries">28</a> of the
<a href="#create-term-definition">Create Term Definition algorithm</a>.
This is in response to <a href="https://github.com/w3c/json-ld-api/issues/261">Issue 261</a>.</li>
<li>Move step 13.15 of the expansion algorithm up one level to step <a href="#alg-expand-resolve-nest">14</a> of the
<a href="#expansion-algorithm">Expansion algorithm</a>,
as it had accidentally been set to run for every entry in the object, rather than
after all entries had been expanded.
This is in response to <a href="https://github.com/w3c/json-ld-api/issues/262">Issue 262</a>.</li>
<li>Improved text in step <a href="#alg-expand-container-mapping-type">13.8.3.7.5</a>
of the <a href="#expansion-algorithm">Expansion algorithm</a> to exclude
the <var>expanded index</var> being `@none`.
Expand Down