I'm new to JSON-LD and I was wondering if there is any way of specifying supported operation of a resource in JSON-LD without using Hydra's supportedOperation or supportedProperty. Is there any way to specify the context something like :
{
"@context" : {
"@vocab" : "http://www.schema.org/",
"data" : "object",
"id" :"Number",
"name" : "alternateName",
"full_name" : "name",
"links" : {
"@id" : "URL",
"@type" : "collection"
},
"href" : "URL",
"rel" : "relatedTo",
"operation" : [
{
"href" : "http://example.com/resources/1/anotherresources/2",
"method" : "POST",
"expects" :[parameter list],
"required" : [list of mandatory arguments],
"fixed value" : [list of argument with fixed value for a resource]
}
]
}
Any guidance would be of great help..
No, you can't specify it in the context. What you can do, however, is to bind an operation to a property in a Hydra
ApiDocumentation
(example 10 in the spec) and reference it via an HTTP Link header.