Re: [Specifications] Should spec mandate on server removing membership triple for deleted resources

> Perhaps we should have a specialized Delete operation. Something like DeleteAndRemoveMember.

Currently operations stay 'attached' to a single resource. `DeleteAndRemoveMember` seems to affect two resources:
1. The resource we delete
2. The collection we want to remove a 'member' reference to that resource

I think it may help if we think of Hydra API as an interface to an RDF dataset, which also provides other interfaces - SPARQL, Triple Pattern Fragments etc. For example if we want to add a triple to the dataset via [SPARQL 1.1 Update](https://www.w3.org/TR/sparql11-update/)
```sparql
BASE <https://media.example/>
PREFIX sor: <http://purl.org/net/soron/>
INSERT DATA { </users/elfpavlik> sor:likes </videos/144522067> .  } }
```

requesting Triple Pattern Fragment
```json
{
  "subject": "https://media.example/users/elfpavlik",
  "predicate": "http://purl.org/net/soron/likes"
}
```
will include that added tripple. In similar way when we remove that triple with `DELETE DATA` the very same TPF will automatically not include it any more. In case of TPF we don't have to worry about modifying the resource denoted by particular TPF IRI since that resource represent a result of query on the dataset.

In example from https://github.com/HydraCG/Specifications/issues/134#issuecomment-333408225 we have two related relationships going on.
1. `</users/elfpavlik> sor:likes </videos/144522067>. ` (subject & object IRIs both denote Things)
2. `</users/elfpavlik/likes> hydra:member </videos/144522067> .` (subject IRIs denotes API specific Resources and object IRI denotes a Thing)

The `manages` block
```json
"manages": {
    "subject": "/users/elfpavlik",
    "property": "sor:likes"
  }
```

Focuses on relationship between Things, while `member` on relationships between API specific resource (instance of `hydra:Collection`) and a thing. AFAIK in LDP we would have `</users/elfpavlik/likes> ldp:contains </users/elfpavlik/likes/144522067>. ` so relation between two API specific resources.

Let's try to make a dataset from snippets in our use cases and expose it with 3 interfaces
* Hydra
* Triple Pattern Fragments
* SPARQL

@RubenVerborgh do you have some insights to share on how you see Hydra and LDF working together to expose the same dataset?

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

Received on Monday, 2 October 2017 17:19:23 UTC