Conversation
donaldgray
left a comment
There was a problem hiding this comment.
Added some comments ahead of scheduled call on Monday
| ...then we say the `items` and `containedItems` have **diverged**. I don't think we need to explicitly track this though, just notice it when a Manifest or Collection gets saved. | ||
|
|
||
| > [!NOTE] | ||
| > The `containedItems` property is generated by the hierarchical DB relationship. And the `items` property is just another "JSON is King" thing to be respected and stored whether we understand all of it or not. As long as it's a valid list, we can still append to it when a new containment relationship is added. |
There was a problem hiding this comment.
"JSON is King" but we append JSON to it. How will that work? What are the possible headaches?
Do we need some notion of "this is just a iiif collection" - you can't use me as a parent (ie prevent the system from updating items). OR do we maintain specific behaviour until a divergence happens?
There was a problem hiding this comment.
JSON is King, but yes this does muddy the waters. It must be strictly append-only on addition of a new contained item, and never touches or re-orders the existing members.
I'm still not sure whether there is a distinction between the two container types now that we have this new property.
There was a problem hiding this comment.
At the moment,
- A Storage Collection would only be a container
- a IIIF Collection can be a Container and a thing with a block of JSON for
itemsthat might not be the same as container - ...a "no parent" ... can't be a container? Or just has a flag that means it never tries to help by appending new contained items to
items?
... and do we actually need any of these distinctions or can it all be governed by predictable behaviour?
We still need the public/not-public distinction which only makes sense for Storage Collections (e.g., Leeds /cc/ is not a public resource), but if Storage Collections weren't a thing you'd still use this flag. However, if there is no distinction then you could in theory edit the items (as JSON) of a private collection - and what would be the point of that?
|
|
||
|
|
||
|
|
||
| Public view of Storage Collection `items` are always just expanded versions of the above (e.g., with image service on the thumbnail, maybe...) (???) |
There was a problem hiding this comment.
Check - what do we do now for storage collections?
There was a problem hiding this comment.
right now the public view is just an id, a type and a label, i.e.:
{
{
"id": "https://presentation-api.dlcs.digirati.io/26/0001-presentation-iiif-collection_2",
"type": "Collection",
"label": {
"en": [
"0001-presentation-iiif-collection_5A8gz1"
]
}
},
{
"id": "https://presentation-api.dlcs.digirati.io/26/0005_dlcs_creates_assets_FKbIqA",
"type": "Manifest",
"label": {
"en": [
"IIIF manifest DLCS resource creation tests - multiple"
]
}
}
}private additionally has a behavior block on collections
|
|
||
| * things that are actually contained too (most common) | ||
| * external things | ||
| * things that are managed by IIIF-CS but are in a different location in the repository (member, but not contained) |
There was a problem hiding this comment.
Do we need to differentiate this? Or is storing an external Id or something in the DB enough? What is the DB table that stores this? canvasPaintings but not (containedItems like the prop?)
There was a problem hiding this comment.
containment is solely the existing hierarchical table(s) - manifests and collections - I don't think canvasPaintings comes into this at all?
aaa contains bbb
aaa contains ccc
bbb contains ddd
bbb contains eee
(all db)
aaa hasMember eee
only exists as a fact in JSON, has no db representation at all
(you can actually say what you like)
aaa contains eee
If you can assert this it can only count as a MOVE operation, and bbb no longer contains eee
There was a problem hiding this comment.
I don't think canvasPaintings comes into this at all?
My comment was badly worded. I was thinking that we might need a new table; this new table being similar to canvasPaintings (that stores things that are in a Manifest - we might need to store things that are in a Collection).
Requirement of it depends on how saving and automatically adding membership is done.
edit: the original reason for comment was whether we need to differentate between these 3 bullets - to do that I think we'd need to store something about the members of a collection?
| * ...or does it say "no, they have diverged, it's your responsibility now" | ||
|
|
||
| > [INFO] | ||
| > Current conclusion - it adds it to the end. And similarly if you DELETE a contained resource, the server will modify the parent container's `items` property to remove it (because it no longer exists). |
There was a problem hiding this comment.
Any concurrency issues here? ETags will need to be eagerly generated for multiple items on save of child - which will be happening already so should be fine. (edit: This is only seting the ETag for DB generated collections but this is possibly reading + writing to stored JSON)
Unsure whether this is the best behaviour - not sure what I'd expect? Is this something we'd eventually want to be a controllable behaviour?
There was a problem hiding this comment.
Sometimes you might want this to happen, sometimes not.
If controllable it needs additional property, or a header, or something (might also be config).
Balance between complexity and doing the most useful thing most of the time (even if you have to undo it occasionally)
POST /some/parent/collection
Headers: "no-append": "true"
{
// a manifest
}
|
|
||
| --- | ||
|
|
||
| I have no evidence for this ofc because we have nobody using it - but I suspect it will be rare for a IIIF Coll in the platform to run into this. Either they'll be like our 3-vol LOTR and the membership is the same as the containment, or they'll be ad-hoc collections - bookmarks, curated sets, whatever - that have no containedItems at all.) |
There was a problem hiding this comment.
I suspect it will be rare for a IIIF Coll in the platform to run into this - do we want to do an MVP staged impl of this? Or will that be too cumbersome?
| There is some redundancy in that Storage Collections have `items` and `containedItems` that assert the same set of resources, but there is still a useful difference - one is the public `items` and one is not. | ||
|
|
||
| > [!NOTE] | ||
| > I have a vague feeling that this might do away with the distinction between IIIF and Storage Collections...? Everything is a IIIF Collection and the two properties are in sync - until they aren't. `items` becomes just another JSON property that we persist, except that we attempt to non-destructively edit it when there is a containment change (addition or deletion via PUT, POST or DELETE of a resource). |
There was a problem hiding this comment.
The distinction is that the latter are DB powered only. Nothing stored on S3, cheap + easy to append children because we're just reading from DB and projecting to an alternative format on the way out.
With this change do we need to store S3 objects for storage and non-storage collections? Or "json is king" for iiif only and append on the way out? If that was the case we'd need to track which ones had since been reordered and not re-add them.
OR could we project them once at first read. So you can add -> add -> add to a parent and we assemble the manifest on first read. If so - how do we track this?
There was a problem hiding this comment.
Nothing stored on S3
Yeah that is important. atm you can't edit the items property of a Storage Collection - it's simply a different projection of containedItems, entirely DB driven.
So we could maintain the distinction, or we could say that Nothing stored on S3 until it needs to be (which means you don't have to choose what kind of coll it is up front, only its public/private setting.
| > [!NOTE] | ||
| > The `containedItems` property is generated by the hierarchical DB relationship. And the `items` property is just another "JSON is King" thing to be respected and stored whether we understand all of it or not. As long as it's a valid list, we can still append to it when a new containment relationship is added. | ||
|
|
||
| There is some redundancy in that Storage Collections have `items` and `containedItems` that assert the same set of resources, but there is still a useful difference - one is the public `items` and one is not. |
There was a problem hiding this comment.
Option to only include one or the other for API requests?
| For a IIIF Collection, the `items` property is editable as JSON and can be modified without necessarily conflicting with `containedItems`: | ||
|
|
||
| * You can let the platform add items to it as you add more child resources to the Collection. | ||
| * You can save the IIIF Collection without an `items` property at all and it will leave it untouched. |
There was a problem hiding this comment.
How would this work:
- Create Collection A (empty, no "items") - just a label.
- Add 10 Manifests with parent of Collection A.
- Collection A now has 10 "items" and 10 "containedItems"
- GET Collection A and remove all "items" then POST.
- Collection A now has 0 "items" and 10 "containedItems"
- Add 1 Manifest with parent of Collection A
- Collection A now has 1 "items" and 11 "containedItems"? OR * Collection A now has 0 "items" and 11 "containedItems", because it's diverged and you're on your own?
There was a problem hiding this comment.
Although it sounds odd, I think the former - Collection A now has 1 "items" and 11 "containedItems"
...because this is then consistent with how (I think at least) it would be more commonly used, when they don't diverge much (or at all), or have no containedItems at all.
|
Non-specific comment If we keep Storage Collection / IIIF Collection distinction:
Can you convert a Storage Collection into a IIIF Collection? If we don't keep it:
|
Uh oh!
There was an error while loading. Please reload this page.