Dendro Version if known (or site URL)
0.2
Objective
File uploads should be recorded in the Dendro graph, to keep track of file modifications.
How to do it
Create a file_versions.js
file in the models/versions folder, which will represent the FileVersion
class.
This model should record, as properties of the created FileVersion instances, all the fields currently present in the MongoDB record of the file.
An example of a record is:
{
"_id" : ObjectId("54b03c94e94e9ea32d000001"),
"filename" : "http://127.0.0.1:3001/project/datanotes2/data/Nielsen[1994].pdf",
"contentType" : "binary/octet-stream",
"length" : 259713,
"chunkSize" : 262144,
"uploadDate" : ISODate("2015-01-09T20:39:49.050Z"),
"aliases" : null,
"metadata" : {
"project" : "http://127.0.0.1:3001/project/datanotes2",
"type" : "nie:File"
},
"md5" : "b3bbe77e563bd4784c21db08bbc3066a"
}
It is necessary to map the values in these documents an ontology, except the id
and alias
. Maybe see in the NFO ontology or NIE ontology which properties can be used in each case (elements.js
).
It is also necessary to add the creator of the file version to the metadata
field of the MongoDB record.
Upon uploading a file (files.js
controller), a new FileVersion
should be created and saved in the graph with all the values of its properties coming from the result of the MongoDB operation (it makes no sense to save FileVersions for GFS uploads that fail).
Parent Folder
s will have to be updated as well on saving a file directly above
them, meaning only the parent folder of the uploaded or updated file will have its nie.contentLastModified
value updated with uploadDate
value returned by the GFS operation.
What happens when a file of folder is updated
RFC