diff --git a/jsonld.php b/jsonld.php index ee2bfde..d07f780 100644 --- a/jsonld.php +++ b/jsonld.php @@ -1,7 +1,7 @@ $node) { - foreach($node as $property => $items) { + $ids = array_keys((array)$graph); + sort($ids); + foreach($ids as $id) { + $node = $graph->{$id}; + $properties = array_keys((array)$node); + sort($properties); + foreach($properties as $property) { + $items = $node->{$property}; if($property === '@type') { $property = self::RDF_TYPE; }