Closed jonrkarr closed 2 years ago
Support for the metadata format is limited to the format outlined in the combine archive specification. And there the creation date is indeed one of the important attribute (basically cause the metadata element is just written as raw string). You can check whether it is valid by specifying desc.isEmpty()
. If it is considered empty, the element will not be serialized out.
From a software perspective, it's surprising to set an attribute and then have to check this special function to see if the setting was ignored. An exception that indicates the missing required metadata would make more sense to me, or a function for getting all errors/ warnings about an archive.
i can see that. I'm hesitant to throw exceptions, but i can change the API, such that addMetadataToArchive
would return a status code, indicating that the operation failed. With LIBCOMBINE_OPERATION_SUCCESS
being returned in case of success and LIBCOMBINE_OPERATION_FAILED
in case there is missing information on the metadata element.
change the API, such that addMetadataToArchive would return a status code, indicating that the operation failed
That would be better.
I'm happy to follow whatever the specifications for the format are. Where does it say which attributes are required/optional?
That is implemented now, and as far as the spec is concerned, it is very clear, that all kinds of metadata are allowed for use in combine archives. It is only in trying to implement support for the very simple format depicted in the specification, that writing it out without: location, description, date seemed wrong.
According to the spec any other metadata format is fine as well, as any files can be added to the archive. It is just that the basic classes implemented here wont be able to parse / write that. I only try to read it if it is the namespace we listed in the spec (and unfortunately that one is now used for a different format too), so the additional flag is there to stop all meta data processing while reading.
I'm just trying to make sure that whatever metadata we encoded using libCOMBINE can be read out by libCOMBINE (i.e. no information is lost). I'm happy to use specific triples and/or raise errors. I want to avoid information being lost without any warning/error to the user.
Is this the spec: http://co.mbine.org/specifications/omex.version-1.pdf? I'm looking at page 9. I see the outlined triples, but which are required/optional isn't clear to me.
In any case, now that I now about isEmpty
, I can use it to achieve what I'm looking for.
The following illustrates the issue: