Skip to content

Commit

Permalink
Update flatten algorithm to not generate nodes containing only @id.
Browse files Browse the repository at this point in the history
  • Loading branch information
gkellogg committed Jul 21, 2013
1 parent d59968f commit cd397a5
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions spec/latest/json-ld-api/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2829,12 +2829,14 @@ <h3>Algorithm</h3>
<li>Add an <code>@graph</code> member to <i>entry</i> and set it to an
empty <tref>array</tref>.</li>
<li>For each <i>id</i>-<i>node</i> pair in <i>graph</i> ordered by <i>id</i>,
add <i>node</i> to the <code>@graph</code> member of <i>entry</i>.</li>
add <i>node</i> to the <code>@graph</code> member of <i>entry</i>,
unless the only member of <i>node</i> is <code>@id</code>.</li>
</ol>
</li>
<li>Initialize an empty <tref>array</tref> <i>flattened</i>.</li>
<li>For each <i>id</i>-<i>node</i> pair in <i>default graph</i> ordered by <i>id</i>,
add <i>node</i> to <i>flattened</i>.</li>
add <i>node</i> to <i>flattened</i>,
unless the only member of <i>node</i> is <code>@id</code>.</li>
<li>If <i>context</i> is <tref>null</tref>, return <i>flattened</i>.</li>
<li>Otherwise, return the result of compacting <i>flattened</i> according the
<a href="#compaction-algorithm">Compaction algorithm</a> passing <i>context</i>
Expand Down Expand Up @@ -2911,9 +2913,6 @@ <h3>Algorithm</h3>
<li>If <i>item</i> is a <tref>blank node identifier</tref>, replace it with a newly
<a href="#generate-blank-node-identifier">generated blank node identifier</a>
passing <i>item</i> for <i>identifier</i>.</li>
<li>If <i>graph</i> has no member <i>item</i>, create one and initialize its
value to a <tref>JSON object</tref> consisting of a single member <code>@id</code>
whose value is <i>item</i>.</li>
</ol>
</li>
<li>If <i>element</i> has an <code>@value</code> member, perform the following steps:
Expand Down

0 comments on commit cd397a5

Please sign in to comment.