Ensure expanded frame is properly traversed for @list.
This commit is contained in:
parent
7c7b9ae3be
commit
090183dccc
22
jsonld.php
22
jsonld.php
|
@ -3300,13 +3300,13 @@ class JsonLdProcessor {
|
||||||
if(property_exists($input, '@type')) {
|
if(property_exists($input, '@type')) {
|
||||||
$type = $input->{'@type'};
|
$type = $input->{'@type'};
|
||||||
// rename @type blank node
|
// rename @type blank node
|
||||||
if(strpos($type, '_:') === 0) {
|
if(strpos($type, '_:') === 0) {
|
||||||
$type = $input->{'@type'} = $namer->getName($type);
|
$type = $input->{'@type'} = $namer->getName($type);
|
||||||
}
|
|
||||||
if(!property_exists($graphs->{$graph}, $type)) {
|
|
||||||
$graphs->{$graph}->{$type} = (object)array('@id' => $type);
|
|
||||||
}
|
}
|
||||||
}
|
if(!property_exists($graphs->{$graph}, $type)) {
|
||||||
|
$graphs->{$graph}->{$type} = (object)array('@id' => $type);
|
||||||
|
}
|
||||||
|
}
|
||||||
if($list !== null) {
|
if($list !== null) {
|
||||||
$list[] = $input;
|
$list[] = $input;
|
||||||
}
|
}
|
||||||
|
@ -3412,10 +3412,10 @@ class JsonLdProcessor {
|
||||||
foreach($objects as $o) {
|
foreach($objects as $o) {
|
||||||
if($property === '@type') {
|
if($property === '@type') {
|
||||||
// rename @type blank nodes
|
// rename @type blank nodes
|
||||||
$o = (strpos($o, '_:') === 0) ? $namer->getName($o) : $o;
|
$o = (strpos($o, '_:') === 0) ? $namer->getName($o) : $o;
|
||||||
if(!property_exists($graphs->{$graph}, $o)) {
|
if(!property_exists($graphs->{$graph}, $o)) {
|
||||||
$graphs->{$graph}->{$o} = (object)array('@id' => $o);
|
$graphs->{$graph}->{$o} = (object)array('@id' => $o);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// handle embedded subject or subject reference
|
// handle embedded subject or subject reference
|
||||||
|
@ -3563,7 +3563,7 @@ class JsonLdProcessor {
|
||||||
// recurse into subject reference
|
// recurse into subject reference
|
||||||
if(self::_isSubjectReference($o)) {
|
if(self::_isSubjectReference($o)) {
|
||||||
$this->_matchFrame(
|
$this->_matchFrame(
|
||||||
$state, array($o->{'@id'}), $frame->{$prop},
|
$state, array($o->{'@id'}), $frame->{$prop}[0]->{'@list'},
|
||||||
$list, '@list');
|
$list, '@list');
|
||||||
}
|
}
|
||||||
// include other values automatically
|
// include other values automatically
|
||||||
|
|
Loading…
Reference in a new issue