Hydra W3C Community Group Telecon

Minutes for 2017-10-16

  1. CreateAction with HTTP PUT
Action Items
  1. Tomasz to extend use case 5 to include all issues discussed today
Markus Lanthaler
Markus Lanthaler
Markus Lanthaler, elf Pavlik, Tomasz Pluskiewicz, Karol Szczepański
Audio Log
Markus Lanthaler is scribing.
Markus Lanthaler: Is there anything we should add to the agenda apart from the issues Pavlik sent out?
elf Pavlik: Karol's PR

Topic: CreateAction with HTTP PUT

elf Pavlik: we approached this from two difficult use cases
... adding members to collections
... and creating resources
... it seems either way we will need IriTemplates
elf Pavlik: if we use CreateAction it could be both POST or PUT
... it would look pretty much the same if we would have a way to attach a "target template"
... telling the client how to construct the URL
Tomasz Pluskiewicz: we already have a similar functionality with templates and links
elf Pavlik: comment trying to follow hydra:search approach https://github.com/HydraCG/Specifications/issues/3#issuecomment-336635276
Karol Szczepański: indeed my latest PR is quite similar to Pavlik's snippet
... I think hydra:search is a link. It is not clear to me if we can use this pattern for this as well
elf Pavlik: we could also change hydra:search to SearchAction and have that operation point to a IRI template
Tomasz Pluskiewicz: { "create_user": { "@type": "IriTemplate", "operation": { "expects": "NewUser" } } }
Markus Lanthaler: when I designed Hydra the intent was to have IriTemplate work pretty much work like a "abstract" hydra:Resource
... once the variables in the template are replaced, it would work the same
elf Pavlik: does this mean we need to describe things differently based on their HTTP method
Markus Lanthaler: { "@type": "IriTemplate", "template": "whatever?{var}", "mappings": [..], "operation": { "@type": "CreateAction", "expects": "NewUser", ... } } }
Karol Szczepański: I'm experiencing connection issues :(
elf Pavlik: right, so if I would like to describe how to add something to a collection with a PUT, how would I point to the IRI template?
Markus Lanthaler: that's indeed undefined at the moment
... Schema.org has things like instrument, agent, object etc. to describe some of these relationships
elf Pavlik: I used action to describe this on GitHub
Tomasz Pluskiewicz: I think we are overthinking this
... we could leverage the follow your nose principle and let the user decide
... how we could tell a client the consequence of an operation beforehand is an open problem though
... maybe not as important though unless we want to target machine to machine communication
... in general though I agree that an extension on collections would be nice
elf Pavlik: if we would like to describe an HTTP request for a resource directly, we would use hydra:operation or its inverse hydra:target
... if the client needs to send the HTTP request to a different resource to affect the current one, we could use hydra:action as proposed in https://github.com/HydraCG/Specifications/issues/141#issuecomment-336670989
Markus Lanthaler: So, what you propose is to introduce an additional property "hydra:action" whose semantics are "there's an operation that affects *this* resource but needs to be send to a *different* URL (specified with hydra:operation or hydra:target)"
Karol Szczepański: could we make the method determine which resource the request should go to?
Tomasz Pluskiewicz: if you look at Pavlik's example they are uniform
Tomasz Pluskiewicz: actually, I meant the snippets in IRC. above
Karol Szczepański: am I correct that you are making a distinction between an action and an operation?
elf Pavlik: kind of, action is just a connection to a different resource
Karol Szczepański: so PUT would go to action, POST would go to operation
elf Pavlik: I'd actually think the other way round
Karol Szczepański: ok, right, so the other way round
Tomasz Pluskiewicz: o_0
Markus Lanthaler: Let's take this back to GitHub
elf Pavlik: q?
Karol Szczepański: Pavlik, your snippet has targetTemplate. Is this something you created?
elf Pavlik: yeah, they are just proposals
Karol Szczepański: "action": { "@type": ["hydra:Operation", "schema:CreateAction", "hydra:IriTemplate"],
Karol Szczepański: what would it mean if action is simultanously an operation and an IRI template?
elf Pavlik: we shouldn't conflate operations and resources
... and the way Markus described IriTemplates as "abstract resources" think describes well that we shouldn't conflate them
Tomasz Pluskiewicz: I wouldn't like to see them conflated either
... I'll rewrite Pavlik's snippet to how Markus described it
elf Pavlik: there's the third option which is how it is in the PR
... let the HTTP method decide
Markus Lanthaler: I think that would be too restrictive.. a POST could need to go to a different URL as well, not just a PUT
... Let's spend a few more cycles on GitHub and discuss it again next time
... The next topic would be "Adding already existing resources as collection members", as it's highly related I'd propose to table that as it is highly related unless someone disagrees
Karol Szczepański: I touched on that in my PR but I had to use workaround as we miss IRI templates
Karol Szczepański: don't hesitate to comment on the PR, it was created for that exact purpose
... The next topic is also highly related "Specifying operations on TemplatedLink objects", PR 118
... The last topic "Should we introduce a property to associate operations and their target directly to an entity?" is also about the same thing
Tomasz Pluskiewicz: do we have a volunteer to create use cases for these?
elf Pavlik: do you think we need use cases? Creating events with POST and PUT should already address them
Tomasz Pluskiewicz: maybe I can extend use case 5
... maybe we conflate to connected but different matters
... one is operations on IriTemplates
... the other one is a PUT (which is a specialization of the other)
ACTION: Tomasz to extend use case 5 to include all issues discussed today
Karol Szczepański: I have a question about Prettier
... how is it configured
... writing a for loop in three lines instead of one breaks my heart
Markus Lanthaler: Is it because the line is getting too long?
Markus Lanthaler: it's pretty opinionated so not highly configurable
... please file an issue to discuss some specific examples
... it shouldn't get in the way of getting work done
elf Pavlik: markus comment re action vs. operation https://github.com/HydraCG/Specifications/issues/3#issuecomment-268809248
Tomasz Pluskiewicz: I'd like to raise my concern about using action and operation
... it's confusing to use these two very similar terms
... and it will be hard to know when to use which