PHPackages                             acdh-oeaw/acdh-repo - 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. [Database &amp; ORM](/categories/database)
4. /
5. acdh-oeaw/acdh-repo

Abandoned → [achd-oeaw/arche-core](/?search=achd-oeaw%2Farche-core)Library[Database &amp; ORM](/categories/database)

acdh-oeaw/acdh-repo
===================

ARCHE repository backend

5.11.0(2w ago)01311[13 issues](https://github.com/acdh-oeaw/arche-core/issues)MITPHPPHP ^8.4CI passing

Since Mar 16Pushed 2w ago1 watchersCompare

[ Source](https://github.com/acdh-oeaw/arche-core)[ Packagist](https://packagist.org/packages/acdh-oeaw/acdh-repo)[ Docs](https://github.com/acdh-oeaw/arche-core)[ RSS](/packages/acdh-oeaw-acdh-repo/feed)WikiDiscussions master Synced yesterday

READMEChangelog (10)Dependencies (39)Versions (119)Used By (0)

ARCHE-core
==========

[](#arche-core)

[![Latest Stable Version](https://camo.githubusercontent.com/978dc2a026330a6348dfcdcfba8bc7e0c202784b835f0dc7986d7a3f77d24026/68747470733a2f2f706f7365722e707567782e6f72672f616364682d6f6561772f61726368652d636f72652f762f737461626c65)](https://packagist.org/packages/acdh-oeaw/arche-core)[![Build Status](https://github.com/acdh-oeaw/arche-core/actions/workflows/test.yml/badge.svg)](https://github.com/acdh-oeaw/arche-core/actions/workflows/test.yml)[![Coverage Status](https://camo.githubusercontent.com/4147f920d7191db86cfa8dbaeb967beba8244e9cc4343c2269a4554e2dd708e3/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f616364682d6f6561772f61726368652d636f72652f62616467652e7376673f6272616e63683d6d6173746572)](https://coveralls.io/github/acdh-oeaw/arche-core?branch=master)[![License](https://camo.githubusercontent.com/c6898a8f4652de6a81656af90c3d027051f001219b256e668f5d0af539467297/68747470733a2f2f706f7365722e707567782e6f72672f616364682d6f6561772f61726368652d636f72652f6c6963656e7365)](https://packagist.org/packages/acdh-oeaw/arche-core)

The core component of the [ARCHE Suite](https://acdh-oeaw.github.io/arche-docs/) responsible for the CRUD operations and transaction support.

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

[](#installation)

`composer require acdh-oeaw/arche-core`

Deployment
----------

[](#deployment)

See

### Environment for development

[](#environment-for-development)

An environment allowing you to edit code in your host system and run all the tests inside a docker container.

- Clone this repo and enter it ```
    git clone https://github.com/acdh-oeaw/arche-core.git
    cd arche-core
    ```
- Get all dependencies ```
    composer update
    ```
- Build the doker image with the runtime environment ```
    docker build -t arche-dev build/docker
    ```
- Run the runtime environment mounting the repository dir into it and wait until it's ready ```
    docker run --name arche-dev -v `pwd`:/var/www/html -e USER_UID=`id -u` -e USER_GID=`id -g` -d arche-dev
    docker logs -f arche-dev
    ```

    wait until you see (timestamps will obviously differ): ```
    2020-06-04 14:06:52,309 INFO success: apache2 entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
    2020-06-04 14:06:52,309 INFO success: postgresql entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
    2020-06-04 14:06:52,309 INFO success: rabbitmq entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
    2020-06-04 14:06:52,309 INFO success: tika entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)

    ```

    then hit `CTRL+c`
- Enter the docker container and run tests inside it ```
    docker exec -ti -u www-data arche-dev /bin/bash
    ```

    and then inside the container ```
    XDEBUG_MODE=coverage vendor/bin/phpunit
    ```

Remarks:

- By default the development environment runs with PHP configured as an Apache [mod\_php](https://www.php.net/manual/en/install.unix.apache2.php) module but it is also prepared to run PHP as the [FPM](https://www.php.net/manual/en/install.fpm.php). To adjust the config run (in the host system) ```
    docker exec arche-dev a2dissite mod_php
    docker exec arche-dev a2ensite php_fpm
    docker exec -w /root arche-dev supervisorctl restart apache2
    ```

    Similarly to get back to the mod\_php config: ```
    docker exec arche-dev a2dissite php_fpm
    docker exec arche-dev a2ensite mod_php
    docker exec -w /root arche-dev supervisorctl restart apache2
    ```

REST API documentation
----------------------

[](#rest-api-documentation)

-  (Swagger/OpenAPI)
- Guides on

Architecture
------------

[](#architecture)

[![architecture](https://camo.githubusercontent.com/dbae678d7f11a40382a95b1d1c790a2f8b527ea065c72c0f265acca0236427cc/68747470733a2f2f616364682d6f6561772e6769746875622e696f2f61726368652d646f63732f6469616772616d732f61726368652d636f72652e706e67)](https://camo.githubusercontent.com/dbae678d7f11a40382a95b1d1c790a2f8b527ea065c72c0f265acca0236427cc/68747470733a2f2f616364682d6f6561772e6769746875622e696f2f61726368652d646f63732f6469616772616d732f61726368652d636f72652e706e67)

Database structure
------------------

[](#database-structure)

The main table is the `resources` one. It stores a list of all repository resources identified by their internal repo id (the `id` column) as well as transactions handling related data (columns `transaction_id` and `state`).

Metadata are devided into three tables according to the consistency checks applying to them.

- The `identifiers` table stores resources' identifiers (the repository assumes every resource may have many). The table enforces global identifiers uniquness. The RDF property storing the identifier comes implicitly from the repository's `config.yaml` (`$.schema.id`) and is not explicitly stored inside the database.
- The `relations` table stores all RDF triples having an URI as an object. It enforces (with a foreign key check) existence of a repository resource an RDF triple points to.
- The `metadata` table stores all other RDF triples. This table puts no constraints on the data. Triples are stored in an RDF-like way - each row in the table represents a single triple.
    - For triple values which look like a proper number/date the `value_n`/`value_t` column stores a value casted to number/timestamp. This allows for correct comparisons which would fail against string values.
    - The index on the `value` column is set up only on first 1000 characters of the value. This is both for technical and performance reasons. An important consequence is that **if you want to benefit from indexed search on the value column**, you should state your condition as `substring(value, 1, 1000) = 'yourValue'`.

Supplementary tables include:

- The `transactions` table which stores information about pending transactions.
- The `metadata_history` table which stores history of metadata modification. It's automatically filled in using triggers on tables `identifiers`, `relations` and `metadata`.
- The `full_text_search` table storing a GIST index on a tokenized metadata values and resources' text content allowing for a full text search (see the [Postgresql documentation](https://www.postgresql.org/docs/current/textsearch.html)).
- The `spatial_search` table storing vector spatial data as PostGIS geography allowing for spatial searches (see the [PostGIS documentation](https://postgis.net/docs/reference.html)).

### Helper functions and views

[](#helper-functions-and-views)

- The `metadata_view` gathers together triples from both `identifiers`, `relations` and `metadata` tables.
- The `get_relatives()` function allows easy finding of resources related to a given one with a given RDF property. Internally it uses a recursive query which could be difficult to write correctly on you own.
- The `get_neighbors_metadata()` and the `get_relatives_metadata()` functions allow for easy fetching of metadata triples of bot a given resource and resources related to it. Either by any single-hop RDF property (`get_neighbors_metadata()`) or with any number of hops of a one selected metadata property (`get_relatives_metadata()`).

###  Health Score

56

—

FairBetter than 98% of packages

Maintenance97

Actively maintained with recent releases

Popularity11

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity91

Battle-tested with a long release history

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

Recently: every ~26 days

Total

113

Last Release

14d ago

Major Versions

1.11.1 → 2.0.02021-05-25

2.0.4 → 3.0.02021-10-08

3.8.0 → 4.0.02023-08-23

4.1.0 → 5.0.0-RC12024-02-09

PHP version history (5 changes)3.2.0PHP &gt;=8.0 &lt;=8.1

3.2.3PHP &gt;=8.0 &lt;8.2

3.7.8-RC1PHP &gt;=8.0 &lt;8.3

5.0.1PHP ^8.1

5.11.0PHP ^8.4

### 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 (545 commits)")

---

Tags

arche

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

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

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

###  Alternatives

[kreait/firebase-php

Firebase Admin SDK

2.4k39.7M72](/packages/kreait-firebase-php)[tpetry/laravel-mysql-explain

Get Visual MySQL EXPLAIN for Laravel.

264154.2k](/packages/tpetry-laravel-mysql-explain)[aternus/geonames-client

GeoNames API Client

39215.5k2](/packages/aternus-geonames-client)[gearbox-solutions/eloquent-filemaker

A package for getting FileMaker records as Eloquent models in Laravel

6454.8k2](/packages/gearbox-solutions-eloquent-filemaker)

PHPackages © 2026

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