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


PHP SMWExporter::getResourceElementForWikiPage方法代码示例

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


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

示例1: mapCategoriesToConditionElements

 private function mapCategoriesToConditionElements(array $categories, $joinVariable)
 {
     $condition = '';
     $namespaces = array();
     $instExpElement = $this->exporter->getSpecialPropertyResource('_INST');
     foreach ($categories as $category) {
         $categoryExpElement = $this->exporter->getResourceElementForWikiPage($category);
         $categoryName = TurtleSerializer::getTurtleNameForExpElement($categoryExpElement);
         $namespaces[$categoryExpElement->getNamespaceId()] = $categoryExpElement->getNamespace();
         $newcondition = "{ ?{$joinVariable} " . $instExpElement->getQName() . " {$categoryName} . }\n";
         if ($condition === '') {
             $condition = $newcondition;
         } else {
             $condition .= "UNION\n{$newcondition}";
         }
     }
     return array($condition, $namespaces);
 }
开发者ID:brandonphuong,项目名称:mediawiki,代码行数:18,代码来源:ClassDescriptionInterpreter.php

示例2: doMapClassDescription

 private function doMapClassDescription(ClassDescription $description, &$exact)
 {
     if (count($description->getCategories()) == 1) {
         // single category
         $categories = $description->getCategories();
         $result = new ExpData($this->exporter->getResourceElementForWikiPage(end($categories)));
     } else {
         // disjunction of categories
         $result = new ExpData(new ExpResource(''));
         $elements = array();
         foreach ($description->getCategories() as $cat) {
             $elements[] = new ExpData($this->exporter->getResourceElementForWikiPage($cat));
         }
         $result->addPropertyObjectValue($this->exporter->getSpecialNsResource('owl', 'unionOf'), ExpData::makeCollection($elements));
     }
     $result->addPropertyObjectValue($this->exporter->getSpecialNsResource('rdf', 'type'), new ExpData($this->exporter->getSpecialNsResource('owl', 'Class')));
     return $result;
 }
开发者ID:jongfeli,项目名称:SemanticMediaWiki,代码行数:18,代码来源:ConceptToExpDataMapper.php

示例3: buildClassCondition

 /**
  * Create an SMWSparqlCondition from an SMWClassDescription.
  *
  * @param $description SMWClassDescription
  * @param $joinVariable string name, see buildSparqlCondition()
  * @param $orderByProperty mixed SMWDIProperty or null, see buildSparqlCondition()
  * @return SMWSparqlCondition
  */
 protected function buildClassCondition(SMWClassDescription $description, $joinVariable, $orderByProperty)
 {
     $condition = '';
     $namespaces = array();
     $instExpElement = SMWExporter::getSpecialPropertyResource('_INST');
     foreach ($description->getCategories() as $diWikiPage) {
         $categoryExpElement = SMWExporter::getResourceElementForWikiPage($diWikiPage);
         $categoryName = SMWTurtleSerializer::getTurtleNameForExpElement($categoryExpElement);
         $namespaces[$categoryExpElement->getNamespaceId()] = $categoryExpElement->getNamespace();
         $newcondition = "{ ?{$joinVariable} " . $instExpElement->getQName() . " {$categoryName} . }\n";
         if ($condition === '') {
             $condition = $newcondition;
         } else {
             $condition .= "UNION\n{$newcondition}";
         }
     }
     if ($condition === '') {
         // empty disjunction: always false, no results to order
         return new SMWSparqlFalseCondition();
     }
     $result = new SMWSparqlWhereCondition($condition, true, $namespaces);
     $this->addOrderByDataForProperty($result, $joinVariable, $orderByProperty, SMWDataItem::TYPE_WIKIPAGE);
     return $result;
 }
开发者ID:Tjorriemorrie,项目名称:app,代码行数:32,代码来源:SMW_SparqlStoreQueryEngine.php


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