Skip to content

Simple dictionaries are not allowed in annotation properties #252

@marcverhagen

Description

@marcverhagen

Because

In clamsproject/app-swt-detection#62 we discussed using a simple dictionary with classification results. This is allowed by the schema and we felt it would be a decent thing to do.

However, the add_property() method of the Mmif Annotation object does not allow this:

if self.check_prop_value_is_simple_enough(value):
self.properties[name] = value
else:
raise ValueError("Property values cannot be a complex object. It must be "
"either string, number, boolean, None, or a list of them."
f"(\"{name}\": \"{str(value)}\"")

We should decide whether this was a good idea, my vote would be to update check_prop_value_is_simple_enough and allow dictionary with atomic values.

Done when

No response

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions