From 642a789eb4ec2597efe6824a6aa4efa0051c5719 Mon Sep 17 00:00:00 2001 From: Dave Longley Date: Thu, 4 Apr 2013 02:10:24 -0400 Subject: [PATCH] Ensure property bnodes are relabeled during flattening. --- jsonld.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/jsonld.php b/jsonld.php index 0ac4cb2..d22bff4 100644 --- a/jsonld.php +++ b/jsonld.php @@ -1,7 +1,7 @@ {$property}; + + // if property is a bnode, assign it a new id + if(strpos($property, '_:') === 0) { + $property = $namer->getName($property); + } + + // ensure property is added for empty arrays if(count($objects) === 0) { self::addValue( $subject, $property, array(), array('propertyIsArray' => true));