[Biojava-dev] cardinalities on AnnotationType & PropertyConstraint
Thomas Down
td2@sanger.ac.uk
Thu, 31 Oct 2002 17:06:57 +0000
On Thu, Oct 31, 2002 at 04:21:46PM +0000, Matthew Pocock wrote:
> I've made some changes to the AnnotationType and PropertyConstraint
> classes. We now have a class CardinalityConstraint that lets us say how
> many values we expect to see associated with a property in an annotation
> bundle. There are some common values - ZERO, ONE, ZERO_OR_ONE, ANY, and
> you can make new ones (e.g. 4..4, 12..15, 1..2) if they help you.
This is good to have.
I think we need to clarify the semantics a little, though.
Do we distinguish between properties which exist with cardinality
0 (which is possibly in the current Annotation interface, if the
value is a Collection of size zero), and properties which are
undefined.
I guess defined properties with zero cardinality are useful
as flags. But that feels like a bit of a hack, since you could
equally well have a property of datatype boolean, cardinality
EXACTLY_ONE.
Any thoughts?
Thomas.