nwb-linkml/nwb_linkml/maps/quantity.py
sneakers-the-rat 4faaa8efe8 I believe that's a full translation
or at least all the semantics are present. it's not pretty by any stretch of the imagination
2023-08-25 00:22:47 -07:00

34 lines
688 B
Python

"""
Quantity maps on to two things: required and cardinality.
Though it is technically possible to use an integer as
a quantity, that is never done in the core schema,
which is our only target for now.
We will handle cardinality of array dimensions elsewhere
"""
QUANTITY_MAP = {
'*': {
'required': False,
'multivalued': True
},
'+': {
'required': True,
'multivalued': True
},
'?': {
'required': False,
'multivalued': False
},
1: {
'required': True,
'multivalued': False
},
# include the NoneType for indexing
None: {
'required': None,
'multivalued': None
}
}