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


PHP SMWExporter::expandURI方法代码示例

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


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

示例1: serializeHeader

 protected function serializeHeader()
 {
     $this->namespaces_are_global = true;
     $this->namespace_block_started = true;
     $this->pre_ns_buffer = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" . "<!DOCTYPE rdf:RDF[\n" . "\t<!ENTITY rdf " . $this->makeValueEntityString(SMWExporter::expandURI('&rdf;')) . ">\n" . "\t<!ENTITY rdfs " . $this->makeValueEntityString(SMWExporter::expandURI('&rdfs;')) . ">\n" . "\t<!ENTITY owl " . $this->makeValueEntityString(SMWExporter::expandURI('&owl;')) . ">\n" . "\t<!ENTITY swivt " . $this->makeValueEntityString(SMWExporter::expandURI('&swivt;')) . ">\n" . "\t<!ENTITY wiki " . $this->makeValueEntityString(SMWExporter::expandURI('&wiki;')) . ">\n" . "\t<!ENTITY property " . $this->makeValueEntityString(SMWExporter::expandURI('&property;')) . ">\n" . "\t<!ENTITY wikiurl " . $this->makeValueEntityString(SMWExporter::expandURI('&wikiurl;')) . ">\n" . "]>\n\n" . "<rdf:RDF\n" . "\txmlns:rdf=\"&rdf;\"\n" . "\txmlns:rdfs=\"&rdfs;\"\n" . "\txmlns:owl =\"&owl;\"\n" . "\txmlns:swivt=\"&swivt;\"\n" . "\txmlns:wiki=\"&wiki;\"\n" . "\txmlns:property=\"&property;\"";
     $this->global_namespaces = array('rdf' => true, 'rdfs' => true, 'owl' => true, 'swivt' => true, 'wiki' => true, 'property' => true);
     $this->post_ns_buffer .= ">\n\n";
 }
开发者ID:whysasse,项目名称:kmwiki,代码行数:8,代码来源:SMW_Serializer_RDFXML.php

示例2: changeTitle

    /**
     * Move/rename page
     * @param $oldtitle
     * @param $newtitle
     * @param $pageid
     * @param $redirid
     */
    function changeTitle( Title $oldtitle, Title $newtitle, $pageid, $redirid = 0 ) {

        // Save it in parent store now!
        // We need that so we get all information correctly!
        $result = parent::changeTitle( $oldtitle, $newtitle, $pageid, $redirid );

        // delete old stuff
        $old_uri = SMWExporter::expandURI( $this->getURI( $oldtitle ) );
        $this->removeDataForURI( $old_uri );

        $newpage = SMWDataValueFactory::newTypeIDValue( '_wpg' );
        $newpage->setValues( $newtitle->getDBkey(), $newtitle->getNamespace(), $pageid );
        $semdata = $this->getSemanticData( $newpage );
        $this->updateData( $semdata );

        $oldpage = SMWDataValueFactory::newTypeIDValue( '_wpg' );
        $oldpage->setValues( $oldtitle->getDBkey(), $oldtitle->getNamespace(), $redirid );
        $semdata = $this->getSemanticData( $oldpage );
        $this->updateData( $semdata, false );

        return $result;
    }
开发者ID:realsoc,项目名称:mediawiki-extensions,代码行数:29,代码来源:SMW_ARC2Store.php

