From 96e20e4afed5e86f1d1bbc180ee77e8334c4a887 Mon Sep 17 00:00:00 2001 From: Dave Longley Date: Tue, 6 Aug 2013 13:46:56 -0400 Subject: [PATCH] Do not add subject-references at top-level. --- jsonld.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/jsonld.php b/jsonld.php index 6461aff..ecb3d02 100644 --- a/jsonld.php +++ b/jsonld.php @@ -2770,11 +2770,17 @@ class JsonLdProcessor { foreach($subjects_ as $subject_) { $node_ = $graph_object->{$subject_}; unset($node_->listHeadFor); - $node->{'@graph'}[] = $node_; + // only add full subjects to top-level + if(!self::_isSubjectReference($node_)) { + $node->{'@graph'}[] = $node_; + } } } unset($node->listHeadFor); - $result[] = $node; + // only add full subjects to top-level + if(!self::_isSubjectReference($node)) { + $result[] = $node; + } } return $result;