diff --git a/jsonld.php b/jsonld.php index 24843a7..5273026 100644 --- a/jsonld.php +++ b/jsonld.php @@ -1679,7 +1679,6 @@ class JsonLdProcessor { // if element has a context, process it if(property_exists($element, '@context')) { $active_ctx = $this->_processContext($active_ctx, $element->{'@context'}, $options); - unset($element->{'@context'}); } // expand the active property @@ -1692,6 +1691,10 @@ class JsonLdProcessor { foreach($keys as $key) { $value = $element->{$key}; + if($key === '@context') { + continue; + } + // get term definition for key if(property_exists($active_ctx->mappings, $key)) { $mapping = $active_ctx->mappings->{$key};