effectiveactivism/schema-api-updater

提供 Schema API 的更新服务。

安装: 61

依赖项: 0

建议者: 0

安全: 0

星标: 0

分支: 0

类型:symfony-bundle

4.0.2 2021-05-05 10:53 UTC

This package is auto-updated.

Last update: 2024-09-05 18:31:13 UTC


README

这是一个小型服务,用于在 Schema API 的后端三联库更新时更新 SHACL 验证。

安装

要安装,请运行

composer require effectiveactivism/schema-api-updater

配置

此扩展包没有配置,但需要 effectiveactivism/sparql-client 扩展包才能工作。

有关设置用于生成 SHACL 文件的消息系统的信息,请参见 以下内容

使用方法

在更新您的三联库后,运行此服务以创建一个新的 SHACL 验证文件。此文件可由验证服务使用,以确保您的验证与三联库中的类保持最新。

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();
  }
}

一旦生成,将文件从 /tmp/schema-api-updater-shacl.ttl(或系统临时目录中的任何位置)移动到 SHACL 验证服务可见的位置。

异步处理

此扩展包使用 Symfony 消息系统
由于所有类、它们的属性和类型都需要处理,因此建议使用异步队列来生成 SHACL 文件。

有关更多信息,请参阅 https://symfony.com.cn/doc/current/messenger.html#transports-async-queued-messageshttps://symfony.com.cn/doc/current/messenger.html#consuming-messages-running-the-worker