-
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
IriTemplate should have a way to describe variable as UUID etc. #145
Comments
Is this in general about specifying the value type for template variables? |
Yes, if we rely on PROPOSAL: add something like |
What on earth is Like you say, currently we have the {
"@type": "IriTemplate",
"mapping": [
{
"@type": "IriTemplateMapping",
"property": "hydra:freetextQuery"
}
]
} Strangely enough it doesn't have a range defined. But, I assume it's intended to be used with If so, maybe the simplest is to explicitly declare that if necessary. Even on an anonymous property? {
"@type": "IriTemplate",
"mapping": [
{
"@type": "IriTemplateMapping",
"variable": "identifier",
"property": {
"rdfs:range": "??:uuid"
}
}
]
} |
What’s the use case for this? Why does it need to be part of Hydra and not the domain vocabulary (e.g. schema.org)?
|
I'm not sure what you're asking actually. Wrt the user case, I think that we lack a way to determine what is the data type of IriTemplate's variables. For example, you could get a template to filter a collection by selecting {
"@type": "IriTemplate",
"template": "/api/events{?year}",
"mapping": [
{
"@type": "IriTemplateMapping",
"variable": "year",
"property": "??"
}
]
} There is no sensible term to put as |
Well, even if it would know that it is a year it wouldn't know what to do with it. Would it be the year the event is? The year the event was first announced? The year the event ended? The year the organizer of the event was born? The current year? |
As much as I admire the M2M aspiration, in practice most of the time there will be human doing the "knowing". Provided the mapped variable includes a description. This is what most people expect from an API description |
Still i prefer a property over a raw type as it gives a context. Saying that the variable should be mapped to I was also experimenting wit custom properties for skip/take. And remember that even for a variable mapped to a property that actually exists within the |
I agree - it's way to fuzzy. Does it mean that the unique identifier is server side generated, or the client should come with a value on it's own. Also, for i.e. integer identifiers, how the client can come up with a value? |
I need a way to instruct client to generate a collision save unique identifier, for example UUID or CUID, and substitute with it a particular variable in the URI Template. In case of slug HTTP header AFAIK server does NOT guarantee that it will use that slug in generated IRI. With UC#5.1 creating event with PUT, which relies on
How would you answer those questions for
For this case, we could actually use For GUID / UUID / CUID I could actually propose to schema.org adding them as sub-properties of |
I would remove this as there now exists something better in the form of schema:query along with schema:SearchAction |
I agree with @lanthaler that a UUID requirement is something Hydra doesn't need a way to specify out of the box. If it can be added as a sub-property of |
Please verify my understanding. The variable mapping will only ever use the {
"@type": "IrITemplateMapping",
"variable": "identifier",
"property": "schema-hypothetical:UUID-identifier"
} We expect the client to find the description of |
In app I work on I will just rely on having understanding of property like |
In many cases service will want to instruct client to generate UUID or CUID
In some cases server may also want to instruct client to provide slug, in that case we might want to look into https://www.w3.org/2011/http-headers#slug
The text was updated successfully, but these errors were encountered: