Handle @type blank node IRIs.

This commit is contained in:
Dave Longley 2012-05-21 17:41:38 -04:00
parent a1f83aaba3
commit 160c1b379a

View file

@ -2354,8 +2354,8 @@ class JsonLdProcessor {
continue; continue;
} }
// copy keywords // copy non-@type keywords
if(self::_isKeyword($prop)) { if($prop !== '@type' && self::_isKeyword($prop)) {
$subject->{$prop} = $objects; $subject->{$prop} = $objects;
continue; continue;
} }
@ -2381,6 +2381,10 @@ class JsonLdProcessor {
$this->_flatten($subjects, $o->{'@list'}, $namer, $name, $l); $this->_flatten($subjects, $o->{'@list'}, $namer, $name, $l);
$o = (object)array('@list' => (array)$l); $o = (object)array('@list' => (array)$l);
} }
// special-handle @type blank nodes
else if($prop === '@type' && strpos($o, '_:') === 0) {
$o = $namer->getName($o);
}
// add non-subject // add non-subject
self::addValue($subject, $prop, $o, true); self::addValue($subject, $prop, $o, true);