Semantic MediaWiki and related extensions
SPARQLStore

The SPARQLStore is the name for the component that can establish a connection between a RDF triple store and Semantic MediaWiki (a more general introduction can be found here).

The SPARQLStore is composed of a base store (by default using the existing SQLStore), a QueryEngine, and a connector to the RDF back-end. Currently, the base store takes the position of accumulating information about properties, value annotations, and statistics.

Overview

SPARQLStore
|- SPARQLStoreFactory
|- ConnectionManager
| |- RepositoryConnectionProvider
| |- RepositoryClient
| |- RepositoryConnection
| |- FourstoreRepositoryConnector
| |- FusekiRepositoryConnector
| |- GenericRepositoryConnector
| |- VirtuosoRepositoryConnector
|- TurtleTriplesBuilder
|- RepositoryRedirectLookup
|- ReplicationDataTruncator
|- QueryEngine
|- HttpResponseParser
|- XmlResponseParser
|- ConditionBuilder
|- DescriptionInterpreter

Repository connector

A repository connector is responsible for establishing a communication between Semantic MediaWiki and an external TDB with the main objective to transfer/update triples from SMW to the back-end and to return result matches for a query request.

The following client repositories have been tested:

### Create a connection

$connectionManager = new ConnectionManager();
$connectionManager->registerConnectionProvider(
    'sparql',
    new RepositoryConnectionProvider( 'fuseki' )
);
$connection = $connectionManager->getConnection( 'sparql' )

QueryEngine

The QueryEngine is responsible for transforming an #ask description object into a qualified SPARQL query expression.

### Create a query request

/**
 * Equivalent to [[Foo::+]]
 *
 * SELECT DISTINCT ?result WHERE {
 * ?result swivt:wikiPageSortKey ?resultsk .
 * ?result property:Foo ?v1 .
 * }
 * ORDER BY ASC(?resultsk)
 */
$description = new SomeProperty(
    new DIProperty( 'Foo' ),
    new ThingDescription()
);
$query = new Query( $description );
$sparqlStoreFactory = new SPARQLStoreFactory(
  new SPARQLStore()
);
$queryEngine = $sparqlStoreFactory->newMasterQueryEngine();
$queryResult = $queryEngine->getQueryResult( $query );

About | General disclaimer | Privacy policy