Index: trunk/extensions/SemanticMediaWiki/includes/SMW_GlobalFunctions.php |
— | — | @@ -296,9 +296,10 @@ |
297 | 297 | * @return SMWSparqlDatabase or null |
298 | 298 | */ |
299 | 299 | function &smwfGetSparqlDatabase() { |
300 | | - global $smwgSparqlDatabaseMaster; |
| 300 | + global $smwgSparqlDatabase, $smwgSparqlQueryEndpoint, $smwgSparqlUpdateEndpoint, |
| 301 | + $smwgSparqlDataEndpoint, $smwgSparqlDatabaseMaster; |
301 | 302 | 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 ); |
303 | 304 | } |
304 | 305 | return $smwgSparqlDatabaseMaster; |
305 | 306 | } |
Index: trunk/extensions/SemanticMediaWiki/SMW_Settings.php |
— | — | @@ -45,6 +45,26 @@ |
46 | 46 | $smwgDefaultStore = "SMWSQLStore2"; |
47 | 47 | ## |
48 | 48 | |
| 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 | + |
49 | 69 | // load global constants and setup functions |
50 | 70 | require_once( 'includes/SMW_Setup.php' ); |
51 | 71 | |