是否有一个工具可以为 JSON-LD 的 RESTful 服务生成框架,该服务具有使用 hydra 定义的操作。例如下面的例子,假设我有一个 Java 类存在 Person,构建一个反向工程 JSON-LD 以生成完整 spring mvc 代码的工具将是一个原始的想法。
{
"@context": [
"http://www.w3.org/ns/hydra/core",
{
"@vocab": "https://schema.org/",
"image": { "@type": "@id" },
"friends": { "@type": "@id" }
}
],
"@id": "https://api.example.com/player/1234567890/friends",
"operation": {
"@type": "BefriendAction",
"method": "POST",
"expects": {
"@id": "http://schema.org/Person",
"supportedProperty": [
{ "property": "name", "range": "Text" },
{ "property": "alternateName", "range": "Text" },
{ "property": "image", "range": "URL" }
]
}
}
}