当前位置: 首页>>代码示例>>PHP>>正文


PHP MemModel::addParsedNamespaces方法代码示例

本文整理汇总了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;
 }
开发者ID:richardjennings,项目名称:rap,代码行数:17,代码来源:InfModelF.php

示例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;
 }
开发者ID:richardjennings,项目名称:rap,代码行数:47,代码来源:DbModel.php


注:本文中的MemModel::addParsedNamespaces方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。