-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for allowed literals and allowed individuals #82
Comments
Isn't that part of ontological modelling, and thus part of the property? PS What is the Hydra mailing list thread for this? |
Hi Ruben, I do not think the ontological model of a property covers it. On the one hand, sometimes not all possible values are predefined, but they may be extensible by individuals from other vocabs, see the usage of goodrelations enums from schema.org. On the other hand, while a value might occur on a class in general, it might not be suitable in a particular context. I'll add the corresponding mailing list thread url later, it is there, albeit somewhat nested. Cheers, ---- Ruben Verborgh schrieb ----
|
I think @RubenVerborgh is right and allowed individuals in most cases are topic for modelling. I can see at least two options here:
In both cases, it doesn't have anything to do with hydra itself - it is enabled for structure and their properties description with Yet, I can see one more situation - imagine a form i.e. for adding products to the shop. In a field for category, I'd like to to have a pointer (i.e. IRI templated link) that should pull categories for that very field (which would take into account current product details). |
Another example would be an issue tracker and a form of a new issue with possibility of assigning users to it - I'd like to have an link given to a place that would pull a list of suitable users (i.e. in context of the current project a new issue is related to). |
Currently there is no way in hydra to express a fixed number of possible values.
There seem to be no other established vocabularies which allow us to do so. At some point the RDF Shape WG shall provide a comprehensive way to express this and other constraints which then would supersede this proposal., But I think we need this earlier and I hope that hydra can provide valuable input to the Resource Shape WG by introducing such a facility which also integrates well with json-ld.
Proposal:
Have the following new properties and classes.
FIrst, hydra:allowedIndividual for enum values or other individuals with optional localized hydra:title to solve the value vs. caption problem.
The :individual is for allowed values which are URIs, it should be used to apply @type:@vocab in the context.
Sample usage below. Client has requested Italian. The other language constructs of json-ld would work, too, see sample jsonld playgrounds below.
Second, hydra:allowedLiteral is for scalar values like strings or numbers.
Finally, by dereferencing hydra:allowedResource the client can get a Collection or PagedCollection of allowed individuals which may have a search property in turn. This would be useful in case the number of allowed individuals is too large for :allowedIndividual.
Also see http://tinyurl.com/qz85ep6 for a real-life JSON-LD playground example of allowedIndividual vs. allowedLiteral.
On http://tinyurl.com/om7fsqc one can see a language map.
On http://tinyurl.com/px4aj75 one can see an illustration for allowedResource with IriTemplate.
The text was updated successfully, but these errors were encountered: