jena icon indicating copy to clipboard operation
jena copied to clipboard

Fuseki to send `ETag` response headers

Open namedgraph opened this issue 11 months ago • 5 comments

Version

4.7.0

Feature

Graphs without bnodes can be safely hashed and the hash can be used as a strong ETag value. Graphs with bnodes can be hashed and the hash could be used as a weak ETag value?

Are you interested in contributing a solution yourself?

Perhaps?

namedgraph avatar Mar 03 '24 14:03 namedgraph

Example of model hashing: https://github.com/AtomGraph/Core/blob/master/src/main/java/com/atomgraph/core/util/ModelUtils.java

namedgraph avatar Mar 03 '24 15:03 namedgraph

Hashing as a general solution doesn't extend to large graphs.

Transactions are serializable.

One way to generate a unique fingerprint would be to have UUID per database version.

Another way, with more information, is to have a UUID per dataset (fixed) then create the etag from that id+version and increment the version each write-commit.

Blank nodes don't matter. These tags are independent of content but unique to the version per server.

(does not work for replication with RDF Delta)

afs avatar Mar 04 '24 15:03 afs

Presumably this might require some new interface/API for Dataset implementations to allow them to expose this version information ?

With the variety of implementations that users use in the wild eg Text Indexing, General purpose datasets this would also need to carry through wrappers in some form

rvesse avatar Mar 05 '24 08:03 rvesse

I was thinking ETag per graph as well. In other words, conditional requests supported by the Graph Store Protocol.

namedgraph avatar Mar 05 '24 16:03 namedgraph

Presumably this might require some new interface/API for Dataset implementations to allow them to expose this version information ?

ETags would be applied by Fuseki, possibly via the data service at the endpoint.

A UUID per (storage) dataset would be useful generally as being global and temporal unique.

afs avatar Mar 05 '24 22:03 afs