PHPackages                             samwilson/simple-wikidata - 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. samwilson/simple-wikidata

ActiveLibrary[API Development](/categories/api)

samwilson/simple-wikidata
=========================

A very simplistic library for interacting with Wikidata in PHP.

0.6.1(7y ago)222GPL-3.0-or-laterPHP

Since Oct 27Pushed 7y ago1 watchersCompare

[ Source](https://github.com/samwilson/simple-wikidata)[ Packagist](https://packagist.org/packages/samwilson/simple-wikidata)[ RSS](/packages/samwilson-simple-wikidata/feed)WikiDiscussions master Synced 2w ago

READMEChangelogDependencies (9)Versions (8)Used By (0)

Simple Wikidata
===============

[](#simple-wikidata)

This is a simple (and limited, by design) package for interacting with Wikidata from PHP.

[![Packagist](https://camo.githubusercontent.com/a160b37dc51b59494d7eb4f7f1e14f35985250f9ac9edd65870a6eba4185f3eb/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f73616d77696c736f6e2f73696d706c652d77696b69646174612e737667)](https://packagist.org/packages/samwilson/simple-wikidata)[![License](https://camo.githubusercontent.com/b1933098f85327a78b1cc830e0b8272f5066ce6585bd1e8b24b133f011c834a9/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f73616d77696c736f6e2f73696d706c652d77696b69646174612e737667)](https://www.gnu.org/licenses/gpl-3.0)[![GitHub issues](https://camo.githubusercontent.com/b9af01aacd4de50d7c48296e8116eb3a08f82ad5ad687cddf52130c809ad3d87/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6973737565732f73616d77696c736f6e2f73696d706c652d77696b69646174612e737667)](https://github.com/samwilson/simple-wikidata/issues)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/a61febac409a6800e73e190741b8f93ef316c20b1c4d9c3f270dcde07289159d/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f73616d77696c736f6e2f73696d706c652d77696b69646174612f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/samwilson/simple-wikidata/?branch=master)[![Code Coverage](https://camo.githubusercontent.com/465c9ac58242d3e74dd4a1ab4245c395a7b68c6bf2ad72f7477b01174d08cda0/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f73616d77696c736f6e2f73696d706c652d77696b69646174612f6261646765732f636f7665726167652e706e67)](https://scrutinizer-ci.com/g/samwilson/simple-wikidata/)[![Build Status](https://camo.githubusercontent.com/4dc399c4c361a518a7537a867e3335bdc494cbce50d66c48004a777000df84ec/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f73616d77696c736f6e2f73696d706c652d77696b69646174612f6261646765732f6275696c642e706e67)](https://scrutinizer-ci.com/g/samwilson/simple-wikidata/build-status/)

Example
-------

[](#example)

```
// The Sparql must return an ?item column.
$sparql = "SELECT ?item WHERE { ?item wdt:P31 wd:Q54050 } LIMIT 5";
$cache = new \Stash\Pool(new \Stash\Driver\FileSystem());
$people = new \Samwilson\SimpleWikidata\Query($sparql, 'en', $cache);
foreach ($people->getItems() as $person) {
    // Each $person is an Item object.
    $person->getLabel();
    $person->getPropertyOfTypeItem();
    $person->getPropertyOfTypeQuantity();
    $person->getPropertyOfTypeIdentifier(); // External identifier
    $person->getPropertyOfTypeUrl();
    $person->getPropertyOfTypeTime();
    $person->getPropertyOfTypeString(); // No language
    $person->getPropertyOfTypeText(); // Has language
    $person->getPropertyOfTypeCoord();
    $person->getPropertyOfTypeFile(); // Commons media
}
```

Licence
-------

[](#licence)

GPL3.0+

###  Health Score

26

—

LowBetter than 40% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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 ~105 days

Recently: every ~77 days

Total

7

Last Release

2582d ago

### Community

Maintainers

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

---

Top Contributors

[![samwilson](https://avatars.githubusercontent.com/u/213655?v=4)](https://github.com/samwilson "samwilson (13 commits)")

---

Tags

api-clientphpwikidata

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/samwilson-simple-wikidata/health.svg)

```
[![Health](https://phpackages.com/badges/samwilson-simple-wikidata/health.svg)](https://phpackages.com/packages/samwilson-simple-wikidata)
```

###  Alternatives

[symfony/symfony

The Symfony PHP framework

31.4k87.4M2.2k](/packages/symfony-symfony)[symfony/cache

Provides extended PSR-6, PSR-16 (and tags) implementations

4.2k382.4M3.7k](/packages/symfony-cache)[sylius/sylius

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

8.5k6.0M776](/packages/sylius-sylius)[api-platform/core

Build a fully-featured hypermedia or GraphQL API in minutes!

2.6k52.2M371](/packages/api-platform-core)[phpdocumentor/phpdocumentor

Documentation Generator for PHP

4.3k3.1M917](/packages/phpdocumentor-phpdocumentor)[craftcms/cms

Craft CMS

3.6k3.7M3.4k](/packages/craftcms-cms)

PHPackages © 2026

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