本文整理汇总了PHP中MemModel::addParsedNamespaces方法的典型用法代码示例。如果您正苦于以下问题:PHP MemModel::addParsedNamespaces方法的具体用法?PHP MemModel::addParsedNamespaces怎么用?PHP MemModel::addParsedNamespaces使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MemModel
的用法示例。
在下文中一共展示了MemModel::addParsedNamespaces方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: MemModel
/**
* Create a MemModel containing all the triples (including inferred
* statements) of the current InfModelF.
*
* @return object MemModel
* @access public
*/
function &getMemModel()
{
$return = new MemModel();
$return->setBaseURI($this->baseURI);
foreach ($this->triples as $statement) {
$return->add($statement);
}
$return->addParsedNamespaces($this->getParsedNamespaces());
return $return;
}
示例2: MemModel
/**
* Convert an ADORecordSet to a memory Model.
*
* Every successful database query returns an ADORecordSet object which is actually
* a cursor that holds the current row in the array fields[].
* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
* !!! This method can only be applied to a RecordSet with array fields[]
* !!! containing a representation of the database table: statements,
* !!! with an index corresponding to following table columns:
* !!! [0] - subject, [1] - predicate, [2] - object, [3] - l_language,
* !!! [4] - l_datatype, [5] - subject_is, [6] - object_is
* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
*
* @param object ADORecordSet
* @return object MemModel
* @access private
*/
function _convertRecordSetToMemModel(&$recordSet)
{
$res = new MemModel($this->baseURI);
while (!$recordSet->EOF) {
// subject
if ($recordSet->fields[5] == 'r') {
$sub = new Resource($recordSet->fields[0]);
} else {
$sub = new BlankNode($recordSet->fields[0]);
}
// predicate
$pred = new Resource($recordSet->fields[1]);
// object
if ($recordSet->fields[6] == 'r') {
$obj = new Resource($recordSet->fields[2]);
} elseif ($recordSet->fields[6] == 'b') {
$obj = new BlankNode($recordSet->fields[2]);
} else {
$obj = new Literal($recordSet->fields[2], $recordSet->fields[3]);
if ($recordSet->fields[4]) {
$obj->setDatatype($recordSet->fields[4]);
}
}
$statement = new Statement($sub, $pred, $obj);
$res->add($statement);
$recordSet->moveNext();
}
$res->addParsedNamespaces($this->getParsedNamespaces());
return $res;
}