From 18e29349818921c9dd48372afcb9cec30259f70e Mon Sep 17 00:00:00 2001 From: Dave Longley Date: Mon, 30 Apr 2012 22:15:09 -0400 Subject: [PATCH] Sort RDF statement output. --- jsonld.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/jsonld.php b/jsonld.php index b23dd06..f02f057 100644 --- a/jsonld.php +++ b/jsonld.php @@ -483,11 +483,12 @@ class JsonLdProcessor { if(isset($options['format'])) { // supported formats if($options['format'] === 'application/nquads') { - $nquads = ''; + $nquads = array(); foreach($statements as $statement) { - $nquads .= $this->_toNQuad($statement); + $nquads[] = $this->_toNQuad($statement); } - $statements = $nquads; + sort($nquads); + $statements = implode($nquads); } else { throw new JsonLdException(