[Biojava-dev] cardinalities on AnnotationType & PropertyConstraint

Matthew Pocock matthew_pocock@yahoo.co.uk
Thu, 31 Oct 2002 16:21:46 +0000


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.

The idea is that you can describe the property names and values that 
should appear in an Annotation bundle, and then validate Annotation 
instances against that. I have used this approach in the unigene 
package, and if it seems to work, will probably extend this to other 
areas. For example, it would allow you to specify that a feature from 
ensembl should have an ENSEMBL_ID property and that the value should be 
a String, or that embl sequences can have zero or more xrefs.

If you couple this with the tag-value parser, you get a powerful 
framework for processing all those nasty embl- and genbank-like files we 
have to deal with daily. A while ago, I wrote some code to automatically 
slurp annotations into an rdb - perhaps that is worth dusting off.

Matthew
-- 
BioJava Consulting LTD - Support and training for BioJava
http://www.biojava.co.uk

__________________________________________________
Do You Yahoo!?
Everything you'll ever need on one web page
from News and Sport to Email and Music Charts
http://uk.my.yahoo.com