PHPackages                             dagstuhl/datacite - 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. dagstuhl/datacite

ActiveLibrary[API Development](/categories/api)

dagstuhl/datacite
=================

A DataCite API client for creating/updating DOI metadata (Schema 4.4), developed and used by Dagstuhl Publishing.

2.0.9(2y ago)012MIT licensePHPPHP ^8.1

Since Oct 7Pushed 1y ago1 watchersCompare

[ Source](https://github.com/dagstuhl-publishing/datacite-client)[ Packagist](https://packagist.org/packages/dagstuhl/datacite)[ RSS](/packages/dagstuhl-datacite/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (1)Versions (16)Used By (0)

The Dagstuhl DataCite API client
================================

[](#the-dagstuhl-datacite-api-client)

The aim of this project is to provide an easy-to-use php interface for

- providing schema-compliant DataCite metadata (Schema 4.4)
- registering/updating the doi metadata via the DataCite API.

Note:

- This is not a full API implementation; it only covers the use cases required by Dagstuhl Publishing.
- This is a mirror of the master branch of our internal git.

Installation: `composer require dagstuhl/datacite`

### Code Examples:

[](#code-examples)

### 1) Creation of a metadata record

[](#1-creation-of-a-metadata-record)

- General Information:

```
$dataCiteRecord = new DataCiteRecord();
$dataCiteRecord->setDoi('10.publisher.example-doi');
$dataCiteRecord->addTitle(Title::main('This is an example title', 'en'));
```

- Adding an author with affiliation:

```
$creator = Creator::personal('Concatenated Names', 'Given Name', 'Family Name');
$creator->addAffiliation(new Affiliation('This is a sample affiliation'));

$dataCiteRecord->addCreator($creator);
```

- Adding an editor with affiliation based on ror Identifier:

```
$name = Name::organizational('Schloss Dagstuhl - Leibniz-Zentrum für Informatik');
$name->addAffiliation(Affiliation::ror('00k4h2615'));
$contributor = Contributor::editor($name);

$dataCiteRecord->addContributor($contributor);
```

- Adding relationships to other resources / alternative identifiers:

```
$related = [];
$related[] = RelatedIdentifier::isPartOf('arXiv:....', RelatedIdentifier::TYPE_ARXIV);
$related[] = RelatedIdentifier::cites('10....', RelatedIdentifier::TYPE_DOI);

$alternate = [];
$alternate[] = AlternateIdentifier::urn('this is a demo urn');
$alternate[] = AlternateIdentifier::isbn('this is a demo urn');

$dataCiteRecord->setRelatedIdentifiers($related);
$dataCiteRecord->setAlternateIdentifiers($alternate);
```

- Classifying the type of the Document

```
$type = new Type(
    TYPE::RESOURCE_TYPE_GENERAL_TEXT,
    TYPE::RESOURCE_TYPE_BOOK,
    TYPE::BIBTEX_TYPE_BOOK
);

// or choose a pre-defined type, e.g.,

$type = Type::conferenceProceedingsPaper();
$type = Type::conferenceJournalPaper();
$type = Type::bookChapter();
...

$dataCiteRecord->setType($type);
```

- Add date-fields:

```
$dates = [];
$dates[] = Date::created('2020-10-06');
$dates[] = Date::issued('2020-10-06');
$dates[] = Date::copyrighted('2020-10-06');

$dataCiteRecord->setDates($dates);
```

- View the generated JSON:

```
var_dump($dataCiteRecord->toApiJson());
```

### 2) Registering/Updating DOI Metadata

[](#2-registeringupdating-doi-metadata)

- Updating an existing record:

```
$dataCiteClient = new DataCiteClient('username', 'password', 'api-url');

$dataCiteRecord = $dataCiteClient->updateDataCiteRecord($dataCiteRecord);

if ($dataCiteRecord === NULL) {
   // error handling goes here
}
```

- The same lines of code produce a draft record, if the DOI was not registered before. To make this draft data publicly available and finally register the doi, simply call

```
$dataCiteRecord = $dataCiteClient->setDoiState($dataCiteRecord->getDoi(), DataCiteClient::STATE_FINDABLE);
```

- For error handling/debugging, use the following methods showing details on the status of the last HTTP-request:

```
$dataCiteClient->getException() / ...->getErrorMessage() / ->getResponse() / ->getStatus()
```

### 3) Connect to your own models by implementing a `DataCiteDataProvider`

[](#3-connect-to-your-own-models-by-implementing-a-datacitedataprovider)

- the `DataCiteDataProvider` interface provides a clean interface to your custom models
- just implement this interface on your models and obtain a DataCiteRecord by

```
class MyModelDataProvider implements \Dagstuhl\DataCite\DataCiteDataProvider {
   // ... see the interface for details ...
}

$dataProvider = new MyModelDataProvider($myModel);
$dataCiteRecord = DataCiteRecord::fromDataProvider($dataProvider);
```

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance33

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity71

Established project with proven stability

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

Recently: every ~0 days

Total

15

Last Release

860d ago

Major Versions

1.1.1 → 2.0.02020-10-07

PHP version history (3 changes)1.0.0PHP ^7.2

1.1.0PHP ^7.4|^8.0

2.0.0PHP ^8.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/1a3e25acc5299e3d77c48632a2cf5569427fb149ac4458f80c86163858e4f441?d=identicon)[Schloss Dagstuhl - LZI](/maintainers/Schloss%20Dagstuhl%20-%20LZI)

---

Top Contributors

[![mdidas](https://avatars.githubusercontent.com/u/55133075?v=4)](https://github.com/mdidas "mdidas (36 commits)")

---

Tags

metadatadataciteDOI registration

### Embed Badge

![Health badge](/badges/dagstuhl-datacite/health.svg)

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

###  Alternatives

[temporal/sdk

Temporal SDK

4002.2M18](/packages/temporal-sdk)[storyblok/php-content-api-client

PHP Client for Storyblok Content API

11136.8k4](/packages/storyblok-php-content-api-client)[storyblok/php-management-api-client

Storyblok PHP Client for Management API

1224.4k1](/packages/storyblok-php-management-api-client)[smnandre/pagespeed-api

PageSpeed Insight PHP Api Client 🚀 Analyse web pages for performances metrics, core web vitals...

1511.5k](/packages/smnandre-pagespeed-api)

PHPackages © 2026

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