PHPackages                             ppp/wikidataquery-api - 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. ppp/wikidataquery-api

ActiveLibrary[API Development](/categories/api)

ppp/wikidataquery-api
=====================

A lib to interact with the WikidataQuery API

1.4(10y ago)22.1k21GPLv2+PHPPHP &gt;=5.5.0

Since Nov 23Pushed 10y ago7 watchersCompare

[ Source](https://github.com/ProjetPP/WikidataQueryApi)[ Packagist](https://packagist.org/packages/ppp/wikidataquery-api)[ Docs](https://github.com/ProjetPP/WikidataQueryApi)[ RSS](/packages/ppp-wikidataquery-api/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (5)Dependencies (6)Versions (6)Used By (1)

WikidataQueryApi
================

[](#wikidataqueryapi)

[![Build Status](https://camo.githubusercontent.com/7c5291589f1ebb947c980a06b92ee9ff6e4fcafbf09ed1ca3ad1e359edc505bf/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f50726f6a657450502f57696b696461746151756572794170692f6261646765732f6275696c642e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/ProjetPP/WikidataQueryApi/build-status/master)[![Code Coverage](https://camo.githubusercontent.com/8856b66d0848c81ee30cf6e513ca81dbe74e010b5684c4e1fdf5e0c0017eb962/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f50726f6a657450502f57696b696461746151756572794170692f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/ProjetPP/WikidataQueryApi/?branch=master)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/ec650d48522a34e344f98fa7ec0819cdaa66bedaec44038392e01ee31d133ca7/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f50726f6a657450502f57696b696461746151756572794170692f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/ProjetPP/WikidataQueryApi/?branch=master)[![Dependency Status](https://camo.githubusercontent.com/a18d1189d51885d65cb0acb22c023eeb319896ba5d5c9d636cdb6fbbdd32c5e2/68747470733a2f2f7777772e76657273696f6e6579652e636f6d2f7068702f7070703a77696b696461746171756572792d6170692f6465762d6d61737465722f62616467652e737667)](https://www.versioneye.com/php/ppp:wikidataquery-api/dev-master)

On [Packagist](https://packagist.org/packages/ppp/wikidataquery-api): [![Latest Stable Version](https://camo.githubusercontent.com/cd7ae84cd15270fe25c3971b22d82b4cbe37cb6b29ef0dd6cc399aa49a620882/68747470733a2f2f706f7365722e707567782e6f72672f7070702f77696b696461746171756572792d6170692f76657273696f6e2e706e67)](https://packagist.org/packages/ppp/wikidataquery-api)[![Download count](https://camo.githubusercontent.com/ba1be35379db9e385165bae50f23097c40ee392fc0090554b56a7740a01232ad/68747470733a2f2f706f7365722e707567782e6f72672f7070702f77696b696461746171756572792d6170692f642f746f74616c2e706e67)](https://packagist.org/packages/ppp/wikidataquery-api)

WikidataQueryApi is a small wrapper for the [WikidataQuery](https://wdq.wmflabs.org) tool. It only supports a subset of the [query syntax](https://wdq.wmflabs.org/api_documentation.html).

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

[](#installation)

Use one of the below methods:

1 - Use composer to install the library and all its dependencies using the master branch:

```
composer require "ppp/wikidataquery-api":dev-master"

```

2 - Create a composer.json file that just defines a dependency on version 1.0 of this package, and run 'composer install' in the directory:

```
{
    "require": {
        "ppp/wikidataquery-api": "~1.0"
    }
}

```

Example
-------

[](#example)

Here is a small usage example:

```
// Load everything
require_once( __DIR__ . '/vendor/autoload.php' );

// Initialise HTTP connection
$api = new WikidataQueryApi( 'https://wdq.wmflabs.org/api' );

// Build helper tools
$wikidataQueryFactory = new WikidataQueryFactory( $api );
$simpleQueryService = $wikidataQueryFactory->newSimpleQueryService();

//Do a query that returns a list of ItemId
//This query finds all the children (P40) of Charlemagne (Q3044)
$itemIds = $simpleQueryService->doQuery(
	new ClaimQuery( new PropertyId( 'P17' ), new ItemId( 'Q3044' ) );
);
```

###  Health Score

33

—

LowBetter than 75% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity22

Limited adoption so far

Community18

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor1

Top contributor holds 87.5% 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 ~125 days

Total

5

Last Release

3693d ago

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

1.2PHP &gt;=5.5.0

### Community

Maintainers

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

---

Top Contributors

[![Tpt](https://avatars.githubusercontent.com/u/458123?v=4)](https://github.com/Tpt "Tpt (35 commits)")[![addshore](https://avatars.githubusercontent.com/u/3308769?v=4)](https://github.com/addshore "addshore (2 commits)")[![JeroenDeDauw](https://avatars.githubusercontent.com/u/146040?v=4)](https://github.com/JeroenDeDauw "JeroenDeDauw (2 commits)")[![progval](https://avatars.githubusercontent.com/u/406946?v=4)](https://github.com/progval "progval (1 commits)")

---

Tags

wikidatawikidataquery

### Embed Badge

![Health badge](/badges/ppp-wikidataquery-api/health.svg)

```
[![Health](https://phpackages.com/badges/ppp-wikidataquery-api/health.svg)](https://phpackages.com/packages/ppp-wikidataquery-api)
```

###  Alternatives

[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3731.2M42](/packages/tencentcloud-tencentcloud-sdk-php)[freearhey/wikidata

A PHP client for working with Wikidata API.

5628.6k](/packages/freearhey-wikidata)[addwiki/wikibase-api

Wikibase API library

254.7k3](/packages/addwiki-wikibase-api)[convertkit/convertkitapi

Kit PHP SDK for the Kit API

2167.1k1](/packages/convertkit-convertkitapi)[mapado/rest-client-sdk

Rest Client SDK for hydra API

1125.9k2](/packages/mapado-rest-client-sdk)

PHPackages © 2026

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