本文整理汇总了PHP中Statement::object方法的典型用法代码示例。如果您正苦于以下问题:PHP Statement::object方法的具体用法?PHP Statement::object怎么用?PHP Statement::object使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Statement
的用法示例。
在下文中一共展示了Statement::object方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: generateResultStatementsFromVarResult
function generateResultStatementsFromVarResult(&$result, $parsedq, &$outm, $closure, &$model)
{
foreach ($parsedq['patterns'] as $n => $pattern) {
if (substr($pattern['subject']['value'], 0, 1) == '?') {
$subj = $result[$pattern['subject']['value']];
} else {
$subj = new Resource($pattern['subject']['value']);
}
if (substr($pattern['predicate']['value'], 0, 1) == '?') {
$pred = $result[$pattern['predicate']['value']];
} else {
$pred = new Resource($pattern['predicate']['value']);
}
if (substr($pattern['object']['value'], 0, 1) == '?') {
$obj = $result[$pattern['object']['value']];
} else {
if ($pattern['object']['is_literal']) {
$obj = new Literal($pattern['object']['value']);
$obj->setDatatype($pattern['object']['l_dtype']);
$obj->setLanguage($pattern['object']['l_lang']);
} else {
$obj = new Resource($pattern['object']['value']);
}
}
$stmt = new Statement($subj, $pred, $obj);
// bNode closure
if (is_a($stmt->object(), 'BlankNode') && $closure == True) {
getBNodeClosure($stmt->object(), $model, $outm);
}
if (is_a($stmt->subject(), 'BlankNode') && $closure == True) {
getBNodeClosure($stmt->subject(), $model, $outm);
}
// Add statement to model
$outm->add($stmt);
}
}