PHPackages                             wikibase/data-model - 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/data-model

ActiveLibrary

wikibase/data-model
===================

PHP implementation of the Wikibase DataModel

9.6.1(5y ago)37243.3k↓40.6%20[4 issues](https://github.com/wmde/WikibaseDataModel/issues)[5 PRs](https://github.com/wmde/WikibaseDataModel/pulls)20GPL-2.0-or-laterPHPPHP ^8.0|^7.1CI failing

Since Jun 17Pushed 3mo ago28 watchersCompare

[ Source](https://github.com/wmde/WikibaseDataModel)[ Packagist](https://packagist.org/packages/wikibase/data-model)[ Docs](https://github.com/wmde/WikibaseDataModel)[ RSS](/packages/wikibase-data-model/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (6)Versions (76)Used By (20)

Wikibase DataModel
==================

[](#wikibase-datamodel)

[![Build Status](https://github.com/wmde/WikibaseDataModel/actions/workflows/lint-and-test.yaml/badge.svg?branch=master)](https://github.com/wmde/WikibaseDataModel/actions/workflows/lint-and-test.yaml)[![Download count](https://camo.githubusercontent.com/ae70937f8eb7c6b283a287c3c725a4cb3ce930cc87177ab86d2f255daaa1367d/68747470733a2f2f706f7365722e707567782e6f72672f77696b69626173652f646174612d6d6f64656c2f642f746f74616c2e706e67)](https://packagist.org/packages/wikibase/data-model)[![License](https://camo.githubusercontent.com/a92fea5307afbad886bf9d240751a6d2f50afa7a66add7e229479a53da537e06/68747470733a2f2f706f7365722e707567782e6f72672f77696b69626173652f646174612d6d6f64656c2f6c6963656e73652e737667)](https://packagist.org/packages/wikibase/data-model)

[![Latest Stable Version](https://camo.githubusercontent.com/063b0f5e0e3b937b074326a9085b5f7a5ea5eb5a3fe3edf7bff80f3ccf4bba13/68747470733a2f2f706f7365722e707567782e6f72672f77696b69626173652f646174612d6d6f64656c2f76657273696f6e2e706e67)](https://packagist.org/packages/wikibase/data-model)[![Latest Unstable Version](https://camo.githubusercontent.com/9dace8815185c7c35d22faae5eaf8c1c460784d145c42daa3fabb70692880e2d/68747470733a2f2f706f7365722e707567782e6f72672f77696b69626173652f646174612d6d6f64656c2f762f756e737461626c652e737667)](//packagist.org/packages/wikibase/data-model)

**Wikibase DataModel** is the canonical PHP implementation of the [Data Model](https://www.mediawiki.org/wiki/Wikibase/DataModel)at the heart of the [Wikibase software](http://wikiba.se/).

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

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

Note that this repository is a mirror of part of the upstream [Wikibase project](https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/extensions/Wikibase/+/refs/heads/master/lib/packages/wikibase/data-model/) on Gerrit. Contributions should be made to the directories there using MediaWiki's [Gerrit process](https://www.mediawiki.org/wiki/Gerrit).

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/data-model` to your project's `composer.json` file. Here is a minimal example of a `composer.json` file that just defines a dependency on Wikibase DataModel 9.x:

```
{
    "require": {
        "wikibase/data-model": "~9.0"
    }
}
```

### Manual

[](#manual)

Get the Wikibase DataModel 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. The "autoload" section of this file specifies how to load the resources provide by this library.

Library contents
----------------

[](#library-contents)

This library contains domain objects that implement the concepts part of the [Wikibase DataModel](https://www.mediawiki.org/wiki/Wikibase/DataModel). This mainly includes simple value objects, though also contains core domain logic either bound to such objects or encapsulated as service objects.

Tests
-----

[](#tests)

This library comes with a set up PHPUnit tests that cover all non-trivial code. Additionally, code style checks by PHPCS and PHPMD are supported. The configuration for all 3 these tools can be found in the root directory. You can use the tools in their standard manner, though can run all checks required by our CI by executing `composer ci`. To just run tests use `composer test`, and to just run style checks use `composer cs`.

Contributing
------------

[](#contributing)

This repository is a mirror of part of the upstream [Wikibase project](https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/extensions/Wikibase/+/refs/heads/master/lib/packages/wikibase/data-model/) on Gerrit. Contributions should be made to the directories there using MediaWiki's [Gerrit process](https://www.mediawiki.org/wiki/Gerrit).

Credits
-------

[](#credits)

### Development

[](#development)

Wikibase DataModel has been written by [Jeroen De Dauw](https://www.EntropyWins.wtf)and Thiemo Kreuz as [Wikimedia Germany](https://wikimedia.de) employees for the [Wikidata project](https://wikidata.org/).

Contributions were also made by [several other people](https://www.ohloh.net/p/wikibasedatamodel/contributors?sort=commits).

### Concept

[](#concept)

The initial [conceptual specification](https://www.mediawiki.org/wiki/Wikibase/DataModel)for the DataModel was created by [Markus Krötzsch](http://korrekt.org/)and [Denny Vrandečić](http://simia.net/wiki/Denny), with minor contributions by Daniel Kinzler and Jeroen De Dauw.

Links
-----

[](#links)

- [Wikibase DataModel on Packagist](https://packagist.org/packages/wikibase/data-model)
- [Wikibase DataModel on Ohloh](https://www.ohloh.net/p/wikibasedatamodel/)
- [Wikibase DataModel on TravisCI](https://travis-ci.org/wmde/WikibaseDataModel)
- [Wikibase DataModel on Wikimedia's Phabricator](https://phabricator.wikimedia.org/project/view/920/)

See also
--------

[](#see-also)

- [Blog posts on Wikibase DataModel](http://www.bn2vs.com/blog/tag/wikibase-datamodel/)
- [Wikibase DataModel Services](https://github.com/wmde/WikibaseDataModelServices)
- [Wikibase DataModel Serialization](https://github.com/wmde/WikibaseDataModelSerialization)
- [Wikibase Internal Serialization](https://github.com/wmde/WikibaseInternalSerialization)

###  Health Score

58

—

FairBetter than 98% of packages

Maintenance51

Moderate activity, may be stable

Popularity45

Moderate usage in the ecosystem

Community44

Growing community involvement

Maturity83

Battle-tested with a long release history

 Bus Factor2

2 contributors hold 50%+ of commits

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 ~65 days

Recently: every ~420 days

Total

66

Last Release

494d ago

Major Versions

5.1.0 → 6.0.02016-03-10

6.3.1 → 7.0.02017-03-15

7.5.0 → 8.0.02018-08-04

8.0.0 → 9.0.02018-11-06

9.6.1 → v10.x-dev2025-01-09

PHP version history (8 changes)0.4PHP &gt;=5.3.0

6.2.0PHP &gt;=5.5.0

7.1.0PHP &gt;=5.5.9

9.0.0PHP &gt;=5.6

9.1.0PHP &gt;=5.6.99

9.3.0PHP ^7.1

9.6.0PHP ^8.0|^7.1

v10.x-devPHP ^8.0|^7.4

### 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/8cc7ef1a982b9520bbe19e7699556cda12f528e2fcece72d0d18e79b6457794c?d=identicon)[mariushoch](/maintainers/mariushoch)

---

Top Contributors

[![JeroenDeDauw](https://avatars.githubusercontent.com/u/146040?v=4)](https://github.com/JeroenDeDauw "JeroenDeDauw (950 commits)")[![thiemowmde](https://avatars.githubusercontent.com/u/6576639?v=4)](https://github.com/thiemowmde "thiemowmde (429 commits)")[![Benestar](https://avatars.githubusercontent.com/u/2998254?v=4)](https://github.com/Benestar "Benestar (160 commits)")[![addshore](https://avatars.githubusercontent.com/u/3308769?v=4)](https://github.com/addshore "addshore (110 commits)")[![mariushoch](https://avatars.githubusercontent.com/u/2446964?v=4)](https://github.com/mariushoch "mariushoch (79 commits)")[![manicki](https://avatars.githubusercontent.com/u/3524114?v=4)](https://github.com/manicki "manicki (48 commits)")[![lucaswerkmeister](https://avatars.githubusercontent.com/u/2346599?v=4)](https://github.com/lucaswerkmeister "lucaswerkmeister (35 commits)")[![translatewiki](https://avatars.githubusercontent.com/u/24829418?v=4)](https://github.com/translatewiki "translatewiki (26 commits)")[![Ladsgroup](https://avatars.githubusercontent.com/u/5351225?v=4)](https://github.com/Ladsgroup "Ladsgroup (21 commits)")[![jakobw](https://avatars.githubusercontent.com/u/453024?v=4)](https://github.com/jakobw "jakobw (19 commits)")[![JanZerebecki](https://avatars.githubusercontent.com/u/7452727?v=4)](https://github.com/JanZerebecki "JanZerebecki (17 commits)")[![tobijat](https://avatars.githubusercontent.com/u/2997252?v=4)](https://github.com/tobijat "tobijat (13 commits)")[![JonasKress](https://avatars.githubusercontent.com/u/13198391?v=4)](https://github.com/JonasKress "JonasKress (9 commits)")[![umherirrender](https://avatars.githubusercontent.com/u/1174884?v=4)](https://github.com/umherirrender "umherirrender (8 commits)")[![snaterlicious](https://avatars.githubusercontent.com/u/5755120?v=4)](https://github.com/snaterlicious "snaterlicious (7 commits)")[![mlazowik](https://avatars.githubusercontent.com/u/1978721?v=4)](https://github.com/mlazowik "mlazowik (7 commits)")[![toban](https://avatars.githubusercontent.com/u/352149?v=4)](https://github.com/toban "toban (7 commits)")[![filbertkm](https://avatars.githubusercontent.com/u/135401?v=4)](https://github.com/filbertkm "filbertkm (7 commits)")[![DanweDE](https://avatars.githubusercontent.com/u/101926?v=4)](https://github.com/DanweDE "DanweDE (7 commits)")[![itamargiv](https://avatars.githubusercontent.com/u/6132917?v=4)](https://github.com/itamargiv "itamargiv (6 commits)")

---

Tags

wikidatawikibaseDataModel

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[wikibase/data-model-serialization

Serializers and deserializers for the Wikibase DataModel

10196.3k8](/packages/wikibase-data-model-serialization)[data-values/data-values

Defines the DataValue interface and some trivial implementations

171.0M22](/packages/data-values-data-values)[jeroen/json-dump-reader

Provides line-by-line readers and iterators for Wikibase/Wikidata JSON dumps

7412.3k](/packages/jeroen-json-dump-reader)[data-values/geo

Geographical value objects, parsers and formatters

20631.0k18](/packages/data-values-geo)[data-values/common

Contains common implementations of the interfaces defined by DataValuesInterfaces

11934.5k13](/packages/data-values-common)[data-values/number

Numerical value objects, parsers and formatters

18303.0k14](/packages/data-values-number)

PHPackages © 2026

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