Open Edminsson opened 8 years ago
Hi,
This library is not yet a general purpose IIIF serialiser and deserialiser. It's mainly used to produce IIIF manifests and collections on the server, although it can deserialise an info.json from a IIIF image service.
That said, I would like to make it work both ways when I get the chance. It is very much a work in progress.
One thing I would like to put some more work into is the way multiple assertions of the same property are handled. For example if a resource has one "service" property the JSON-LD should look like this:
"service": <my-service>
But if there is more than one it should serialise like this:
"service": [ <my-svc-1>, <my-svc-2>, ...]
Currently this library uses a .net dynamic, so that those properties can either be "type" or "array of type", and serialise out correctly. I'd like to make this better, as well as provide full deserialisation support.
Tom
FYI this can deserialise manifests:
https://github.com/UniversalViewer/manifesto
(at least all the ones in the test suite) but can't serialise them yet. I'd like to add serialisation relatively soon. It also works on both the client and server (it's what the Universal Viewer uses for IIIF Presentation API stuff). I don't have any examples of it interoperating with a .Net app yet, but there's a simple node server demo here:
I guess manifesto is not really useful in the .Net universe, unless maybe something like this would work:
Thank you Tom and Edward for you suggestions. I work at the National Archives in Sweden and we are currently using IIIF-model to generate manifests to send to UV and it works very well.
In that case I will put some more effort into making this something easier to pick up, all its examples and tests are in a different (private) repo at the Wellcome Library. I'll share some examples and some thoughts I have on making the programmatic generation of manifests as "fluent" as possible.
When trying to deserialize the sample manifest I'm presented with an error: "Error converting value "Monsters" to type 'Digirati.IIIF.Model.MetaDataValue'. Path 'label', line 5, position 22. ---> System.ArgumentException: Could not cast or convert from System.String to Digirati.IIIF.Model.MetaDataValue."
The problem seems to be that the converter MetaDataValueSerialiser does not implement the ReadJson method.