From 232afca21df67bbdc0120384182f66490ce0d643 Mon Sep 17 00:00:00 2001 From: Dave Longley Date: Wed, 20 Feb 2013 19:32:50 -0500 Subject: [PATCH] Ensure @language and @vocab are copied from active context. --- jsonld.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/jsonld.php b/jsonld.php index e333895..75f8db3 100644 --- a/jsonld.php +++ b/jsonld.php @@ -4956,6 +4956,12 @@ class JsonLdProcessor { $child->mappings = self::copy($active_ctx->mappings); $child->namer = $active_ctx->namer; $child->inverse = null; + if(property_exists($active_ctx, '@language')) { + $child->{'@language'} = $active_ctx->{'@language'}; + } + if(property_exists($active_ctx, '@vocab')) { + $child->{'@vocab'} = $active_ctx->{'@vocab'}; + } return $child; } @@ -4977,6 +4983,12 @@ class JsonLdProcessor { $rval->namer = new UniqueNamer('_:b'); } $rval->inverse = $active_ctx->inverse; + if(property_exists($active_ctx, '@language')) { + $rval->{'@language'} = $active_ctx->{'@language'}; + } + if(property_exists($active_ctx, '@vocab')) { + $rval->{'@vocab'} = $active_ctx->{'@vocab'}; + } return $rval; }