Re: [Specifications] collections with manages block & Triple Pattern Fragments

Hi @pietercolpaert  & @mielvds , please let me try to explain better. You can find information on how `manages` suposed to work on https://www.w3.org/community/hydra/wiki/Collection_Design

In my example snippet above taken from  [UC#1EntryPoint](https://github.com/HydraCG/Specifications/blob/master/drafts/use-cases/1.entry-point.md#details)
```json
 "manages": {
        "property": "rdf:type",
        "object": "schema:Event"
}
```

Simply means that members in that collection all follow `?member rdf:type schema:Event .` pattern. In snippet from the wiki page explaining `manages`.

```json
    "manages": {
      "property": "schema:knows",
      "subject": "/alice"
    }
```

It simply means that all members follow `</alice> schema:knows ?member` pattern. I see it similar to [LDP Direct Container](https://www.w3.org/TR/ldp/#ldpdc), I also see it similarities to VOID partitions with example of `void:classPartition` based approach in https://github.com/HydraCG/Specifications/issues/126#issue-237916600

So far I don't see major difference from using TPF to get IRIs of resources matching given triple pattern. Collections can inline / [JSON-LD embedd](https://json-ld.org/spec/latest/json-ld/#embedding) representations of those resources in the representation of the collection, still given HTTP/2 I don't see it an advantage for all application scenarios, for example based on capability to cache representation of each resource.

As a person developing web services (acting mostly as servers) and web applications (acting mostly as clients) using API based on Hydra. Currently I don't see clear guidance on when to use collections with `manages` or TPF or maybe my API should provide both at the same time.

Another difference relates to creating new resources, currently [UC#5](https://github.com/HydraCG/Specifications/blob/master/drafts/use-cases/5.creating-new-event.md) provides example of creating new resources using HTTP POST and [UC#5.1](https://github.com/HydraCG/Specifications/blob/master/drafts/use-cases/5.1.creating-event-with-put.md) using HTTP PUT and `hydra:memberTemplate` still pending approval in #158 , both of them also have variants in also pending #154 Both cases follow what I see as LDP style approach where client relies on collection advertising operation of creating new resources `schema:CreateAction` (which also gets added to that collection) and a way to perform that operation (once again #154 proposes separating semantic action on given resource from an operation, possibly on other resource which handles that action).

Without collections, relying on proposed in #158 `hydra:memberTemplate` doesn't seem to work any more. At the same time, a dataset which allows creating new resources, could advertise operations like `schema:CreateAction` directly on itself, especially if they use 'flat' URI namespace, eg. all resources follow simple `/{uuid}` which doesn't should work just fine when querying dataset with LDF/TPF. So here collections seem helpful if server wants to use 'deep' URI namespace like `/events/{uuid}` and `/people/{uuid}`.

I consider making PR which would enable TPF based approach for the current set of use cases. It wold co-exist with collection based approach and we could see where they play well together and where they seem to step on each other toes.

-- 
GitHub Notification of comment by elf-pavlik
Please view or discuss this issue at https://github.com/HydraCG/Specifications/issues/142#issuecomment-383099259 using your GitHub account

Received on Friday, 20 April 2018 13:40:31 UTC