本文整理汇总了PHP中MY_Model::rdf方法的典型用法代码示例。如果您正苦于以下问题:PHP MY_Model::rdf方法的具体用法?PHP MY_Model::rdf怎么用?PHP MY_Model::rdf使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MY_Model
的用法示例。
在下文中一共展示了MY_Model::rdf方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: rdf
/**
* Return an RDF object based an a $row
*/
public function rdf($row, $prefix = '')
{
$row->type = isset($row->type) ? $row->type : 'version';
if (isset($row->url)) {
if (!is_array($row->url)) {
$row->url = array($row->url);
}
foreach ($row->url as $key => $value) {
if (!isURL($value)) {
$row->url[$key] = abs_url($value, $prefix);
}
}
}
$rdf = parent::rdf($row, $prefix);
// Blend with RDF from the semantic store
if (!empty($row->rdf)) {
foreach ($row->rdf as $p => $values) {
if (array_key_exists($p, $rdf)) {
// TODO: Not sure we should allow a collision between the semantic and relational tables? For now, don't.
} else {
$rdf[$p] = $values;
}
}
}
return $rdf;
}
示例2: rdf
public function rdf($row, $base_uri = '')
{
if (!isset($row->type) || empty($row->type)) {
$row->type = 'book';
}
return parent::rdf($row, $base_uri);
}
示例3: rdf
public function rdf($row, $base_uri = '')
{
if (!isset($row->type) || empty($row->type)) {
$row->type = 'book';
}
if (isset($row->subtitle) && !empty($row->subtitle)) {
$row->title = $row->title . '<span class="subtitle">: ' . $row->subtitle . '</span>';
}
return parent::rdf($row, $base_uri);
}
示例4: rdf
public function rdf($row, $prefix = '')
{
$row->type = 'http://www.openannotation.org/ns/Annotation';
return parent::rdf($row);
}