forked from friendica/php-json-ld
Remove expandSubjects option.
This commit is contained in:
parent
215ceeb331
commit
7124a88b7a
12
jsonld.php
12
jsonld.php
|
@ -1477,11 +1477,10 @@ class JsonLdProcessor
|
||||||
* @param ctx the context.
|
* @param ctx the context.
|
||||||
* @param property the property that points to the value, NULL for none.
|
* @param property the property that points to the value, NULL for none.
|
||||||
* @param value the value to expand.
|
* @param value the value to expand.
|
||||||
* @param expandSubjects true to expand subjects (normalize), false not to.
|
|
||||||
*
|
*
|
||||||
* @return the expanded value.
|
* @return the expanded value.
|
||||||
*/
|
*/
|
||||||
public function expand($ctx, $property, $value, $expandSubjects)
|
public function expand($ctx, $property, $value)
|
||||||
{
|
{
|
||||||
$rval;
|
$rval;
|
||||||
|
|
||||||
|
@ -1504,7 +1503,7 @@ class JsonLdProcessor
|
||||||
$rval = array();
|
$rval = array();
|
||||||
foreach($value as $v)
|
foreach($value as $v)
|
||||||
{
|
{
|
||||||
$rval[] = $this->expand($ctx, $property, $v, $expandSubjects);
|
$rval[] = $this->expand($ctx, $property, $v);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if(is_object($value))
|
else if(is_object($value))
|
||||||
|
@ -1537,7 +1536,7 @@ class JsonLdProcessor
|
||||||
// set object to expanded property
|
// set object to expanded property
|
||||||
_setProperty(
|
_setProperty(
|
||||||
$rval, _expandTerm($ctx, $key, null),
|
$rval, _expandTerm($ctx, $key, null),
|
||||||
$this->expand($ctx, $key, $v, $expandSubjects));
|
$this->expand($ctx, $key, $v));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1589,9 +1588,8 @@ class JsonLdProcessor
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// coerce to appropriate type, only expand subjects if requested
|
// coerce to appropriate type (do not expand subjects)
|
||||||
if($coerce !== null and (
|
if($coerce !== null and $property !== $keywords->{'@subject'})
|
||||||
$property !== $keywords->{'@subject'} or $expandSubjects))
|
|
||||||
{
|
{
|
||||||
$rval = new stdClass();
|
$rval = new stdClass();
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue