OParl / spec

Spezifikation für eine offene Schnittstelle für Ratsinformationssysteme
https://oparl.org
Creative Commons Attribution Share Alike 4.0 International
61 stars 21 forks source link

document: Unterscheidung von Änderungsdatum für Metadaten und Dateiobjekt? #91

Closed marians closed 10 years ago

marians commented 10 years ago

Der Objekttyp document repräsentiert die Dateianhänge von Drucksachen, Sitzungen etc. Hier ist es wichtig, dass das letzte Änderungsdatum der eigentlichen Dateiinhalts, also des "Binärobjekts" abgerufen werden kann, ohne die Datei herunter laden zu müssen.

Ist es ausreichend, wenn der Objekttyp document das Attribut last_modified per Spezifikation so definiert, dass es immer den Zeitpunkt der letzten Dateiänderung repräsentiert? Oder benötigen wir auch noch mal ein zusätzliches Änderungsdatum für das "document" Objekt selbst (also die unten angezeigten Metadaten), unabhängig vom Dateiinhalt?

Hier ein Beispiel für ein document Objekt:

{
    "@id": "http://refserv.oparl.de/bodies/0/papers/0/documents/0", 
    "@type": "OParlDocument", 
    "access_url": "http://refserv.oparl.de/bodies/0/papers/0/documents/0/access", 
    "created": "2014-01-01T00:00:00+0100", 
    "download_url": "http://refserv.oparl.de/bodies/0/papers/0/documents/0/download", 
    "filename": "OP-2014-0_Anfragedokument.odt", 
    "last_modified": "2014-01-08T14:28:31.568+0100", 
    "mime_type": "application/vnd.oasis.opendocument.text", 
    "name": "Anfragedokument", 
    "paper": "http://refserv.oparl.de/bodies/0/papers/0", 
    "sha1_checksum": "58a4642c879d664b57322d61a74382f7017545e0", 
    "text": "Fraktion der Komischen Partei Deutschlands (KoPaD) ..."
}

Es wäre prinzipiell ja möglich, dass sich Attribute wie name oder filename ändern, ohne dass sich der Dateiinhalt verändert. Sollte das durch ein weiteres Attribut file_last_modified abgedeckt werden? Ich glaube: Ja.

akuckartz commented 10 years ago

Eventuell kann HTTP HEAD (http://tools.ietf.org/search/rfc2616#page-54) statt des Attributs "last_modified" verwendet werden? Damit kann u.a. das letzte Änderungsdatum des "Binärobjekts" abgerufen werden, ohne die Datei herunter laden zu müssen:

9.4 HEAD

The HEAD method is identical to GET except that the server MUST NOT return a message-body in the response. The metainformation contained in the HTTP headers in response to a HEAD request SHOULD be identical to the information sent in response to a GET request. This method can be used for obtaining metainformation about the entity implied by the request without transferring the entity-body itself. This method is often used for testing hypertext links for validity, accessibility, and recent modification.

The response to a HEAD request MAY be cacheable in the sense that the information contained in the response MAY be used to update a previously cached entity from that resource. If the new field values indicate that the cached entity differs from the current entity (as would be indicated by a change in Content-Length, Content-MD5, ETag or Last-Modified), then the cache MUST treat the cache entry as stale.

marians commented 10 years ago

Ja, HEAD soll unterstützt werden und werden wir gezielt erwähnen.

akuckartz commented 10 years ago

Ich halte das Vorgehen für eine Best Practices Frage, die vermutlich auch schon in anderen Teilen der Linked Data Community behandelt wurde oder wird. Die Suche danach übernehme ich als Aufgabe.

akuckartz commented 10 years ago

Eine benachbarte Fragestellung bei Popolo:

We should draw a distinction between an edit history and an actual history. https://github.com/opennorth/popolo-spec/issues/47

marians commented 10 years ago

Dateigröße in Bytes fehlt noch.

marians commented 10 years ago

Das Issue wird geschlossen. Die Inhalte sind in https://github.com/OParl/specs/blob/master/dokument/master/chapter_8110.md zu finden.

akuckartz commented 10 years ago

HEAD ist dort allerdings nicht erwähnt. Steht das an anderer Stelle schon?

marians commented 10 years ago

Es gibt noch einen eigenen Abschnitt zu dem Thema, 4.9 Dokumentenabruf. Da steht das als TODO-Notiz.