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
Original file line number Diff line number Diff line change
Expand Up @@ -1950,16 +1950,13 @@ public function canonicalizeBlankNodes($input)
// sort property lists that now have canonically-named bnodes
foreach($edges->props as $key => $value)
{
if(count($value->bnodes) > 0)
$subject = $subjects->$key;
foreach($subject as $p => $v)
{
$bnode = $subjects->$key;
foreach($bnode as $p => $v)
if(strpos($p, '@id') !== 0 and is_array($v))
{
if(strpos($p, '@') !== 0 and is_array($v))
{
usort($v, '_compareObjects');
$bnode->$p = $v;
}
usort($v, '_compareObjects');
$subject->$p = $v;
}
}
}
Expand Down

0 comments on commit de770b3

Please sign in to comment.