forked from benanhalt/SchemaTools
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathkufish_schema.py
181 lines (158 loc) · 5.44 KB
/
kufish_schema.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
from specify.schema.base import Record, SchemaFamily, make_tree, many
from specify.schema.fields import Boolean, Text, Integer, Date, Link, required
import formatters, vocabularies
schema_family = SchemaFamily("KU Fish")
Schema = schema_family.Schema
class KUFish(Schema):
"""All records shared by all objects in the collection."""
class Agent(Record):
"""A person, group or organization that objects in collection refer to."""
agent_type = Text(required)
title = Text()
job_title = Text()
last_name = Text()
first_name = Text()
middle_initial = Text()
abbreviation = Text()
email = Text()
url = Text()
@many('addresses')
class Address(Record):
"""An agent's address."""
is_current = Boolean()
address1 = Text()
address2 = Text()
city = Text()
state = Text()
country = Text()
postal_code = Text()
room_building = Text()
phone1 = Text()
phone2 = Text()
fax = Text()
class Taxon( make_tree("kingdom phylum class order family genus species subspecies") ):
"""A node in a hierarchical taxonomy to be used in determinations."""
common_name = Text()
source = Text()
protected_status = Text()
author = Text()
accepted = Link("Taxon")
class ReferenceWork(Record):
type_of_work = Text()
title = Text()
publisher = Text()
place_of_publication = Text()
volume = Text()
pages = Text()
date_of_work = Text()
url = Text()
journal = Link("Journal")
@many('authors')
class Author(Record):
agent = Link("Agent", required)
class Journal(Record):
name = Text()
abbreviation = Text()
class Accession(Record):
accession_number = Text(required)
status = Text()
accession_type = Text()
accession_date = Date()
received_date = Date()
number_of_lots = Integer()
number_of_specimens = Integer()
description = Text()
@many('agents')
class AccessionAgent(Record):
agent = Link("Agent", required)
role = Text()
class Geography( make_tree("continent country state county city") ):
accepted = Link("Geography")
class Locality(Record):
name = Text(required)
geography = Link("Geography")
water_type = Text()
section = Text()
township = Text()
range = Text()
island = Text()
island_group = Text()
water_body = Text()
drainage = Text()
class CollectingEvent(Record):
field_number = Text(format=formatters.field_number)
collecting_date = Date()
gear = Text()
locality = Link("Locality")
trip = Link("CollectingTrip")
@many('collectors')
class Collector(Record):
agent = Link("Agent", required)
class CollectingTrip(Record):
vessel = Text()
cruise = Text()
haul = Text()
class KUFishVoucher(Schema):
class CollectionObject(Record):
catalog_number = Text(format=formatters.catalog_number)
cataloged_date = Date()
size = Text()
sex = Text()
weight = Text()
cataloger = Link(KUFish.Agent)
accession = Link(KUFish.Accession)
collecting_event = Link(KUFish.CollectingEvent)
@many('determinations')
class Determination(Record):
determiner = Link(KUFish.Agent)
determination_date = Date()
type_status = Text()
taxon = Link(KUFish.Taxon)
@many('preparations')
class Preparation(Record):
preparer = Link(KUFish.Agent)
prep_date = Date()
prep_type = Text(required, vocab=vocabularies.VoucherPrepType)
count = Integer()
on_loan = Boolean()
class KUFishTissue(Schema):
class CollectionObject(Record):
catalog_number = Text(format=formatters.catalog_number)
cataloged_date = Date()
preservation = Text()
tissue_type = Text()
size = Text()
sex = Text()
cataloger = Link(KUFish.Agent)
accession = Link(KUFish.Accession)
collecting_event = Link(KUFish.CollectingEvent)
voucher = Link(KUFishVoucher.CollectionObject)
@many('determinations')
class Determination(Record):
determiner = Link(KUFish.Agent)
determination_date = Date()
type_status = Text()
taxon = Link(KUFish.Taxon)
@many('preparations')
class Preparation(Record):
preparer = Link(KUFish.Agent)
prep_date = Date()
prep_type = Text(required, vocab=vocabularies.TissuePrepType)
count = Integer()
on_loan = Boolean()
tubes = Integer()
used_up = Boolean()
storage = Text()
@many('dna_sequences')
class DNASequence(Record):
bold_barcode_id = Text()
molecule_type = Text()
genbank_accession_number = Text()
gene_sequence = Text()
total_residues = Integer()
comp_a = Integer()
comp_c = Integer()
comp_g = Integer()
comp_t = Integer()
ambiguous_residues = Integer()
sequenced_by = Link(KUFish.Agent)