r69351 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r69350‎ | r69351 | r69352 >
Date:21:47, 14 July 2010
Author:yaron
Status:deferred
Tags:
Comment:
Changes to improve RDF export - patch from Jamey Wood
Modified paths:
  • /trunk/extensions/SemanticInternalObjects/SemanticInternalObjects_body.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticInternalObjects/SemanticInternalObjects_body.php
@@ -73,7 +73,7 @@
7474 }
7575 function getExportData() {
7676 global $smwgNamespace;
77 - return new SMWExpData( new SMWExpResource( null ) );
 77+ return new SMWExpData( new SMWExpResource( SIOExporter::getResolverURL() . $this->mSIOTitle->getPrefixedURL() ) );
7878 }
7979
8080 function getTitle() {
@@ -86,6 +86,16 @@
8787 }
8888
8989 /**
 90+ * Class to work around the fact that SMWExporter::$m_ent_wiki is protected.
 91+ **/
 92+class SIOExporter extends SMWExporter {
 93+
 94+ static function getResolverURL() {
 95+ return SMWExporter::$m_ent_wiki;
 96+ }
 97+}
 98+
 99+/**
90100 * Class for all database-related actions.
91101 * This class exists mostly because SMWSQLStore2's functions makeSMWPageID()
92102 * and makeSMWPropertyID(), which are needed for the DB access, are both
@@ -169,8 +179,13 @@
170180 return array( $upRels2, $upAtts2, $upText2, $upCoords );
171181 }
172182
173 - static function createRDF( $title, $rdfDataArray ) {
174 - $pageName = $title->getText();
 183+ static function createRDF( $title, $rdfDataArray, $fullexport = true, $backlinks = false ) {
 184+ // if it's not a full export, don't add internal object data
 185+ if ( !$fullexport ) {
 186+ return true;
 187+ }
 188+
 189+ $pageName = $title->getDBkey();
175190 $namespace = $title->getNamespace();
176191
177192 // go through all SIOs for the current page, create RDF for

Status & tagging log