Re: Conditional HTTP requests in read/write Linked Data


> On Feb 9, 2024, at 5:46 PM, Martynas Jusevičius <martynas@atomgraph.com> wrote:
> 
> Are you using conditional requests
> with your Linked Data?

We use weak ETags for our top-level graph resource to implement versioning:

```
$ curl -s -I https://data.perio.do/dataset.json

HTTP/2 200
content-type: application/json
content-disposition: attachment; filename="periodo-dataset.json"
etag: W/"periodo-dataset-version-246"
```

```
$ curl -s -I -H 'If-None-Match: W/"periodo-dataset-version-246"' https://data.perio.do/dataset.json

HTTP/2 304
content-disposition: attachment; filename="periodo-dataset.json"
etag: W/"periodo-dataset-version-246"
```

```
$ curl -s -I -H 'If-None-Match: W/"periodo-dataset-version-245"' https://data.perio.do/dataset.json

HTTP/2 200
content-type: application/json
content-disposition: attachment; filename="periodo-dataset.json”
etag: W/"periodo-dataset-version-246"
```

We do not rely on ETags for updates, but instead just try to apply the patch to the current dataset and handle failure if necessary.

Received on Monday, 12 February 2024 18:52:39 UTC