| Status: | effective |
| Progress: | 99% |
| Version: | 1.9.3+ |
| Using SPARQL and RDF stores | |
|---|---|
Provides information about using SPARQL and related RespositoryConnectors.
| |
| |
| |
| Table of Contents | |
Contents |
By default, Semantic MediaWiki (SMW) stores all data in the same relational database (usually, a MySQL database) that is used by MediaWiki. This ensures a simple setup, but a relational database is not an ideal type of storage for semantic data. A more natural data model for SMW data is RDF, a data format that organizes information in graphs rather than in fixed database tables. Fortunately, it is possible to use RDF-based systems, in conjunction with the standard SQL database, to manage and query SMW's data. This page explains the details.
Whether or not to use an RDF store in a specific wiki depends on a number of factors, including the specific RDF database being used. Nonetheless, we can reasonably hope for the following advantages:
Nevertheless, there are a number of possible drawbacks as well:
Luckily, it is possible to switch back and forth between SQL-based and RDF-based storage backends without major effort, so that the decision can be revisited after trying it for a while.
In principle, SMW supports any database that supports the SPARQL query language and SPARUL (SPARQL/Update) as introduced in SPARQL 1.1. In Semantic MediaWiki 1.7.0Released on 1 January 2012 and compatible with MW 1.16.x - 1.19.x., stores are required to accept updates and queries that do not specify a graph but it is planned to remove this limitation in the future. One list of RDF stores is maintained at w3.org. See also a list of SPARQL triple-store vendors which is maintained by the SWM Project.
| Help Page | Connector | Description | Version |
|---|---|---|---|
| Help:SPARQLStore (custom) | Custom | Custom access point to the SPARQLStore | 2.0.0 |
| Help:SPARQLStore (default) | Default | Default access point to the SPARQLStore | 1.6.0 |
| Help:SPARQLStore and Virtuoso | Virtuoso | Virtuoso access point to the SPARQLStore | 1.7.1 |
| Help:SPARQLStore and 4store | 4store | 4store access point to the SPARQLStore | 2.0.0 |
| Help:SPARQLStore and Blazegraph | Blazegraph | Blazegraph access point to the SPARQLStore | 2.3.0 |
| Help:SPARQLStore and Fuseki | Fuseki | Jena Fuseki access point to the SPARQLStore | 2.0.0 |
| Help:SPARQLStore and Sesame | Sesame | Sesame (RDF4J) access point to the SPARQLStore | 2.1.0 |
| Parameter | Description | Default | Version |
|---|---|---|---|
| $smwgSparqlRepositoryConnectorForcedHttpVersion | Sets whether CURLOPT_HTTP_VERSION should explicitly be forced for the endpoint communication |
false
|
2.3.1+ |
| $smwgDefaultStore | Sets the storage backend to be used for the semantic data |
SMW\SQLStore\SQLStore
|
0.7+ |
| $smwgExportResourcesAsIri | Sets whether resources should be exported as IRIs (Internationalized Resource Identifiers) |
true
|
2.5.0+ |
| $smwgSparqlCustomConnector | Defines the SPARQL custom database connectors |
custom
|
1.6.0+ |
| $smwgSparqlDataEndpoint | Sets the endpoint for data on the SPARQL database |
http://localhost:8080/data/
|
1.6.0+ |
| $smwgSparqlDefaultGraph | Sets the identifier (graph) of the SPARQL database |
''
|
1.7.0+ |
| $smwgSparqlQFeatures | Sets the SPARQL query features that are expected to be supported by the repository of the identifier (graph) of the SPARQL database | see documentation | 2.3.0+ |
| $smwgSparqlQueryEndpoint | Sets the endpoint for querying the SPARQL database |
http://localhost:8080/sparql/
|
1.6.0+ |
| $smwgSparqlReplicationPropertyExemptionList | see documentation | + | |
| $smwgSparqlRepositoryConnector | Identifies a database connector that ought to be used together with the semantic data store. |
default
|
2.0.0+ |
| $smwgSparqlUpdateEndpoint | Sets the endpoint for updating the SPARQL database |
http://localhost:8080/update/
|
1.6.0+ |
After the configuration was changed, there is no data yet in the RDF database. To fill it with the current content of the wiki, it is necessary to refresh all data. See the help page on repairing SMW's data for details. Any method that refreshes the data will work. All SMW queries (inline or semantic search) will be executed against the RDF database, so their results will only be correct when all data has been refreshed.
There are still a few features that are not supported when using query answering via an RDF database: