From fda8545943ef3d6742a335b1a4b2e2a502a9fe64 Mon Sep 17 00:00:00 2001 From: Dave Longley Date: Sun, 17 Feb 2013 13:38:55 -0500 Subject: [PATCH] Use '_:b' instead of '_:t' for bnode prefixes. --- jsonld.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/jsonld.php b/jsonld.php index ec59553..121b0cb 100644 --- a/jsonld.php +++ b/jsonld.php @@ -897,7 +897,7 @@ class JsonLdProcessor { } // get RDF statements - $namer = new UniqueNamer('_:t'); + $namer = new UniqueNamer('_:b'); $statements = array(); $this->_toRDF($expanded, $namer, null, null, null, $statements); @@ -2050,7 +2050,7 @@ class JsonLdProcessor { */ protected function _flatten($input) { // produce a map of all subjects and name each bnode - $namer = new UniqueNamer('_:t'); + $namer = new UniqueNamer('_:b'); $graphs = (object)array('@default' => new stdClass()); $this->_createNodeMap($input, $graphs, '@default', $namer); @@ -2106,7 +2106,7 @@ class JsonLdProcessor { // produce a map of all graphs and name each bnode // FIXME: currently uses subjects from @merged graph only - $namer = new UniqueNamer('_:t'); + $namer = new UniqueNamer('_:b'); $this->_createNodeMap($input, $state->graphs, '@merged', $namer); $state->subjects = $state->graphs->{'@merged'}; @@ -2130,7 +2130,7 @@ class JsonLdProcessor { // map bnodes to RDF statements $statements = array(); $bnodes = new stdClass(); - $namer = new UniqueNamer('_:t'); + $namer = new UniqueNamer('_:b'); $this->_toRDF($input, $namer, null, null, null, $statements); foreach($statements as $statement) { foreach(array('subject', 'object', 'name') as $node) { @@ -2202,7 +2202,7 @@ class JsonLdProcessor { } // hash bnode paths - $path_namer = new UniqueNamer('_:t'); + $path_namer = new UniqueNamer('_:b'); $path_namer->getName($bnode); $results[] = $this->_hashPaths($bnode, $bnodes, $namer, $path_namer); } @@ -4666,7 +4666,7 @@ class JsonLdProcessor { protected function _getInitialContext($options) { $namer = null; if(isset($options['renameBlankNodes']) && $options['renameBlankNodes']) { - $namer = new UniqueNamer('_:t'); + $namer = new UniqueNamer('_:b'); } return (object)array( '@base' => jsonld_parse_url($options['base']), @@ -4838,7 +4838,7 @@ class JsonLdProcessor { $rval->keywords = $active_ctx->keywords; $rval->mappings = $active_ctx->mappings; if($active_ctx->namer !== null) { - $rval->namer = new UniqueNamer('_:t'); + $rval->namer = new UniqueNamer('_:b'); } $rval->inverse = $active_ctx->inverse; return $rval;