Mediawiki with Fuseki triplestore backen: Difference between revisions
No edit summary |
|||
Line 32: | Line 32: | ||
==After setting triple storage== | |||
''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.''<ref>https://www.semantic-mediawiki.org/wiki/Help:Using_SPARQL_and_RDF_stores#Moving_data_to_the_new_database</ref> | |||
So we will rebuild the semantic wiki data | |||
php rebuildData.php -v -s 1000 -e 2999 | |||
=Test queries= | =Test queries= |
Revision as of 15:55, 25 May 2020
In this page I will go over the steps required to setup Semantic Mediawiki with a Triple Storage graph database, with Apache Jena Fuseki[1] SPARQL server.
According to SMW documentation:[2]
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.
See more in SMW2.0 Release Notes [3]
Running Fuseki
SMW Setting for Fuseki
With SMW installed and enabled
enableSemantics( 'localhost' );
The following settings are added to LocalSettings.php
$smwgDefaultStore = 'SMWSparqlStore';
$smwgSparqlRepositoryConnector = 'fuseki';
$smwgSparqlEndpoint["query"] = 'http://localhost:3030/test/query';
$smwgSparqlEndpoint["update"] = 'http://localhost:3030/test/update';
$smwgSparqlEndpoint["data"] = '';
And an update needs to be performed:
php maintenance/update.php
After setting triple storage
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.[4]
So we will rebuild the semantic wiki data
php rebuildData.php -v -s 1000 -e 2999
Test queries
In Fuseki interface
All Page type properties:
swivt:page
Note: SWIVT is the Semantic Wiki Vocabulary and Terminology[5]
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX triplewiki: <http://localhost/triplestorage/index.php/>
PREFIX swivt: <http://semantic-mediawiki.org/swivt/1.0#>
SELECT *
{?o swivt:page ?v}
- ↑ https://jena.apache.org/documentation/
- ↑ https://www.semantic-mediawiki.org/wiki/Help:Using_SPARQL_and_RDF_stores
- ↑ https://github.com/SemanticMediaWiki/SemanticMediaWiki/blob/master/docs/releasenotes/RELEASE-NOTES-2.0.md#improved-subobject-support
- ↑ https://www.semantic-mediawiki.org/wiki/Help:Using_SPARQL_and_RDF_stores#Moving_data_to_the_new_database
- ↑ https://www.semantic-mediawiki.org/o/swivt/