From 7cf02461cc55e29171ae28fd3ea24f7aff2d6f13 Mon Sep 17 00:00:00 2001 From: Dave Longley Date: Fri, 15 Jun 2012 10:24:41 -0400 Subject: [PATCH] Fix nquads output for graph w/bnode ID. --- jsonld.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/jsonld.php b/jsonld.php index 4238b5f..4391789 100644 --- a/jsonld.php +++ b/jsonld.php @@ -1041,8 +1041,16 @@ class JsonLdProcessor { } // graph - if($g !== null) { - $quad .= " <{$g->nominalValue}>"; + if($g !== null) { + if($g->interfaceName === 'IRI') { + $quad .= " <{$g->nominalValue}>"; + } + else if(bnode) { + $quad += ' _:g'; + } + else { + $quad += " {$g->nominalValue}"; + } } $quad .= " .\n";