effectiveactivism/schema-api-updater

Provides an update service for Schema API.

4.0.2 2021-05-05 10:53 UTC

This package is auto-updated.

Last update: 2024-04-05 17:27:27 UTC


README

A small service to update SHACL validation when the triplestore that powers the Schema API is updated with new classes, properties or types.

Installation

To install, run

composer require effectiveactivism/schema-api-updater

Configuration

This bundle has no configuration but requires the effectiveactivism/sparql-client bundle to work.

See below for information on setting up the messaging system used to generate the SHACL file.

Usage

After updating your triplestore, run this service to create a new SHACL validation file. This file can be used by a validation service to ensure that your validation is up-to-date with your triplestore classes.

namespace App\Controller;

use EffectiveActivism\SchemaApiUpdater\Service\Updater;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;

class MyController extends AbstractController
{
  public function example(Updater $updater)
  {
    $updater->run();
  }
}

Once generated, move the file from /tmp/schema-api-updater-shacl.ttl (or wherever the system temporary directory is) to a destination visible to the SHACL validator service.

Asynchronous handling

This bundle uses the Symfony messaging system .
Because all classes, their properties and types are processed, it is recommended to use an asynchronous queue to generate the SHACL file.

For more information, see https://symfony.com/doc/current/messenger.html#transports-async-queued-messages and https://symfony.com/doc/current/messenger.html#consuming-messages-running-the-worker