source: mauRepo/MolesManager/trunk/src/ea_model/iso_19115_2006_metadata_corrigendum/data_quality_information/dq_dataquality.py @ 8091

Subversion URL: http://proj.badc.rl.ac.uk/svn/ndg/mauRepo/MolesManager/trunk/src/ea_model/iso_19115_2006_metadata_corrigendum/data_quality_information/dq_dataquality.py@8091
Revision 8091, 3.8 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 ascore.utils import has_value
22
23'''
24Created on 16-Feb-2012 16:18:10
25
26@author: mnagni
27'''
28
29class DQ_DataQuality(object):
30    '''
31        Represents a data entity defined in a UML diagram and supposed to
32        be persisted in a relational database.
33 
34        This class has been genererated automatically using the Apache Velocity project.
35    '''
36    '''
37        Please note that any access to the inner attributes should be done using
38        the given get/set methods and NOT accessing them directly.
39    '''
40    def __init__(self):
41
42        self.lineage = None
43        self.scope = None
44        self._report_dq_logicalconsistency = []
45        self._report_dq_thematicaccuracy = []
46        self._report_qe_usability = []
47        self._report_dq_completeness = []
48        self._report_dq_positionalaccuracy = []
49        self._report_dq_temporalaccuracy = []
50        super(DQ_DataQuality, self).__init__()
51
52    @property
53    def report(self):   
54        ret = []
55        for item in self._report_dq_logicalconsistency:
56            ret.append(item)
57        for item in self._report_dq_thematicaccuracy:
58            ret.append(item)
59        for item in self._report_qe_usability:
60            ret.append(item)
61        for item in self._report_dq_completeness:
62            ret.append(item)
63        for item in self._report_dq_positionalaccuracy:
64            ret.append(item)
65        for item in self._report_dq_temporalaccuracy:
66            ret.append(item)
67        return ret
68
69    @report.setter
70    def report(self, value):   
71        if isinstance(value, list):
72            self._report_dq_logicalconsistency[:]
73            self._report_dq_thematicaccuracy[:]
74            self._report_qe_usability[:]
75            self._report_dq_completeness[:]
76            self._report_dq_positionalaccuracy[:]
77            self._report_dq_temporalaccuracy[:]
78            for item in value:
79                valueClass = "%s.%s" % (type(item).__module__,type(item).__name__)
80                if valueClass == "ea_model.iso_19115_2006_metadata_corrigendum.data_quality_information.dq_logicalconsistency.DQ_LogicalConsistency":
81                    self._report_dq_logicalconsistency.append(item)
82                    continue
83                if valueClass == "ea_model.iso_19115_2006_metadata_corrigendum.data_quality_information.dq_thematicaccuracy.DQ_ThematicAccuracy":
84                    self._report_dq_thematicaccuracy.append(item)
85                    continue
86                if valueClass == "ea_model.iso_19115_2_2009_metadata___imagery.data_quality_information___imagery.qe_usability.QE_Usability":
87                    self._report_qe_usability.append(item)
88                    continue
89                if valueClass == "ea_model.iso_19115_2006_metadata_corrigendum.data_quality_information.dq_completeness.DQ_Completeness":
90                    self._report_dq_completeness.append(item)
91                    continue
92                if valueClass == "ea_model.iso_19115_2006_metadata_corrigendum.data_quality_information.dq_positionalaccuracy.DQ_PositionalAccuracy":
93                    self._report_dq_positionalaccuracy.append(item)
94                    continue
95                if valueClass == "ea_model.iso_19115_2006_metadata_corrigendum.data_quality_information.dq_temporalaccuracy.DQ_TemporalAccuracy":
96                    self._report_dq_temporalaccuracy.append(item)
97                    continue
98
99    def __key(self):
100        return (self.lineage, self.scope, self.report)
101
102    def __eq__(self, y):
103        '''
104        Cannot compare classes which do not define a "__key" attribute
105        '''
106        if hasattr(self, '_%s__key' % (type(self).__name__)) and hasattr(y, '_%s__key' % (type(y).__name__)):
107            return self.__key() == y.__key()
108        return id(self) == id(y)
109
110    def __hash__(self):
111        return hash(self.__key())
Note: See TracBrowser for help on using the repository browser.