On today's call we discussed that the premise of PR #154 is to allow, as the title states, performing requests on a different target. That is, as opposed to hydra:Operation which always assumes that the target will be the object of a ?s hydra:operation ?o triple.
Taking advantage of supportedProperty and supportedOperation combined should make it also possible.
Let's have a car resource, linked to a steering wheel:
{
"@type": [ "ex:Car" ],
"@id": "/the/car",
"ex:steeringWheel": {
"@id": "/the/wheel"
}
}
We can currently define the ApiDocumentation so that any occurrence of ex:steeringWheel implies that its subject will support given operations:
{
"supportedClass": {
"@id": "ex:Car",
"supportedProperty": {
"@id": "ex:steeringWheel",
"supportedOperation": [ {
"@type": "ex:TurnLeftOperation"
}, {
"@type": "ex:TurnRightOperation"
} ]
}
}
}
This way any subject of ?car ex:steeringWheel ?subject will be a assumed a valid for the turn operations, regardless of it's precise class. I think it should be also allowed to have an IriTemplate in place of /the/wheel
{
"@type": [ "ex:Car" ],
"@id": "/the/car",
"ex:steeringWheel": {
"@type": "IriTemplate"
}
}
@lanthaler please confirm I'm not inventing my own Hydra here.
@elf-pavlik how would similar be expressed with ApiDocumentation and the actions being discussed in #154
On today's call we discussed that the premise of PR #154 is to allow, as the title states, performing requests on a different target. That is, as opposed to
hydra:Operationwhich always assumes that the target will be the object of a?s hydra:operation ?otriple.Taking advantage of
supportedPropertyandsupportedOperationcombined should make it also possible.Let's have a car resource, linked to a steering wheel:
{ "@type": [ "ex:Car" ], "@id": "/the/car", "ex:steeringWheel": { "@id": "/the/wheel" } }We can currently define the ApiDocumentation so that any occurrence of
ex:steeringWheelimplies that its subject will support given operations:{ "supportedClass": { "@id": "ex:Car", "supportedProperty": { "@id": "ex:steeringWheel", "supportedOperation": [ { "@type": "ex:TurnLeftOperation" }, { "@type": "ex:TurnRightOperation" } ] } } }This way any subject of
?car ex:steeringWheel ?subjectwill be a assumed a valid for the turn operations, regardless of it's precise class. I think it should be also allowed to have anIriTemplatein place of/the/wheel{ "@type": [ "ex:Car" ], "@id": "/the/car", "ex:steeringWheel": { "@type": "IriTemplate" } }@lanthaler please confirm I'm not inventing my own Hydra here.
@elf-pavlik how would similar be expressed with ApiDocumentation and the actions being discussed in #154