source: mauRepo/MolesManager/trunk/src/ea_model/iso_19156_2011_observations_and_measurements/sampling_features/specimen/sf_specimen.py @ 8091

Subversion URL: http://proj.badc.rl.ac.uk/svn/ndg/mauRepo/MolesManager/trunk/src/ea_model/iso_19156_2011_observations_and_measurements/sampling_features/specimen/sf_specimen.py@8091
Revision 8091, 7.1 KB checked in by mnagni, 8 years ago (diff)

The migration process now includes
1) deployment_data files
2) XML document hash
3) full Dojo support


Line 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21from ea_model.iso_19156_2011_observations_and_measurements.sampling_features.samplingfeature.sf_samplingfeature import  SF_SamplingFeature
22from ascore.utils import has_value
23
24'''
25Created on 16-Feb-2012 16:18:07
26
27@author: mnagni
28'''
29
30class SF_Specimen(SF_SamplingFeature):
31    '''
32        Represents a data entity defined in a UML diagram and supposed to
33        be persisted in a relational database.
34 
35        This class has been genererated automatically using the Apache Velocity project.
36    '''
37    '''
38        Please note that any access to the inner attributes should be done using
39        the given get/set methods and NOT accessing them directly.
40    '''
41    def __init__(self):
42        self._sf_samplingfeature = SF_SamplingFeature()         
43
44        self.samplingMethod = None
45        self._samplingTime_tm_primitive = None
46        self._samplingTime_tm_complex = None
47        self.size = None
48        self.currentLocation = None
49        self._samplingLocation_gm_complex = None
50        self._samplingLocation_gm_primitive = None
51        self._samplingLocation_gm_aggregate = None
52        self.processingDetails = []
53        self._sampledFeature_sf_samplingfeature = []
54        self._sampledFeature_mo_featureofinterest = []
55        self._sampledFeature_gfi_domainfeature = []
56        self.sampledFeature = []
57        self.parameter = []
58        self._relatedObservation_om_discretecoverageobservation = []
59        self._relatedObservation_om_temporalobservation = []
60        self._relatedObservation_om_measurement = []
61        self._relatedObservation_mo_observation = []
62        self._relatedObservation_om_truthobservation = []
63        self._relatedObservation_om_countobservation = []
64        self._relatedObservation_om_categoryobservation = []
65        self._relatedObservation_om_geometryobservation = []
66        self._relatedObservation_om_complexobservation = []
67        self.lineage = None
68        self._relatedSamplingFeature_sf_spatialsamplingfeature = []
69        self._relatedSamplingFeature_sf_specimen = []
70        self._propertyValueProvider_om_discretecoverageobservation = []
71        self._propertyValueProvider_om_temporalobservation = []
72        self._propertyValueProvider_om_measurement = []
73        self._propertyValueProvider_mo_observation = []
74        self._propertyValueProvider_om_truthobservation = []
75        self._propertyValueProvider_om_countobservation = []
76        self._propertyValueProvider_om_categoryobservation = []
77        self._propertyValueProvider_om_geometryobservation = []
78        self._propertyValueProvider_om_complexobservation = []
79        self.materialClass = None
80        self.specimenType = None
81        super(SF_Specimen, self).__init__()
82
83    @property
84    def samplingTime(self):     
85        if(has_value(self._samplingTime_tm_primitive)):
86            return self._samplingTime_tm_primitive
87        if(has_value(self._samplingTime_tm_complex)):
88            return self._samplingTime_tm_complex
89        return  None
90
91    @samplingTime.setter
92    def samplingTime(self, value):     
93        valueClass = "%s.%s" % (type(value).__module__,type(value).__name__)
94        if valueClass == "ea_model.iso_19108_2006_temporal_schema.temporal_objects.tm_primitive.TM_Primitive":
95            self._samplingTime_tm_primitive = value
96            self._samplingTime_tm_complex = None
97        if valueClass == "ea_model.iso_19108_2006_temporal_schema.temporal_objects.tm_complex.TM_Complex":
98            self._samplingTime_tm_complex = value
99            self._samplingTime_tm_primitive = None
100
101    @property
102    def samplingLocation(self): 
103        if(has_value(self._samplingLocation_gm_complex)):
104            return self._samplingLocation_gm_complex
105        if(has_value(self._samplingLocation_gm_primitive)):
106            return self._samplingLocation_gm_primitive
107        if(has_value(self._samplingLocation_gm_aggregate)):
108            return self._samplingLocation_gm_aggregate
109        return  None
110
111    @samplingLocation.setter
112    def samplingLocation(self, value): 
113        valueClass = "%s.%s" % (type(value).__module__,type(value).__name__)
114        if valueClass == "ea_model.iso_19107_2003_spatial_schema.geometry.geometric_complex.gm_complex.GM_Complex":
115            self._samplingLocation_gm_complex = value
116            self._samplingLocation_gm_primitive = None
117            self._samplingLocation_gm_aggregate = None
118        if valueClass == "ea_model.iso_19107_2003_spatial_schema.geometry.geometric_primitive.gm_primitive.GM_Primitive":
119            self._samplingLocation_gm_primitive = value
120            self._samplingLocation_gm_complex = None
121            self._samplingLocation_gm_aggregate = None
122        if valueClass == "ea_model.iso_19107_2003_spatial_schema.geometry.geometric_aggregates.gm_aggregate.GM_Aggregate":
123            self._samplingLocation_gm_aggregate = value
124            self._samplingLocation_gm_complex = None
125            self._samplingLocation_gm_primitive = None
126
127    @property
128    def sampledFeature(self):   
129        return self._sf_samplingfeature.sampledFeature
130
131    @sampledFeature.setter
132    def sampledFeature(self, value):   
133            self._sf_samplingfeature.sampledFeature = value
134
135    @property
136    def sampledFeature(self):   
137        return self._sf_samplingfeature.sampledFeature
138
139    @sampledFeature.setter
140    def sampledFeature(self, value):   
141            self._sf_samplingfeature.sampledFeature = value
142
143    @property
144    def parameter(self):       
145        return self._sf_samplingfeature.parameter
146
147    @parameter.setter
148    def parameter(self, value): 
149            self._sf_samplingfeature.parameter = value
150
151    @property
152    def relatedObservation(self):       
153        return self._sf_samplingfeature.relatedObservation
154
155    @relatedObservation.setter
156    def relatedObservation(self, value):       
157            self._sf_samplingfeature.relatedObservation = value
158
159    @property
160    def lineage(self): 
161        return self._sf_samplingfeature.lineage
162
163    @lineage.setter
164    def lineage(self, value):   
165            self._sf_samplingfeature.lineage = value
166
167    @property
168    def relatedSamplingFeature(self):   
169        return self._sf_samplingfeature.relatedSamplingFeature
170
171    @relatedSamplingFeature.setter
172    def relatedSamplingFeature(self, value):   
173            self._sf_samplingfeature.relatedSamplingFeature = value
174
175    @property
176    def propertyValueProvider(self):   
177        return self._sf_samplingfeature.propertyValueProvider
178
179    @propertyValueProvider.setter
180    def propertyValueProvider(self, value):     
181            self._sf_samplingfeature.propertyValueProvider = value
182
183    def __key(self):
184        return (self.samplingMethod, self.samplingTime, self.size, self.currentLocation, self.samplingLocation, self.processingDetails, self.sampledFeature, self.sampledFeature, self.parameter, self.relatedObservation, self.lineage, self.relatedSamplingFeature, self.propertyValueProvider, self.materialClass, self.specimenType)
185
186    def __eq__(self, y):
187        '''
188        Cannot compare classes which do not define a "__key" attribute
189        '''
190        if hasattr(self, '_%s__key' % (type(self).__name__)) and hasattr(y, '_%s__key' % (type(y).__name__)):
191            return self.__key() == y.__key()
192        return id(self) == id(y)
193
194    def __hash__(self):
195        return hash(self.__key())
Note: See TracBrowser for help on using the repository browser.