Skip to content

Commit

Permalink
Sort all properties except @id in normalization.
Browse files Browse the repository at this point in the history
  • Loading branch information
dlongley committed Mar 4, 2012
1 parent ab71b33 commit de770b3
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions jsonld.php
Expand Up @@ -1950,16 +1950,13 @@ public function canonicalizeBlankNodes($input)
// sort property lists that now have canonically-named bnodes // sort property lists that now have canonically-named bnodes
foreach($edges->props as $key => $value) foreach($edges->props as $key => $value)
{ {
if(count($value->bnodes) > 0) $subject = $subjects->$key;
foreach($subject as $p => $v)
{ {
$bnode = $subjects->$key; if(strpos($p, '@id') !== 0 and is_array($v))
foreach($bnode as $p => $v)
{ {
if(strpos($p, '@') !== 0 and is_array($v)) usort($v, '_compareObjects');
{ $subject->$p = $v;
usort($v, '_compareObjects');
$bnode->$p = $v;
}
} }
} }
} }
Expand Down

0 comments on commit de770b3

Please sign in to comment.