PHPackages                             acdh-oeaw/arche-oaipmh - 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. acdh-oeaw/arche-oaipmh

ActiveProject[API Development](/categories/api)

acdh-oeaw/arche-oaipmh
======================

OAI-PMH service for the ACDH repo solution

5.4.0(3mo ago)14.0k[2 issues](https://github.com/acdh-oeaw/arche-oaipmh/issues)MITPHPCI passing

Since Mar 16Pushed 3mo ago1 watchersCompare

[ Source](https://github.com/acdh-oeaw/arche-oaipmh)[ Packagist](https://packagist.org/packages/acdh-oeaw/arche-oaipmh)[ Docs](https://github.com/acdh-oeaw/arche-oaipmh)[ RSS](/packages/acdh-oeaw-arche-oaipmh/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (6)Versions (68)Used By (0)

OAI-PMH service for arche-core
==============================

[](#oai-pmh-service-for-arche-core)

[![Latest Stable Version](https://camo.githubusercontent.com/794be66480ef535001218556e6a1dedd2b96be3c9e822753452856a3a60041c0/68747470733a2f2f706f7365722e707567782e6f72672f616364682d6f6561772f61726368652d6f6169706d682f762f737461626c65)](https://packagist.org/packages/acdh-oeaw/arche-oaipmh)[![Build status](https://github.com/acdh-oeaw/arche-oaipmh/workflows/test/badge.svg?branch=master)](https://github.com/acdh-oeaw/arche-oaipmh/workflows/test/badge.svg?branch=master)[![Coverage Status](https://camo.githubusercontent.com/0db4bf7d5de1e47a942d2e5efc1bb11df3778b4bccfe1075ef3541a75c3f9a3e/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f616364682d6f6561772f61726368652d6f6169706d682f62616467652e7376673f6272616e63683d6d6173746572)](https://coveralls.io/github/acdh-oeaw/arche-oaipmh?branch=master)[![License](https://camo.githubusercontent.com/4e5449cc8e9f02de3f7038342317f0b2614bab10d75a4bb66d25bfef4bec3b82/68747470733a2f2f706f7365722e707567782e6f72672f616364682d6f6561772f61726368652d6f6169706d682f6c6963656e7365)](https://packagist.org/packages/acdh-oeaw/arche-oaipmh)

The main aim was to keep it flexible:

- It doesn't enforce any metadata schema. RDF metadata to OAI-PMH facets (id, date, set) mappings are provided in a configuration file.
- It's shipped with classes implementing various OAI-PMH metadata generation scenarios, e.g.:
    - Using Dublin Core and Dublin Core terms contained in the repository resource RDF metadata.
    - Serializing whole repository resource RDF metadata to XML.
    - Serving another linked repository resource as the OAI-PMH metadata.
    - By filling an XML template with repository resource RDF metadata.
- It's easy to extend
    - implement your own metadata sources
    - implement your own search class
    - implement your own sets

REST API Extensions
===================

[](#rest-api-extensions)

The service implements two extensions over the REST API defined by the OAI-PMH specification:

- `verb=GetRecordRaw` returns just a record data without the OAI-PMH "envelope".
- `verb=GetRecordRaw&format=RDFserializationMime` assumes the record is in the RDF-XML and serializes it in a given RDF serialization format (e.g. `text/turtle` or `application/ld+json`)

Installation
============

[](#installation)

- Run in your webroot: ```
    composer require acdh-oeaw/arche-oaipmh
    cp vendor/acdh-oeaw/arche-oaipmh/.htaccess vendor/acdh-oeaw/arche-oaipmh/index.php .
    cp vendor/acdh-oeaw/arche-oaipmh/config-sample.yaml config.yaml
    ```
- Adjust `config.yaml` according to comments in the file.

Required repository structure
=============================

[](#required-repository-structure)

Much attention was paid to make the service flexible. To achieve that different implementations were provided for each of main components (set handling component, metadata source component). These implementations provide various features and put various requirements on your repository structure. Please read the documentation provided in the `config-sample.yaml` and, if needed, the documentation of particular classes to get more information.

Architecture
============

[](#architecture)

Source code documentation can be found at

```
    +------------------+
    | DeletedInterface |
    +------------------+
     ^        ^
     |        |
+-----+    +-----------+
|     |    | Search    |    +-----------+
| Oai |--->| Interface |--->| Metadata  |
|     |    +-----------+    | Interface |
+-----+       |             +-----------+
     |        |
     v        v
    +--------------+
    | SetInterface |
    +--------------+

```

Oai
---

[](#oai)

The main class is `acdhOeaw\oai\Oai` which works as a controller. It:

- checks OAI-PMH requests correctness,
- handles OAI-PMH `identify` and `ListMetadataFormats` commands
    - the `deletedRecord` field value of the `identify` request response is fetched using the `DeletedInterface`
- delegates OAI-PMH `GetRecord`, `ListIdentifiers` and `ListRecords` commands to a chosen class implementing the `acdhOeaw\oai\search\SearchInterface`
- delegates OAI-PMH `ListSets` command to a chosen class extending the `acdhOeaw\oai\set\SetInterface` class.
- generates OAI-PMH compliant output from results of above mentioned actions
- catches errors and generates OAI-PMH compliant error responses

**Until you want to implement the resumption tokens there should be no need to alter this class.**

SetInterface
------------

[](#setinterface)

The `acdhOeaw\oai\set\SetInterface` provides an API:

- for the `Oai` class to handle the `ListSets` OAI-PMH requests
- for the `SearchInterface` implementations to include set information in searches

Currenlty there are three implementations of the `SetInterface`:

- `acdhOeaw\oai\set\NoSet` simply throwing the `noSetHierarchy` OAI-PMH error
- `acdhOeaw\oai\set\Simple` where set membership is fetched from a given RDF metadata property. This property value is taken as both &lt;setSpec&gt; and &lt;setName&gt; values and no &lt;setDescription&gt; is provided.
- `acdhOeaw\oai\set\Complex` where a given RDF metadata property points to another repository resource describing the set.

If exsisting implementations don't fulfil your needs, you need to write your own class extending the `acdhOeaw\oai\set\SetInterface` one and set the `oaiSetClass`in the `config.ini` file to your class name.

DeletedInterface
----------------

[](#deletedinterface)

The `acdhOeaw\oai\deleted\DeletedInterface` provides an API:

- for the `Oai` class to get the `deletedRecord` field value to be reported in the OAI-PMH `identify` response
- for the `SearchInterface` implementations to include information on resource deletion

Currently there are two implementations of the `DeletedInterface`:

- `acdhOeaw\oai\deleted\No` reporting no support for deleted resources
- `acdhOeaw\oai\deleted\RdfProeprty` where a resource having a given metadata property (no matter its value) is assumed to be deleted

If exsisting implementations don't fulfil your needs, you need to write your own class extending the `acdhOeaw\oai\deleted\DeletedInterface` one and set the `oaiDeletedClass` in the `config.ini` file to your class name.

SearchInterface
---------------

[](#searchinterface)

The `acdhOeaw\oai\search\SearchInterface` provides an API for the `Oai` class to:

- Perform search for resources.
- Get basic resource metadata required to serve the `ListIdentifiers` OAI-PMH request.
    Data for each resource are returned as `acdhOeaw\oai\data\Headerdata` objects.
- Get full resource metadata required to serve `ListResources` and `GetRecord` OAI-PMH requests.
    Data for each resource are returned as `acdhOeaw\oai\metadata\MetadataInterface` objects.

The `SearchInterface` implementations depend on three other interfaces:

- `SetInterface` for getting SPARQL search query extensions for including information and/or filters on sets.
- `DeletedInterface` for including information on resources deletion.
- `MetadataInterface` for getting the full resource metadata required to serve `ListResources` and `GetRecord` OAI-PMH requests.

The current implementation (`acdhOeaw\oai\search\BasicSearch`) is quite flexible:

- takes OAI-PMH `identifier` and `datestamp` mappings from the configuration file (`oaiIdProp` and `oaiDateProp`)
- honors set, deleted and metadata format SPARQL search query extensions provided by the `SetInterface`, `DeletedInterface` and `MetadataInterface`

Until you don't need to alter the way `identifier` and `datestamp` are fetched there should be no need to develop an alternative implementation (possibly with additional filters).

MetadataInterface
-----------------

[](#metadatainterface)

The `acdhOeaw\oai\metadata\MetadataInterface` provides a common API for fetching full OAI-PMH metadata from different sources, e.g. the repository resource metadata (by applying different mappings) or other repository resource.

To make it as flexible as possible:

- It allows to extend SPARQL search queries performed by the `SearchInterface`implementations.
- The `MetadataInterface` object constructor is provided with repository resource object, the metadata format description and full set of SPARQL search query data describing a given resource.

Existing implementations are:

- `acdhOeaw\oai\metadata\RdfXml` serializes all resource's RDF metadata into XML.
- `acdhOeaw\oai\metadata\DcMetadata` like the `RdfXml` but returns only Dublin Core and Dublin Core Terms metadata properties.
- `acdhOeaw\oai\metadata\ResMetadata` uses another (linked trough metadata) resource's binary payload as the OAI-PMH metadata.
- `acdhOeaw\oai\metadata\CmdiMetadata` a specialization of the `ResMetadata`additionaly checking for the binary resource content schema.
- `acdhOeaw\oai\metadata\TemplateMetadata` creates metadata based on flexible XML templates. More detailed description can be found [here](doc/TemplateMetadata.md).

It's possible that you'll need to generate OAI-PMH metadata in (yet) another way. In such a case you must develop your own class implementing the `MetadataInterface`. Taking look at already existing implementations should be a good starting point.

###  Health Score

45

—

FairBetter than 92% of packages

Maintenance60

Regular maintenance activity

Popularity23

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity71

Established project with proven stability

 Bus Factor1

Top contributor holds 96.7% 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 ~33 days

Recently: every ~80 days

Total

66

Last Release

103d ago

Major Versions

1.4.0 → 2.0.0-alpha2021-05-20

v1.x-dev → 2.0.02021-05-26

2.7.0 → 3.0.02022-07-08

3.0.0 → 4.0.02022-07-12

4.2.5 → 5.0.02024-03-07

### Community

Maintainers

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

---

Top Contributors

[![zozlak](https://avatars.githubusercontent.com/u/6503177?v=4)](https://github.com/zozlak "zozlak (174 commits)")[![nczirjak-acdh](https://avatars.githubusercontent.com/u/20183307?v=4)](https://github.com/nczirjak-acdh "nczirjak-acdh (4 commits)")[![vronk](https://avatars.githubusercontent.com/u/1272691?v=4)](https://github.com/vronk "vronk (2 commits)")

---

Tags

arche

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/acdh-oeaw-arche-oaipmh/health.svg)

```
[![Health](https://phpackages.com/badges/acdh-oeaw-arche-oaipmh/health.svg)](https://phpackages.com/packages/acdh-oeaw-arche-oaipmh)
```

###  Alternatives

[twilio/sdk

A PHP wrapper for Twilio's API

1.6k92.9M272](/packages/twilio-sdk)[knplabs/github-api

GitHub API v3 client

2.2k15.8M187](/packages/knplabs-github-api)[facebook/php-business-sdk

PHP SDK for Facebook Business

90121.9M34](/packages/facebook-php-business-sdk)[meilisearch/meilisearch-php

PHP wrapper for the Meilisearch API

73813.7M114](/packages/meilisearch-meilisearch-php)[google/common-protos

Google API Common Protos for PHP

173103.7M50](/packages/google-common-protos)[hubspot/api-client

Hubspot API client

23414.2M16](/packages/hubspot-api-client)

PHPackages © 2026

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