diff --git a/jsonld.php b/jsonld.php index a3320d3..cdab68a 100644 --- a/jsonld.php +++ b/jsonld.php @@ -4601,6 +4601,14 @@ class JsonLdProcessor { continue; } + // add term selection where it applies + if(property_exists($mapping, '@container')) { + $container = $mapping->{'@container'}; + } + else { + $container = '@none'; + } + // iterate over every IRI in the mapping $iris = $mapping->{'@id'}; $iris = self::arrayify($iris); @@ -4611,14 +4619,6 @@ class JsonLdProcessor { } $container_map = $inverse->{$iri}; - // add term selection where it applies - if(property_exists($mapping, '@container')) { - $container = $mapping->{'@container'}; - } - else { - $container = '@none'; - } - // add new entry if(!property_exists($container_map, $container)) { $container_map->{$container} = (object)array(