diff --git a/jsonld.php b/jsonld.php index db87931..d08aaca 100644 --- a/jsonld.php +++ b/jsonld.php @@ -1,7 +1,7 @@ $local_ctx)); } - // add @id to mapping - $mapping->{'@id'} = $this->_expandIri( - $active_ctx, $id, array('vocab' => true, 'base' => true), - $local_ctx, $defined); + if($id !== $term) { + // add @id to mapping + $mapping->{'@id'} = $this->_expandIri( + $active_ctx, $id, array('vocab' => true, 'base' => true), + $local_ctx, $defined); + } } - else { + + if(!property_exists($mapping, '@id')) { // see if the term has a prefix $colon = strpos($term, ':'); if($colon !== false) {