Ensure vocab relative flag is passed when expanding properties.

This commit is contained in:
Dave Longley 2013-02-15 14:13:46 -05:00
parent bea64fee03
commit fdc08dc903

View file

@ -1762,7 +1762,7 @@ class JsonLdProcessor {
// expand the active property // expand the active property
$expanded_active_property = $this->_expandIri( $expanded_active_property = $this->_expandIri(
$active_ctx, $active_property); $active_ctx, $active_property, array('vocab' => true));
$rval = new stdClass(); $rval = new stdClass();
$keys = array_keys((array)$element); $keys = array_keys((array)$element);
@ -2032,7 +2032,8 @@ class JsonLdProcessor {
// drop top-level scalars that are not in lists // drop top-level scalars that are not in lists
if(!$inside_list && if(!$inside_list &&
($active_property === null || ($active_property === null ||
$this->_expandIri($active_ctx, $active_property) === '@graph')) { $this->_expandIri($active_ctx, $active_property,
array('vocab' => true)) === '@graph')) {
return null; return null;
} }
@ -4048,7 +4049,8 @@ class JsonLdProcessor {
} }
// value is a subject reference // value is a subject reference
$expanded_property = $this->_expandIri($active_ctx, $active_property); $expanded_property = $this->_expandIri(
$active_ctx, $active_property, array('vocab' => true));
$type = self::getContextValue($active_ctx, $active_property, '@type'); $type = self::getContextValue($active_ctx, $active_property, '@type');
$compacted = $this->_compactIri( $compacted = $this->_compactIri(
$active_ctx, $value->{'@id'}, null, $active_ctx, $value->{'@id'}, null,