A Note about Constructed Types

In the ACEDB data model, tags are used to identify branches of the tree structure. Every tag must be unique within a model, and these tags must be rooted, that is, there can be no data fields between the base node of a tree (the root) and the tag. Since tags cannot follow a data value, this would limit the complexity of the tree beyond data fields.

However, ACEDB does provide a mechanism for allowing more complex data types in the leaves of the tree: constructed types. A constructed type is a class which gets included within another. Take the ?Locus class as an example which contains a constructed type; in the model, it is shown as #map_position:

?Locus	Type	RFLP
        Homoeology_name ?Locus	
        Other_name ?Locus XREF Correct_name ?Reference
        Correct_name ?Locus XREF Other_name ?Reference 
        Previous_name ?Locus ?Reference 
        Current_name ?Locus ?Reference 
        Location Chromosome ?Text	
		 Chromosome_arm ?Text	
		 Map ?Map XREF Locus #map_position    <---- the constructed type
                 Main_Marker ?Map XREF Main_Marker
                 Inside Chrom_Band ?Chrom_Band XREF Locus
                 Rearrangement ?Rearrangement XREF Carries 
	Probe ?Probe XREF Locus ?Reference
	Mapped_bands ?Restriction Float ?Germplasm ?Text 
	Linked_QTL ?QTL XREF Nearest_marker
	Associated_gene ?Gene XREF Locus 
	Candidate_gene ?Gene XREF Candidate_locus 
	Image ?Image XREF Locus 
	Data	?Map_Data XREF Locus 
	Mapping_data Well_ordered 
               	     2_point ?2_Point_Data
        Rearrangement_data  Uncovered_by ?Rearrangement XREF Uncovers
                            Not_uncovered_by ?Rearrangement XREF Does_not_uncover
                            Carried_by ?Rearrangement XREF Carries
                            Not_carried_by ?Rearrangement XREF Does_not_carry
	Reference ?Reference XREF Locus
	Data_source ?Colleague Text 
	Remarks Text
        Candidate_orthology_group ?Locus XREF Possible_orthologues
	Possible_orthologues ?Locus XREF Candidate_orthology_group
        Gale_orthology_group ?Locus XREF Gale_orthologues
        Gale_orthologues ?Locus XREF Gale_orthology_group
And the map_position model:
?map_position UNIQUE Position UNIQUE Float #map_error     <---- another constructed type!
                     Ends Left UNIQUE Float #map_error
                          Right UNIQUE Float #map_error
                     Multi_Position  Float #map_error 
       		     Multi_Ends Float UNIQUE Float
And, finally, the map_error model:
?map_error Error UNIQUE Float
So in any Locus object, these constructed types will be expanded in place, if there is data present. Here's an example, Xpsr121a:
Type RFLP 
Location Map Tt-Appels-7D Position 26.85 
Probe PSR121 
Data T.tauschii, Appels 
Notice that the Position tag and a float value from the map_position model are included in the Locus object. Here's another example, Locus at, with both the map_position and map_error constructed types expanded:
Type Gene 
Location Chromosome 1H 
         Map Hordeum-Genes-1H Position -12 Error 6.6 
Associated_gene at (Hordeum) 
Data Barley genes 

Querying constructed types

In order to query on a tag of field within a constructed type, use the # operator to jump into the constructed type. While processing a query, acedb keeps track of where it is in the model with a pointer; before jumping into the constructed type, the pointer must be positioned immediately ahead of it. For example, suppose we wanted to search for all loci with a negative position. The main part of composing this query is to get acedb to position its pointer in the proper place in the model.