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


PHP SMWExporter::findDataItemForExpElement方法代码示例

本文整理汇总了PHP中SMWExporter::findDataItemForExpElement方法的典型用法代码示例。如果您正苦于以下问题:PHP SMWExporter::findDataItemForExpElement方法的具体用法?PHP SMWExporter::findDataItemForExpElement怎么用?PHP SMWExporter::findDataItemForExpElement使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在SMWExporter的用法示例。


在下文中一共展示了SMWExporter::findDataItemForExpElement方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: makeQueryResultForInstance

 private function makeQueryResultForInstance(FederateResultSet $federateResultSet, Query $query)
 {
     $resultDataItems = array();
     foreach ($federateResultSet as $resultRow) {
         if (count($resultRow) > 0) {
             $dataItem = Exporter::findDataItemForExpElement($resultRow[0]);
             if (!is_null($dataItem)) {
                 $resultDataItems[] = $dataItem;
             }
         }
     }
     if ($federateResultSet->numRows() > $query->getLimit()) {
         array_pop($resultDataItems);
         $hasFurtherResults = true;
     } else {
         $hasFurtherResults = false;
     }
     $result = new QueryResult($query->getDescription()->getPrintrequests(), $query, $resultDataItems, $this->store, $hasFurtherResults);
     switch ($federateResultSet->getErrorCode()) {
         case FederateResultSet::ERROR_NOERROR:
             break;
         case FederateResultSet::ERROR_INCOMPLETE:
             $result->addErrors(array(wfMessage('smw_db_sparqlqueryincomplete')->inContentLanguage()->text()));
             break;
         default:
             $result->addErrors(array(wfMessage('smw_db_sparqlqueryproblem')->inContentLanguage()->text()));
             break;
     }
     return $result;
 }
开发者ID:whysasse,项目名称:kmwiki,代码行数:30,代码来源:QueryResultFactory.php

示例2: getQueryResultFromSparqlResult

 /**
  * Build an SMWQueryResult object from a SMWSparqlResultWrapper. This
  * function is used to generate instance query results, and the given
  * result wrapper must have an according format (one result column that
  * contains URIs of wiki pages).
  *
  * @param $sparqlResultWrapper SMWSparqlResultWrapper
  * @param $query SMWQuery, SMWQueryResults hold a reference to original query
  * @return SMWQueryResult
  */
 protected function getQueryResultFromSparqlResult(SMWSparqlResultWrapper $sparqlResultWrapper, SMWQuery $query)
 {
     $resultDataItems = array();
     foreach ($sparqlResultWrapper as $resultRow) {
         if (count($resultRow) > 0) {
             $dataItem = SMWExporter::findDataItemForExpElement($resultRow[0]);
             if (!is_null($dataItem)) {
                 $resultDataItems[] = $dataItem;
             }
         }
     }
     if ($sparqlResultWrapper->numRows() > $query->getLimit()) {
         array_pop($resultDataItems);
         $hasFurtherResults = true;
     } else {
         $hasFurtherResults = false;
     }
     $result = new SMWQueryResult($query->getDescription()->getPrintrequests(), $query, $resultDataItems, $this->m_store, $hasFurtherResults);
     switch ($sparqlResultWrapper->getErrorCode()) {
         case SMWSparqlResultWrapper::ERROR_NOERROR:
             break;
         case SMWSparqlResultWrapper::ERROR_INCOMPLETE:
             $result->addErrors(array(wfMessage('smw_db_sparqlqueryincomplete')->inContentLanguage()->text()));
             break;
         default:
             $result->addErrors(array(wfMessage('smw_db_sparqlqueryproblem')->inContentLanguage()->text()));
             break;
     }
     return $result;
 }
开发者ID:Tjorriemorrie,项目名称:app,代码行数:40,代码来源:SMW_SparqlStoreQueryEngine.php

示例3: testFindDataItemForExpElement

 /**
  * @dataProvider uriDataItemProvider
  * #378
  */
 public function testFindDataItemForExpElement($uri, $expectedDataItem)
 {
     $uri = Exporter::getNamespaceUri('wiki') . $uri;
     $this->assertEquals($expectedDataItem, Exporter::findDataItemForExpElement(new ExpResource($uri)));
 }
开发者ID:whysasse,项目名称:kmwiki,代码行数:9,代码来源:SMWExporterTest.php


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