The LinkedWiki extension allows you to embed a SPARQL query and display the results in your wiki page.
Go to the LinkedWik Extension page. Using the links in the box on the right hand side, download the v1.0.1.2 LinkedWiki extension.
Move the downloaded zip file into your MediaWiki extensions folder. You will find this folder in your Virtuoso installation directory/vsp/vad/vsp/MediaWiki/extension. Extract the extension.
The LinkedWiki extension is enabled by adding the following lines to the your Virtuoso installation directory/vsp/vad/vsp/MediaWiki/LocalSettings.php file:
require_once( $IP."/extensions/LinkedWiki/lib/4store/SparqlTools.php"); require_once( "{$IP}/extensions/LinkedWiki/LinkedWiki.php" ); $smwgDefaultStore = "SMW_LinkedWikiStore"; $wgLinkedWikiGraphWiki = 'http://example.org/mydefaultgraphname';
The extension is further configured by setting the endpoint and the SPARQL endpoint. These will be the same as are used by Semantic MediaWiki and may be something like:
$wgLinkedWikiEndPoint = "http://localhost:8890/"; $wgLinkedWikiLocalEndPoint = "http://localhost:8890/sparql/";
{{#sparql:select * where { ?x ?y ?z . } LIMIT 5}}
This displays the first 5 triples. The results will look something like this: