2017 © Pedro PelĂĄez
 

library query-engine

Answers Ask queries against a collection of Wikibase entities

image

wikibase/query-engine

Answers Ask queries against a collection of Wikibase entities

  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 10 Versions
  • 0 % Grown

The README.md

WMDE has stopped development of this component. A fork with further development work done on it can be found at jeroen/query-engine., (*1)

Wikibase QueryEngine

Build Status Code Coverage Scrutinizer Code Quality Dependency Status, (*2)

On Packagist: Latest Stable Version Download count, (*3)

Wikibase QueryEngine is a component that supports running Ask queries against a collection of Wikibase entities., (*4)

It is primarily used by the Wikibase MediaWiki extensions, though has no dependencies whatsoever on these or on MediaWiki itself., (*5)

Recent changes can be found in the release notes., (*6)

Installation

You can use Composer to download and install this package as well as its dependencies. Alternatively you can simply clone the git repository and take care of loading yourself., (*7)

Composer

To add this package as a local, per-project dependency to your project, simply add a dependency on wikibase/query-engine to your project's composer.json file. Here is a minimal example of a composer.json file that just defines a dependency on Wikibase QueryEngine 1.0:, (*8)

    {
        "require": {
            "wikibase/query-engine": "1.0.*"
        }
    }

Manual

Get the Wikibase QueryEngine code, either via git, or some other means. Also get all dependencies. You can find a list of the dependencies in the "require" section of the composer.json file. Load all dependencies and the load the Wikibase QueryEngine library by including its entry point: WikibaseQueryEngine.php., (*9)

Tests

This library comes with a set up PHPUnit tests that cover all non-trivial code. You can run these tests using the PHPUnit configuration file found in the root directory. The tests can also be run via TravisCI, as a TravisCI configuration file is also provided in the root directory., (*10)

Running the tests, (*11)

phpunit

Usage

The public interfaces in this component are everything directly in the Wikibase\QueryEngine. Other classes and interfaces are typically package private, and should not be used or known about outside of the package. Each store implementation has its own list of additional public classes., (*12)

SQLStore

Public classes of the SQLStore:, (*13)

Needed for construction:, (*14)

  • SQLStore\SQLStore
    • SQLStore\StoreSchema
      • SQLStore\DataValueHandlers
    • SQLStore\StoreConfig

Needed for extension:, (*15)

  • SQLStore\DataValueHandler

Constructing an SQLStore:, (*16)

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' )
);

CLI

To get a list of available CLI commands, execute this in the root directory:, (*17)

php queryengine

SQLStore internal structure

Table: entities

  • id, string: serialization of the entities id
  • type, string: type of the entity

Snak tables

All snak tables have the following fields:, (*18)

  • row_id, int
  • subject_id, string
  • subject_type, string
  • property_id, string
  • statement_rank, int

The schema definition is dynamically build in StoreSchema.php., (*19)

Value snak tables

There is a value snak table per type of data value the store is configured to support., (*20)

All data value tables have a set of additional fields that are specific to the type of data value they store. For the types of data value natively supported by the store., (*21)

Valueless snak tables

Additional fields:, (*22)

  • snak_type, int: type of the snak, ie "no value"

Authors

Wikibase QueryEngine has been written by the Wikidata team for the Wikidata project., (*23)

Bugs on Phabricator

https://phabricator.wikimedia.org/project/view/115/, (*24)

The Versions

10/05 2018

dev-master

9999999-dev https://github.com/wmde/WikibaseQueryEngine

Answers Ask queries against a collection of Wikibase entities

  Sources   Download

GPL-2.0+

The Requires

 

The Development Requires

by Thiemo MĂ€ttig
by Thiemo Kreuz

wikibase wikidata queryengine

05/12 2014

dev-dvintegration2

dev-dvintegration2 https://github.com/wmde/WikibaseQueryEngine

Answers Ask queries against a collection of Wikibase entities

  Sources   Download

GPL-2.0+

The Requires

 

The Development Requires

by Thiemo MĂ€ttig

wikibase wikidata queryengine

05/12 2014

dev-dvintegration

dev-dvintegration https://github.com/wmde/WikibaseQueryEngine

Answers Ask queries against a collection of Wikibase entities

  Sources   Download

GPL-2.0+

The Requires

 

The Development Requires

by Thiemo MĂ€ttig

wikibase wikidata queryengine

23/10 2014

dev-most-funny-cat-video-ever

dev-most-funny-cat-video-ever https://github.com/wmde/WikibaseQueryEngine

Answers Ask queries against a collection of Wikibase entities

  Sources   Download

GPL-2.0+

The Requires

 

The Development Requires

by Thiemo MĂ€ttig

wikibase wikidata queryengine

25/08 2014

0.3.1

0.3.1.0 https://github.com/wmde/WikibaseQueryEngine

Answers Ask queries against a collection of Wikibase entities

  Sources   Download

GPL-2.0+

The Requires

 

The Development Requires

by Thiemo MĂ€ttig

wikibase wikidata queryengine

22/08 2014

0.3

0.3.0.0 https://github.com/wmde/WikibaseQueryEngine

Answers Ask queries against a collection of Wikibase entities

  Sources   Download

GPL-2.0+

The Requires

 

The Development Requires

by Thiemo MĂ€ttig

wikibase wikidata queryengine

14/08 2014

dev-hhvm

dev-hhvm https://github.com/wmde/WikibaseQueryEngine

Answers Ask queries against a collection of Wikibase entities

  Sources   Download

GPL-2.0+

The Requires

 

The Development Requires

by Thiemo MĂ€ttig

wikibase wikidata queryengine

21/06 2014
03/05 2014

0.1.x-dev

0.1.9999999.9999999-dev https://github.com/wmde/WikibaseQueryEngine

Answers Ask queries against a collection of Wikibase entities

  Sources   Download

GPL-2.0+

The Requires

 

wikibase wikidata queryengine