Skip to content

struct based encoding for metadata #535

@benjeffery

Description

@benjeffery

The json metadata encoding in #491 can be inefficient for larger scale work. It should be possible to use struct to encode the metadata with a schema that looks like:

{
    "type": "object",
    "properties": {
        "accession_number": {"type": "number", "format":"L", "index":0}, 
        "collection_date": {
            "type": "string", 
            "format": "10s",
            "index":1,
            "pattern": "^([1-9][0-9]{3})-(1[0-2]|0[1-9])-(3[01]|0[1-9]|[12][0-9])?$"
        },
    },
}

Note the additional format and index keys that specify how to encode the metadata. The code would traverse the schema constructing a format string for struct using index as JSON objects are unordered. Note that we should stick to little-endian rather than letting struct decide.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions