本文整理匯總了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);
}
}