[Specifications] Supported property values source (#227)

alien-mcl has just created a new issue for https://github.com/HydraCG/Specifications:

== Supported property values source ==
## Describe the requirement

There are circumstances in which API would like to announce source of values for a specific supported property.
While Hydra is not focusing on data structure descriptions, binding between properties and operations feeding these properties feels like in the area of interest for Hydra Core Vocabulary.

## Hydra-agnostic example

Imagine a UI that shows an auto-generated form based on what API says, i.e. an issue. Between simple literal properties like title and description there is also an assignee. In order to avoid manual typing of person's details I'd like to be able to pick one from a list. Now the tricky part - how to drive that list (and the fact there is that list available).

## Proposed solutions

My idea is to extend a bit a specification by inserting a new section in paragraph 5. Advanced Concepts. That bit of a description would describe _special_ behavior that client would need to incorporate in case of either _hydra:collection_ or _hydra:search_ predicates encountered either on instances of _hydra:SupportedProperty_ or _rdf:Property_. The former would let the client to discover that the collection provided feeds values for that very property and the latter provides a type-ahead-like list of values for that very property.

```turtle
<> a hydra:ApiDocumentation;
  hydra:supportedClass api:Issue.
api:Issue a rdf:Class;
  hydra:supportedProperty [
    hydra:property api:assignee;
    hydra:search [
      hydra:template "http://temp.uri/api/user{?search}";
      hydra:variable "search";
      hydra:property hydra:freetextQuery;
      hydra:required "true"^^xsd:boolean
    ]
  ].
```

These details could be provided either on API Documentation level and inlined mandating the client to use the most specific source possible. This would mean that if an inlined declaration is available in the request that drove the form creation, that declaration should be used. Otherwise API documentation level declaration can be used as fallback.

Please view or discuss this issue at https://github.com/HydraCG/Specifications/issues/227 using your GitHub account


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

Received on Wednesday, 7 April 2021 19:13:50 UTC