From ec6b4d7383bcd4c6dfe4f9cc8250aefd0d7aa158 Mon Sep 17 00:00:00 2001 From: Dave Longley Date: Fri, 9 Aug 2013 13:42:31 -0400 Subject: [PATCH] Fix type, check for datatype. --- jsonld.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/jsonld.php b/jsonld.php index cf22929..fe9b7b7 100644 --- a/jsonld.php +++ b/jsonld.php @@ -2447,7 +2447,7 @@ class JsonLdProcessor { foreach($keys as $key) { $node = $default_graph->{$key}; // only add full subjects to top-level - if(self::_isSubjectReference($node)) { + if(!self::_isSubjectReference($node)) { $flattened[] = $node; } } @@ -3928,7 +3928,8 @@ class JsonLdProcessor { $t1->object->language !== $t2->object->language) { return false; } - if($t1->object->datatype !== $t2->object->datatype) { + if(property_exists($t1->object, 'datatype') && + $t1->object->datatype !== $t2->object->datatype) { return false; } return true;