r86691 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r86690‎ | r86691 | r86692 >
Date:09:02, 22 April 2011
Author:mkroetzsch
Status:deferred
Tags:
Comment:
make SPARQL database connection configurable
Modified paths:
  • /trunk/extensions/SemanticMediaWiki/SMW_Settings.php (modified) (history)
  • /trunk/extensions/SemanticMediaWiki/includes/SMW_GlobalFunctions.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticMediaWiki/includes/SMW_GlobalFunctions.php
@@ -296,9 +296,10 @@
297297 * @return SMWSparqlDatabase or null
298298 */
299299 function &smwfGetSparqlDatabase() {
300 - global $smwgSparqlDatabaseMaster;
 300+ global $smwgSparqlDatabase, $smwgSparqlQueryEndpoint, $smwgSparqlUpdateEndpoint,
 301+ $smwgSparqlDataEndpoint, $smwgSparqlDatabaseMaster;
301302 if ( !isset( $smwgSparqlDatabaseMaster ) ) {
302 - $smwgSparqlDatabaseMaster = new SMWSparqlDatabase( 'http://localhost:8080/sparql/', 'http://localhost:8080/update/', 'http://localhost:8080/data/' );
 303+ $smwgSparqlDatabaseMaster = new $smwgSparqlDatabase( $smwgSparqlQueryEndpoint, $smwgSparqlUpdateEndpoint, $smwgSparqlDataEndpoint );
303304 }
304305 return $smwgSparqlDatabaseMaster;
305306 }
Index: trunk/extensions/SemanticMediaWiki/SMW_Settings.php
@@ -45,6 +45,26 @@
4646 $smwgDefaultStore = "SMWSQLStore2";
4747 ##
4848
 49+###
 50+# Configure SPARQL database connection for Semantic MediaWiki. This is used
 51+# when SPARQL-based features are enabled, e.g. when using SMWSparqlStore as
 52+# the $smwgDefaultStore.
 53+#
 54+# The default class SMWSparqlDatabase works with many databases that support
 55+# SPARQL and SPARQL Update. Three different endpoints (service URLs) are given
 56+# for query (reading queries like SELECT), update (SPARQL Update queries), and
 57+# data (SPARQL HTTP Protocol for Graph Management). The query endpoint is
 58+# necessary, but the update and data endpoints can be omitted if not supported.
 59+# This will lead to reduced functionality (e.g. the SMWSparqlStore will not
 60+# work if Update is not available). The data endpoint is always optional, but
 61+# in some SPARQL databases this method is more efficient than update.
 62+##
 63+$smwgSparqlDatabase = 'SMWSparqlDatabase';
 64+$smwgSparqlQueryEndpoint = 'http://localhost:8080/sparql/';
 65+$smwgSparqlUpdateEndpoint = 'http://localhost:8080/update/';
 66+$smwgSparqlDataEndpoint = 'http://localhost:8080/data/';
 67+##
 68+
4969 // load global constants and setup functions
5070 require_once( 'includes/SMW_Setup.php' );
5171

Status & tagging log