示例3: printWikiInfo

 /**
  * Print basic information about this site.
  */
 public function printWikiInfo()
 {
     global $wgSitename, $wgLanguageCode;
     $this->prepareSerialization();
     $this->delay_flush = 35;
     // don't do intermediate flushes with default parameters
     // assemble export data:
     $expData = new SMWExpData(new SMWExpResource('&wiki;#wiki'));
     $ed = new SMWExpData(SMWExporter::getSpecialNsResource('swivt', 'Wikisite'));
     $expData->addPropertyObjectValue(SMWExporter::getSpecialNsResource('rdf', 'type'), $ed);
     // basic wiki information
     $ed = new SMWExpData(new SMWExpLiteral($wgSitename));
     $expData->addPropertyObjectValue(SMWExporter::getSpecialNsResource('rdfs', 'label'), $ed);
     $ed = new SMWExpData(new SMWExpLiteral($wgSitename, null, 'http://www.w3.org/2001/XMLSchema#string'));
     $expData->addPropertyObjectValue(SMWExporter::getSpecialNsResource('swivt', 'siteName'), $ed);
     $ed = new SMWExpData(new SMWExpLiteral(SMWExporter::expandURI('&wikiurl;'), null, 'http://www.w3.org/2001/XMLSchema#string'));
     $expData->addPropertyObjectValue(SMWExporter::getSpecialNsResource('swivt', 'pagePrefix'), $ed);
     $ed = new SMWExpData(new SMWExpLiteral(SMW_VERSION, null, 'http://www.w3.org/2001/XMLSchema#string'));
     $expData->addPropertyObjectValue(SMWExporter::getSpecialNsResource('swivt', 'smwVersion'), $ed);
     $ed = new SMWExpData(new SMWExpLiteral($wgLanguageCode, null, 'http://www.w3.org/2001/XMLSchema#string'));
     $expData->addPropertyObjectValue(SMWExporter::getSpecialNsResource('swivt', 'langCode'), $ed);
     $mainpage = Title::newMainPage();
     if (!is_null($mainpage)) {
         $ed = new SMWExpData(new SMWExpResource($mainpage->getFullURL()));
         $expData->addPropertyObjectValue(SMWExporter::getSpecialNsResource('swivt', 'mainPage'), $ed);
     }
     // statistical information
     $ed = new SMWExpData(new SMWExpLiteral(SiteStats::pages(), null, 'http://www.w3.org/2001/XMLSchema#int'));
     $expData->addPropertyObjectValue(SMWExporter::getSpecialNsResource('swivt', 'pageCount'), $ed);
     $ed = new SMWExpData(new SMWExpLiteral(SiteStats::articles(), null, 'http://www.w3.org/2001/XMLSchema#int'));
     $expData->addPropertyObjectValue(SMWExporter::getSpecialNsResource('swivt', 'contentPageCount'), $ed);
     $ed = new SMWExpData(new SMWExpLiteral(SiteStats::images(), null, 'http://www.w3.org/2001/XMLSchema#int'));
     $expData->addPropertyObjectValue(SMWExporter::getSpecialNsResource('swivt', 'mediaCount'), $ed);
     $ed = new SMWExpData(new SMWExpLiteral(SiteStats::edits(), null, 'http://www.w3.org/2001/XMLSchema#int'));
     $expData->addPropertyObjectValue(SMWExporter::getSpecialNsResource('swivt', 'editCount'), $ed);
     $ed = new SMWExpData(new SMWExpLiteral(SiteStats::views(), null, 'http://www.w3.org/2001/XMLSchema#int'));
     $expData->addPropertyObjectValue(SMWExporter::getSpecialNsResource('swivt', 'viewCount'), $ed);
     $ed = new SMWExpData(new SMWExpLiteral(SiteStats::users(), null, 'http://www.w3.org/2001/XMLSchema#int'));
     $expData->addPropertyObjectValue(SMWExporter::getSpecialNsResource('swivt', 'userCount'), $ed);
     $ed = new SMWExpData(new SMWExpLiteral(SiteStats::numberingroup('sysop'), null, 'http://www.w3.org/2001/XMLSchema#int'));
     $expData->addPropertyObjectValue(SMWExporter::getSpecialNsResource('swivt', 'adminCount'), $ed);
     $this->serializer->startSerialization();
     $this->serializer->serializeExpData(SMWExporter::getOntologyExpData(''));
     $this->serializer->serializeExpData($expData);
     // link to list of existing pages:
     if (strpos(SMWExporter::expandURI('&wikiurl;'), '?') === false) {
         // check whether we have title as a first parameter or in URL
         $nexturl = SMWExporter::expandURI('&export;?offset=0');
     } else {
         $nexturl = SMWExporter::expandURI('&export;&amp;offset=0');
     }
     $expData = new SMWExpData(new SMWExpResource($nexturl));
     $ed = new SMWExpData(SMWExporter::getSpecialNsResource('owl', 'Thing'));
     $expData->addPropertyObjectValue(SMWExporter::getSpecialNsResource('rdf', 'type'), $ed);
     $ed = new SMWExpData(new SMWExpResource($nexturl));
     $expData->addPropertyObjectValue(SMWExporter::getSpecialNsResource('rdfs', 'isDefinedBy'), $ed);
     $this->serializer->serializeExpData($expData);
     $this->serializer->finishSerialization();
     $this->flush(true);
 }
