forked from friendica/php-json-ld
Handle @type blank node IRIs.
This commit is contained in:
parent
a1f83aaba3
commit
160c1b379a
|
@ -2354,8 +2354,8 @@ class JsonLdProcessor {
|
|||
continue;
|
||||
}
|
||||
|
||||
// copy keywords
|
||||
if(self::_isKeyword($prop)) {
|
||||
// copy non-@type keywords
|
||||
if($prop !== '@type' && self::_isKeyword($prop)) {
|
||||
$subject->{$prop} = $objects;
|
||||
continue;
|
||||
}
|
||||
|
@ -2381,6 +2381,10 @@ class JsonLdProcessor {
|
|||
$this->_flatten($subjects, $o->{'@list'}, $namer, $name, $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
|
||||
self::addValue($subject, $prop, $o, true);
|
||||
|
|
Loading…
Reference in a new issue