PHPackages                             wikibase/query - 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. wikibase/query

AbandonedArchivedMediawiki-extension

wikibase/query
==============

Extension to Wikibase Repo that adds the ability to define and execute queries

24622[1 PRs](https://github.com/wmde/WikibaseQuery/pulls)PHP

Since Apr 30Pushed 6y ago22 watchersCompare

[ Source](https://github.com/wmde/WikibaseQuery)[ Packagist](https://packagist.org/packages/wikibase/query)[ RSS](/packages/wikibase-query/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependenciesVersions (5)Used By (0)

This extension is no longer maintained nor developed.

Wikibase Query
==============

[](#wikibase-query)

[![Build Status](https://camo.githubusercontent.com/95e9a15e7962aef4a67b45b5288b45ff445f4eaa3e3bbbfcb4fa3047e3acf899/68747470733a2f2f7365637572652e7472617669732d63692e6f72672f776d64652f57696b696261736551756572792e706e673f6272616e63683d6d6173746572)](http://travis-ci.org/wmde/WikibaseQuery)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/de3feabe285f90c62348ec7195b2c88b6d9eb9693cf10f6d58b7df054575f172/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f776d64652f57696b696261736551756572792f6261646765732f7175616c6974792d73636f72652e706e673f733d30393136663938633563626464303330653332643933366639383339326138653165393566353366)](https://scrutinizer-ci.com/g/wmde/WikibaseQuery/)

On Packagist: [![Latest Stable Version](https://camo.githubusercontent.com/274c4e8f771e42804b1f1b48d3a4209555afc32684c1c7263ef513956f0ed683/68747470733a2f2f706f7365722e707567782e6f72672f77696b69626173652f71756572792f76657273696f6e2e706e67)](https://packagist.org/packages/wikibase/query)[![Download count](https://camo.githubusercontent.com/facc1be3ea0d18f7fe714d4d7b64612d688286b60e0d35d93fcec73c34b5487a/68747470733a2f2f706f7365722e707567782e6f72672f77696b69626173652f71756572792f642f746f74616c2e706e67)](https://packagist.org/packages/wikibase/query)

Wikibase Query adds query capabilities to Wikibase Repo. It is part of the [Wikibase software](http://wikiba.se/).

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 `wikibase/query` to your project's `composer.json` file. Here is a minimal example of a `composer.json` file that just defines a dependency on Wikibase Query 1.0:

```
    {
        "require": {
            "wikibase/query": "1.0.*"
        }
    }
```

CLI
---

[](#cli)

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

```
php querycli

```

Technical documentation
-----------------------

[](#technical-documentation)

All classes provided by WikibaseQuery reside in the Wikibase\\Query namespace.

Public classes and interfaces have an @since tag denoting the version since which they can be accessed. Constructs without an @since tag are package private and should not be used by extensions.

Object graph construction is done via the dependency injection container defined in Wikibase\\Query\\DIC. Individual builders reside in Wikibase\\Query\\DIC\\Builders. Builders are registered in Wikibase\\Query\\DIC\\WikibaseQueryBuilder. All access to the DIC from outside the DIC happens via Wikibase\\Query\\DIC\\WikibaseQuery. When requiring access to this class from a legacy API, the ExtensionAccess::getWikibaseQuery method should be used. Usage of this method is forbidden outside of legacy APIs in which we cannot achieve proper dependency construction.

Tests
-----

[](#tests)

This extension comes with a set up PHPUnit tests that cover all non-trivial code. The extension needs to be loaded via MediaWiki, after which the tests can be run via the MediaWiki test runner.

```
php phpunit.php -c ../../extensions/WikibaseQuery/

```

You might need to specify that MediaWiki should use normal tables

```
php phpunit.php -c ../../extensions/WikibaseQuery/ --use-normal-tables

```

If this does not work due to using PHPUnit 4.0 or later, you can temporarily modify your MediaWikis `MediaWikiPHPUnitCommand.php` file.

Authors
-------

[](#authors)

Wikibase Query has been written by the Wikidata team for the [Wikidata project](https://wikidata.org/). You can view the [full list of contributors](https://www.ohloh.net/p/wikibasequery/contributors).

Links
-----

[](#links)

- [Wikibase Query on Packagist](https://packagist.org/packages/wikibase/query)
- [Wikibase Query on Ohloh](https://www.ohloh.net/p/wikibasequery)
- [Wikibase Query on MediaWiki.org](https://www.mediawiki.org/wiki/Extension:Wikibase_Query)
- [TravisCI build status](https://travis-ci.org/wmde/WikibaseQuery)

See also
--------

[](#see-also)

- [Wikibase QueryEngine](https://github.com/wmde/WikibaseQueryEngine)

Bugs on Phabricator
-------------------

[](#bugs-on-phabricator)

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity17

Limited adoption so far

Community26

Small or concentrated contributor base

Maturity46

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 57.9% 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.

### Community

Maintainers

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

![](https://www.gravatar.com/avatar/054adb441e7ee248ec924bc45fa793835c284710eb31627587fa5de21bab9e96?d=identicon)[wmde](/maintainers/wmde)

![](https://www.gravatar.com/avatar/5406ed1d40d50ffc61d67e9f5149914dbfe0b8a52bdf297299f5ccfab0a73d91?d=identicon)[thiemowmde](/maintainers/thiemowmde)

![](https://www.gravatar.com/avatar/fe4220e5a109212ea1a84969fbcb0795ceaf975145c1f0577bd758d0500e6428?d=identicon)[manicki](/maintainers/manicki)

![](https://www.gravatar.com/avatar/99b03312aa8fcf47db8cbde452192aa5b96c27d1b99c4c1fb22af92ae1dbb0fb?d=identicon)[filbertkm](/maintainers/filbertkm)

---

Top Contributors

[![JeroenDeDauw](https://avatars.githubusercontent.com/u/146040?v=4)](https://github.com/JeroenDeDauw "JeroenDeDauw (165 commits)")[![translatewiki](https://avatars.githubusercontent.com/u/24829418?v=4)](https://github.com/translatewiki "translatewiki (36 commits)")[![adrianheine](https://avatars.githubusercontent.com/u/139208?v=4)](https://github.com/adrianheine "adrianheine (22 commits)")[![thiemowmde](https://avatars.githubusercontent.com/u/6576639?v=4)](https://github.com/thiemowmde "thiemowmde (22 commits)")[![addshore](https://avatars.githubusercontent.com/u/3308769?v=4)](https://github.com/addshore "addshore (18 commits)")[![mariushoch](https://avatars.githubusercontent.com/u/2446964?v=4)](https://github.com/mariushoch "mariushoch (11 commits)")[![DanweDE](https://avatars.githubusercontent.com/u/101926?v=4)](https://github.com/DanweDE "DanweDE (3 commits)")[![siebrand](https://avatars.githubusercontent.com/u/210297?v=4)](https://github.com/siebrand "siebrand (2 commits)")[![tobijat](https://avatars.githubusercontent.com/u/2997252?v=4)](https://github.com/tobijat "tobijat (2 commits)")[![legoktm](https://avatars.githubusercontent.com/u/81392?v=4)](https://github.com/legoktm "legoktm (1 commits)")[![frimelle](https://avatars.githubusercontent.com/u/2714560?v=4)](https://github.com/frimelle "frimelle (1 commits)")[![manicki](https://avatars.githubusercontent.com/u/3524114?v=4)](https://github.com/manicki "manicki (1 commits)")[![raymondde](https://avatars.githubusercontent.com/u/4243486?v=4)](https://github.com/raymondde "raymondde (1 commits)")

### Embed Badge

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

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

PHPackages © 2026

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