Sort subjects and properties in toRDF.

This commit is contained in:
Dave Longley 2013-06-06 22:12:49 -04:00
parent 5be8e20433
commit f775f8ceda
1 changed files with 9 additions and 3 deletions

View File

@ -1,7 +1,7 @@
<?php
/**
* PHP implementation of the JSON-LD API.
* Version: 0.0.34
* Version: 0.0.35
*
* @author Dave Longley
*
@ -2943,8 +2943,14 @@ class JsonLdProcessor {
protected function _graphToRDF($graph, $namer) {
$rval = array();
foreach($graph as $id => $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;
}