effectiveactivism / schema-api-updater
提供 Schema API 的更新服务。
4.0.2
2021-05-05 10:53 UTC
Requires
- php: ^8.0.2
- effectiveactivism/schema-api: ^0.6
- effectiveactivism/sparql-client: ^4.2
- symfony/messenger: ^5.2
Requires (Dev)
- ext-simplexml: ^8.0
- phpunit/phpunit: ^9
- symfony/browser-kit: ^5.2
- symfony/framework-bundle: ^5.1
- symfony/phpunit-bridge: ^5.1
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-messages 和 https://symfony.com.cn/doc/current/messenger.html#consuming-messages-running-the-worker