LD4P / sinopia_server

[Deprecated - switching to MongoDB] Sinopia Back-end CRUD Service. LDP-inspired, HTTP Server taking JSON-LD resources & administrative metadata.
Apache License 2.0
1 stars 1 forks source link

Handle Memento URI of Resource Template used in generating RDF #75

Closed jermnelson closed 5 years ago

jermnelson commented 5 years ago

With Resource Templates stored in Trellis, we need to figure out to associate the memento URI with the addition of new resource. This could be adding new RDF triples to the Resource's RDF or maybe as an SQL query on the Trellis Postgre database.

justinlittman commented 5 years ago

I'd suggest that the most momento-ish way to do this is:

  1. Load the resource template when a new resource is being created.
  2. Record the timestamp that the resource is created.
  3. When loading a record, query the resource template's timegate to get the correct resource template for the timestamp when the resource was created.

This seems like a terrible way to do versioning of resource templates, but good enough for MVP.

jermnelson commented 5 years ago

Couldn't you take the timestamp in step one, query Trellis with the Accept-Datetime header for the particular Resource Template and then store the redirected Memento URL? (See https://github.com/trellis-ldp/trellis/wiki/Resource-Versioning)

justinlittman commented 5 years ago

Here's the simpler approach that we agreed on:

  1. When re-loading a resource, get the creation date from Trellis: https://github.com/trellis-ldp/trellis/wiki/Resource-Provenance--(Audit)
  2. When loading a resource template, query the resource template's timegate to get the correct resource template for the resource creation date timestamp.

There is a possibility that a resource template was changed while the user was creating record (that is, before saving) but the risk is minor.

justinlittman commented 5 years ago

@jermnelson Is there any work that needs to be done on this ticket?

jermnelson commented 5 years ago

Closing for now.