I’m getting no errors, it just fails. I originally wanted to import this data as timestamp, but that was having the same issue, so I thought this way might be easier. Maybe there’s a way to turn on additional logging?
Could you share some more about how you are submitting the PATCH to the API? cURL, Postman, other?
Here’s another thread discussing the proper syntax for PATCHing metadata via the Omeka S API. The JSON you’ve given appears correct, with the possible exception of enclosing brackets (this is where it would be helpful to see your full API request).
But it erased all the metadata… At least it didn’t delete the pictures attached, so I should be able to grab all the metadata, and “patch” it back with a copy of the complete data I want on the item. Better than doing the same with update, because at least the pictures don’t have to be re-ingested. I’ll update with the code I end up using later.
Yeah, that’s an unfortunate necessity of the patch/update process. It’s covered in the docs, though it could perhaps be worded better. Any patch that adds or changes value/s of a certain RDF property prefix (such as dcterms:) will end up replacing all of the values containing that same prefix, since they are treated as one big ‘key’ by the API update process.
The workaround, as you’ve found, is to export the existing data, make alterations, and use PATCH to update. This will update the values of the particular RDF flavor you choose, while still retaining any other metadata and attached media.
The way it reads to me in the docs, is that it treats each rdf properly separately, rather than an entire unit. So I expected that if I updated the subject field, it would overwrite all the subjects in the item.
Also, you’re saying that if it’s a different namespace like “bibo:” it won’t overwrite? Because that is not what I have found in my limited testing. “bibo:locator” was also overwritten.
You’re absolutely right, my apologies. I had the specifics wrong. Each RDF property is considered a key/unit, and the namespace has no bearing on what does and doesn’t get deleted–only the property & values currently being PATCHed.
The “PATCH” behavior treats any metadata property as being an update of “the properties” generally, as a whole. So when you specify metadata properties in a PATCH, they are replacing the full set of properties for that resource. If you provide no properties, the properties are maintained as they are. This is what the documentation is intended to mean when it mentions “removal of all other values.”