Re: [Specifications] Specifying a list of resources of different types in `hydra:operation` `expects` field (#249)

First of all - I'd split it into several operations each expecting different class. Your example:
```json
"expects": [
    "http://api.example.com/classes/Folder",
    "http://api.example.com/classes/File",
]
```
would imply a resource that is both `Folder` and `File` is expected which I believe is far from your requirements.

As for additional _constraints_ on those expectations i see three solutions:
- SHACL
- RDF/RDFS/OWL

Both may put additional stress on the client, but the former feels better for this purpose. Both constructs may be invisible for generic clients understanding pure hydra, yet still the client may be instructed that the server uses extensions via `extension` property attached to `ApiDocumentation`

You could also consider typeahead-like or list of possible values in order to constrain user from providing any kind of details.
The `supportedClass`/`supportedProperty` and `search` might come in handy. There are some examples in the release-candidate spec sitting in this [PR](https://github.com/alien-mcl/Specifications/blob/release-candidate/spec/latest/core/index.bs#L1304C31-L1304C60)

>Hydra schema defines the expects field as a Link

The `hydra:expects` is a predicate declared as link so the client can see a notion that the operation is somehow linked to the resource in `expects` relation, but the predicate can be used in between whatever is in the `domainIncludes` (left part of the relation) and `rangeIncludes` (right part of the relation), i.e.:

```turtle
some:Operation hydra:expects some:Resource
```

-- 
GitHub Notification of comment by alien-mcl
Please view or discuss this issue at https://github.com/HydraCG/Specifications/issues/249#issuecomment-1724307139 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Monday, 18 September 2023 20:18:02 UTC