开发者ID:whysasse,项目名称:kmwiki,代码行数:63,代码来源:SMW_ExportController.php

示例4: getURL

	/**
	 * Return a fully qualified URL that points to the link target (whether internal or not).
	 * This function might be used when the URL is needed outside normal links, e.g. in the HTML
	 * header or in some metadata file. For making normal links, getText() should be used.
	 *
	 * @return string
	 */
	public function getURL() {
		if ( $this->mInternal ) {
			$title = Title::newFromText( $this->mTarget );

			if ( !is_null( $title ) ) {
				return $title->getFullURL( SMWInfolink::encodeParameters( $this->mParams, false ) );
			} else {
				return ''; // the title was bad, normally this would indicate a software bug
			}
		} else {
			if ( count( $this->mParams ) > 0 ) {
				if ( strpos( SMWExporter::expandURI( '&wikiurl;' ), '?' ) === false ) {
					$target = $this->mTarget . '?' . SMWInfolink::encodeParameters( $this->mParams, false );
				} else {
					$target = $this->mTarget . '&' . SMWInfolink::encodeParameters( $this->mParams, false );
				}
			} else {
				$target = $this->mTarget;
			}

			return $target;
		}
	}
开发者ID:realsoc,项目名称:mediawiki-extensions,代码行数:30,代码来源:SMW_Infolink.php

示例5: getTurtleNameForExpElement

 /**
  * Get the Turtle serialization string for the given SMWExpElement. The
  * method just computes a name, and does not serialize triples, so the
  * parameter must be an SMWExpResource or SMWExpLiteral, no SMWExpData.
  *
  * @param $expElement SMWExpElement being SMWExpLiteral or SMWExpResource
  * @return string
  */
 public static function getTurtleNameForExpElement(SMWExpElement $expElement)
 {
     if ($expElement instanceof SMWExpResource) {
         if ($expElement->isBlankNode()) {
             return '[]';
         } elseif ($expElement instanceof SMWExpNsResource && $expElement->hasAllowedLocalName()) {
             return $expElement->getQName();
         } else {
             return '<' . str_replace('>', '\\>', SMWExporter::expandURI($expElement->getUri())) . '>';
         }
     } elseif ($expElement instanceof SMWExpLiteral) {
         $lexicalForm = '"' . str_replace(array('\\', "\n", '"'), array('\\\\', "\\n", '\\"'), $expElement->getLexicalForm()) . '"';
         $dt = $expElement->getDatatype();
         if ($dt !== '' && $dt != 'http://www.w3.org/2001/XMLSchema#string') {
             $count = 0;
             $newdt = str_replace('http://www.w3.org/2001/XMLSchema#', 'xsd:', $dt, $count);
             return $count == 1 ? "{$lexicalForm}^^{$newdt}" : "{$lexicalForm}^^<{$dt}>";
         } else {
             return $lexicalForm;
         }
     } else {
         throw new InvalidArgumentException('The method can only serialize atomic elements of type SMWExpResource or SMWExpLiteral.');
     }
 }
开发者ID:Tjorriemorrie,项目名称:app,代码行数:32,代码来源:SMW_Serializer_Turtle.php


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