PHPackages                             jeroen/query-engine - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. jeroen/query-engine

ActiveLibrary[API Development](/categories/api)

jeroen/query-engine
===================

Answers Ask queries against a collection of Wikibase entities

0.5.0(10y ago)1118[4 issues](https://github.com/JeroenDeDauw/WikibaseQueryEngine/issues)GPL-2.0+PHPPHP &gt;=5.5.0

Since May 3Pushed 10y ago2 watchersCompare

[ Source](https://github.com/JeroenDeDauw/WikibaseQueryEngine)[ Packagist](https://packagist.org/packages/jeroen/query-engine)[ Docs](https://github.com/JeroenDeDauw/WikibaseQueryEngine)[ RSS](/packages/jeroen-query-engine/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (11)Versions (6)Used By (0)

Wikibase QueryEngine
====================

[](#wikibase-queryengine)

[![Build Status](https://camo.githubusercontent.com/220668c66607e0960a8783acba9163575baa46b5a12023689ab0755645866e08/68747470733a2f2f7365637572652e7472617669732d63692e6f72672f4a65726f656e4465446175772f57696b69626173655175657279456e67696e652e706e673f6272616e63683d6d6173746572)](http://travis-ci.org/JeroenDeDauw/WikibaseQueryEngine)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/c0bee1ff342aff941edfa138c09d408b652b1f504c5e63239f7400712d989b8f/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f4a65726f656e4465446175772f57696b69626173655175657279456e67696e652f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/JeroenDeDauw/WikibaseQueryEngine/?branch=master)[![Code Coverage](https://camo.githubusercontent.com/f3c66ca36bbb3aa38073ef2de3b13afe658c33340ea945c8d56c97dff0a536ab/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f4a65726f656e4465446175772f57696b69626173655175657279456e67696e652f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/JeroenDeDauw/WikibaseQueryEngine/?branch=master)[![Dependency Status](https://camo.githubusercontent.com/65f660f1f8cfcc00398e503aaa4037876a7d780eeea08c133562eeea652c6c0d/68747470733a2f2f7777772e76657273696f6e6579652e636f6d2f7068702f6a65726f656e3a71756572792d656e67696e652f6465762d6d61737465722f62616467652e737667)](https://www.versioneye.com/php/jeroen:query-engine/dev-master)

On [Packagist](https://packagist.org/packages/jeroen/query-engine): [![Latest Stable Version](https://camo.githubusercontent.com/299afa904861b20ebc8e1fbd377f8f0099dab330a36c7f35aec7e1b4c233feb6/68747470733a2f2f706f7365722e707567782e6f72672f6a65726f656e2f71756572792d656e67696e652f76657273696f6e2e706e67)](https://packagist.org/packages/jeroen/query-engine)[![Download count](https://camo.githubusercontent.com/91581c6839a6439564e362204ab63e70a971f6f4aa761e01edb035a5d659a170/68747470733a2f2f706f7365722e707567782e6f72672f6a65726f656e2f71756572792d656e67696e652f642f746f74616c2e706e67)](https://packagist.org/packages/jeroen/query-engine)

**Wikibase QueryEngine** is a library that supports running [Ask](https://github.com/JeroenDeDauw/Ask)queries against a collection of [Wikibase](http://wikiba.se) entities.

Recent changes can be found in the [release notes](RELEASE-NOTES.md).

Note that this is a fork of the original Wikibase Query Engine, which has the `wikibase/query-engine`package name. This version is ahead of the original, which is no longer actively developed by its original maintainer: Wikimedia Deutchland.

Installation
------------

[](#installation)

You can use [Composer](http://getcomposer.org/) 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.

### Composer

[](#composer)

To add this package as a local, per-project dependency to your project, simply add a dependency on `jeroen/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.x:

```
    {
        "require": {
            "jeroen/query-engine": "~1.0"
        }
    }
```

### Manual

[](#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.

Running the tests
-----------------

[](#running-the-tests)

For tests only

```
composer test

```

For style checks only

```
composer cs

```

For a full CI run

```
composer ci

```

Usage
-----

[](#usage)

CLI
---

[](#cli)

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

```
php queryengine

```

SQLStore internal structure
---------------------------

[](#sqlstore-internal-structure)

### Table: entities

[](#table-entities)

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

### Snak tables

[](#snak-tables)

All snak tables have the following fields:

- row\_id, int
- subject\_id, string
- subject\_type, string
- property\_id, string
- statement\_rank, int

The schema definition is dynamically build in StoreSchema.php.

#### Value snak tables

[](#value-snak-tables)

There is a value snak table per type of data value the store is configured to support.

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.

#### Valueless snak tables

[](#valueless-snak-tables)

Additional fields:

- snak\_type, int: type of the snak, ie "no value"

Authors
-------

[](#authors)

Wikibase QueryEngine has been written by Jeroen De Dauw, and by the Wikidata team for the [Wikidata project](https://wikidata.org/).

Links
-----

[](#links)

- [Wikibase QueryEngine on Packagist](https://packagist.org/packages/jeroen/query-engine)
- [Wikibase QueryEngine on Ohloh](https://www.ohloh.net/p/wikibasequeryengine/)
- [Wikibase QueryEngine on GitHub](https://github.com/JeroenDeDauw/WikibaseQueryEngine)
- [TravisCI build status](https://travis-ci.org/JeroenDeDauw/WikibaseQueryEngine)

Related projects
----------------

[](#related-projects)

- [Wikibase](http://wikiba.se)
- [Semantic MediaWiki](https://semantic-mediawiki.org/)

###  Health Score

22

—

LowBetter than 21% of packages

Maintenance0

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity52

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 68% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~137 days

Total

5

Last Release

3894d ago

PHP version history (2 changes)0.1PHP &gt;=5.3.0

0.5.0PHP &gt;=5.5.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/451bd4039d530fed8f9c3da91bfa519233a397d2182cdfdcad700f6cfea19b7f?d=identicon)[Jeroen De Dauw](/maintainers/Jeroen%20De%20Dauw)

---

Top Contributors

[![JeroenDeDauw](https://avatars.githubusercontent.com/u/146040?v=4)](https://github.com/JeroenDeDauw "JeroenDeDauw (340 commits)")[![thiemowmde](https://avatars.githubusercontent.com/u/6576639?v=4)](https://github.com/thiemowmde "thiemowmde (98 commits)")[![addshore](https://avatars.githubusercontent.com/u/3308769?v=4)](https://github.com/addshore "addshore (29 commits)")[![translatewiki](https://avatars.githubusercontent.com/u/24829418?v=4)](https://github.com/translatewiki "translatewiki (13 commits)")[![mariushoch](https://avatars.githubusercontent.com/u/2446964?v=4)](https://github.com/mariushoch "mariushoch (8 commits)")[![tobijat](https://avatars.githubusercontent.com/u/2997252?v=4)](https://github.com/tobijat "tobijat (4 commits)")[![adrianheine](https://avatars.githubusercontent.com/u/139208?v=4)](https://github.com/adrianheine "adrianheine (3 commits)")[![JanZerebecki](https://avatars.githubusercontent.com/u/7452727?v=4)](https://github.com/JanZerebecki "JanZerebecki (2 commits)")[![frimelle](https://avatars.githubusercontent.com/u/2714560?v=4)](https://github.com/frimelle "frimelle (2 commits)")[![raymondde](https://avatars.githubusercontent.com/u/4243486?v=4)](https://github.com/raymondde "raymondde (1 commits)")

---

Tags

wikidatawikibaseQueryEngine

### Embed Badge

![Health badge](/badges/jeroen-query-engine/health.svg)

```
[![Health](https://phpackages.com/badges/jeroen-query-engine/health.svg)](https://phpackages.com/packages/jeroen-query-engine)
```

###  Alternatives

[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.5k5.9M738](/packages/sylius-sylius)[flow-php/flow

PHP ETL - Extract Transform Load - Data processing framework

85036.3k](/packages/flow-php-flow)[shopware/core

Shopware platform is the core for all Shopware ecommerce products.

585.6M574](/packages/shopware-core)[addwiki/wikibase-api

Wikibase API library

254.7k3](/packages/addwiki-wikibase-api)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
