Permalink
Browse files

Sort all properties except @id in normalization.

  • Loading branch information...
1 parent ab71b33 commit de770b30fd63b7034c3e268cca643078cbb52603 @dlongley dlongley committed Mar 4, 2012
Showing with 5 additions and 8 deletions.
  1. +5 −8 jsonld.php
View
@@ -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;
}
}
}

0 comments on commit de770b3

Please sign in to comment.