Open azaroth42 opened 8 years ago
Isn't this contrary to #44? Or are you proposing both hasFileSet and hasOriginalFile statements?
Both. hasFileSet / hasFile for the direct containers to look after the content, and then additional predicates to clarify use within the parent.
So you would use both hasFile
and, e.g., hasThumbnail
? When you wanted a thumbnail, you'd use the hasThumbnail
predicate, but if you didn't care about the type of File, you'd just use hasFile
?
That seems like good functionality on the read side of things, but adds to the overhead on the create side of things. I'm fine with that tradeoff (since I expect most repositories get a lot more reads than writes), but it's worth noting that it's a tradeoff.
Agree that it's a tradeoff. Hopefully the number of changes to these would be low, and possible to do after the initial load. The POST would go to the hasFile container, then a PATCH on the object to add the hasThumbnail (or whatever) predicate. And yes, if it's just a file, then no subsequent PATCH.
Mmph. I didn't even think about the extra PATCH. That would be pretty unpleasant.
Talked through the current postcard model with @jcoyne and @mjgiarlo this morning, and this came from that discussion.
It would be easier to use predicates for the relationship between Object and FileSet, and between FileSet and Files than to look for classes on the child resource.
In particular, the clinching use case was an Object with two FileSets, one for Image depiction and one for TEI transcription. The question came up: How do I know that I can display the TEI file (or likely a pre-processed derivative) as the text of the Object? With Use, the TEI file would need to be both OriginalFile and ExtractedText, and all derivatives would be ExtractedText. So the processing requirement would be:
It seemed easier to link from the Object to the TEI FileSet with a relationship, rather than filtering like this. Similarly, filtering the Files for the OriginalFile rather than following a "hasOriginalFile" relationship seemed significantly easier.
So, the proposal is to continue with a single container for Files (and FileSets, issue forthcoming) and also add a relationship from the parent to the child.