PHP code example of wikibase / query-engine

1. Go to this page and download the library: Download wikibase/query-engine library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

wikibase / query-engine example snippets


use Wikibase\QueryEngine\SQLStore\SQLStore;
use Wikibase\QueryEngine\SQLStore\StoreSchema;
use Wikibase\QueryEngine\SQLStore\StoreConfig;
use Wikibase\QueryEngine\SQLStore\DataValueHandlers;
use Wikibase\QueryEngine\SQLStore\DVHandler\NumberHandler;

$dvHandlers = new DataValueHandlers();

$dvHandlers->addMainSnakHandler( 'number', new NumberHandler() );

$store = new Store(
    new StoreSchema( 'table_prefix_', $dvHandlers ),
    new StoreConfig( 'store name' )
);