Ignore:
Timestamp:
04/01/12 10:35:54 (8 years ago)
Author:
mnagni
Message:

Works fine. Now initializes also the python classes attributes

Location:
mauRepo/xmi2sqlalchemy/trunk/src
Files:
3 added
6 edited
1 moved

Legend:

Unmodified
Added
Removed
  • mauRepo/xmi2sqlalchemy/trunk/src/main/java/ndg/services/newmoon/collect/AttributeModel.java

    r8040 r8043  
    8181         
    8282        public boolean hasMultiplicity() { 
     83                if (upperBound == null || collectionType == null) { 
     84                        return false; 
     85                } 
     86                         
    8387                return upperBound > 1  
    8488                                || collectionType.equals(CollectionType.SET) 
  • mauRepo/xmi2sqlalchemy/trunk/src/main/java/ndg/services/newmoon/velocity/python/GenerateClasses.java

    r8009 r8043  
    4949 * 
    5050 */ 
    51 public class GenerateClassesClosure implements Closure { 
     51public class GenerateClasses implements Closure { 
    5252         
    5353        private final static String templateFile = "velocity/python/pythonClass.vm"; 
     
    6060         * @param baseDir 
    6161         */ 
    62         public GenerateClassesClosure(File baseDir) { 
     62        public GenerateClasses(File baseDir) { 
    6363                super(); 
    6464                this.baseDir = baseDir; 
    6565        } 
    6666 
    67         private enum CONTEXT { 
     67        public enum CONTEXT { 
    6868                classModel, imports, stereotype, attributes 
    6969        }; 
  • mauRepo/xmi2sqlalchemy/trunk/src/main/java/ndg/services/newmoon/velocity/python/NmVelocity.java

    r7998 r8043  
    9090                vcontext.put("tab", "\t"); 
    9191                vcontext.put("nl", "\n"); 
     92                vcontext.put("vh", NmVelocityHelper.class); 
    9293                Template template = loadTemplate(templateName); 
    9394                StringWriter sw = new StringWriter(); 
  • mauRepo/xmi2sqlalchemy/trunk/src/main/java/ndg/services/newmoon/velocity/python/PythonClassModel.java

    r8012 r8043  
    108108         * Checks if this instance redefines a parent attribute.  
    109109         * */ 
    110         public Set<PythonAttribute> getAttributes(){ 
    111                 Set<PythonAttribute> attributes = new HashSet<PythonClassModel.PythonAttribute>(); 
     110        public Set<PythonAttributeModel> getAttributes(){ 
     111                Set<PythonAttributeModel> attributes = new HashSet<PythonAttributeModel>(); 
    112112                 
    113113                extractAttributes(this.getAttributeModel(), attributes, null); 
     
    118118        } 
    119119         
    120         private void extractAttributes(Set<AttributeModel> am, Set<PythonAttribute> pa, ClassModel owner) { 
     120        private void extractAttributes(Set<AttributeModel> am, Set<PythonAttributeModel> pa, ClassModel owner) { 
    121121                for (AttributeModel attribute : am) { 
    122122                        //If the attribute has been redefined in a child skips the loop 
    123                         if (pa.contains(new PythonAttribute(attribute.getName(), null, null))) 
     123                        if (pa.contains(new PythonAttributeModel(attribute, null, null))) 
    124124                                continue; 
    125125                        if (attribute == null  
     
    130130                        //add the new attribute with the proper parent  
    131131                        //(null if the attribute is directly from "this" instance) 
    132                         pa.add(new PythonAttribute( 
    133                                         attribute.getName(), 
    134                                         owner == null ? null : owner.getAssociatedClass().getName(),  
     132                        pa.add(new PythonAttributeModel(attribute, 
     133                                        owner,  
    135134                                        skipIt() ? null : attribute.getAssociatedType().getAssociatedClass().getName())); 
    136135                }                
    137136        } 
    138137         
    139         private void extractParentAttributes(ClassModel cm, Set<PythonAttribute> attributes, ClassModel parent) { 
     138        private void extractParentAttributes(ClassModel cm, Set<PythonAttributeModel> attributes, ClassModel parent) { 
    140139                extractAttributes(cm.getAttributeModel(), attributes, parent); 
    141140                for (ClassModel grandfather : cm.getParents()) { 
     
    144143        } 
    145144         
    146         private UMLClass getStereotypeDummy(STEREOTYPE stereotype) { 
     145        public static UMLClass getStereotypeDummy(STEREOTYPE stereotype) { 
    147146                if (stereotype == null) 
    148147                        return null; 
     
    160159                return null; 
    161160        } 
    162          
    163         public class PythonAttribute { 
    164                 private final String name; 
    165                 private final String parentName; 
    166                 private final String typeName; 
    167                 /** 
    168                  * @param name 
    169                  * @param parentName 
    170                  * @param typeName 
    171                  */ 
    172                 public PythonAttribute(String name, String parentName, String typeName) { 
    173                         super(); 
    174                         this.name = name; 
    175                         this.parentName = parentName; 
    176                         this.typeName = typeName; 
    177                 } 
    178                 /** 
    179                  * @return the name 
    180                  */ 
    181                 public String getName() { 
    182                         return name; 
    183                 } 
    184                 /** 
    185                  * @return the parentName 
    186                  */ 
    187                 public String getParentName() { 
    188                         return parentName; 
    189                 } 
    190                 /** 
    191                  * @return the typeName 
    192                  */ 
    193                 public String getTypeName() { 
    194                         return typeName; 
    195                 } 
    196                 /* (non-Javadoc) 
    197                  * @see java.lang.Object#hashCode() 
    198                  */ 
    199                 @Override 
    200                 public int hashCode() { 
    201                         final int prime = 31; 
    202                         int result = 1; 
    203                         result = prime * result + getOuterType().hashCode(); 
    204                         result = prime * result + ((name == null) ? 0 : name.hashCode()); 
    205                         return result; 
    206                 } 
    207                 /* (non-Javadoc) 
    208                  * @see java.lang.Object#equals(java.lang.Object) 
    209                  */ 
    210                 @Override 
    211                 public boolean equals(Object obj) { 
    212                         if (this == obj) 
    213                                 return true; 
    214                         if (obj == null) 
    215                                 return false; 
    216                         if (getClass() != obj.getClass()) 
    217                                 return false; 
    218                         PythonAttribute other = (PythonAttribute) obj; 
    219                         if (!getOuterType().equals(other.getOuterType())) 
    220                                 return false; 
    221                         if (name == null) { 
    222                                 if (other.name != null) 
    223                                         return false; 
    224                         } else if (!name.equals(other.name)) 
    225                                 return false; 
    226                         return true; 
    227                 } 
    228                 private PythonClassModel getOuterType() { 
    229                         return PythonClassModel.this; 
    230                 } 
    231         } 
    232161} 
  • mauRepo/xmi2sqlalchemy/trunk/src/main/resources/velocity/python/pythonClass.vm

    r8040 r8043  
    5252#macro (getter $attribute) 
    5353#set ( $methodName = "$display.capitalize( $attribute.name )") 
    54 #if($attribute.parentName) 
     54#if($attribute.getParentName()) 
    5555${tab}@property 
    5656${tab}def ${attribute.name}(self): 
    57 ${tab}${tab}return self._${attribute.parentName.toLowerCase()}.${attribute.name} 
     57${tab}${tab}return self._${attribute.getParentName().toLowerCase()}.${attribute.name} 
    5858#end 
    5959#end 
     
    6161#macro (setter $attribute) 
    6262#set ( $methodName = "$display.capitalize( $attribute.name )") 
    63 #if($attribute.parentName) 
     63#if($attribute.getParentName()) 
    6464${tab}@${attribute.name}.setter 
    6565${tab}def ${attribute.name}(self, value): 
    66 ${tab}${tab}${tab} self._${attribute.parentName.toLowerCase()}.${attribute.name} = value 
     66${tab}${tab}${tab} self._${attribute.getParentName().toLowerCase()}.${attribute.name} = value 
    6767#end 
    6868#end 
     
    8282${tab}${tab}self._${parent.associatedClass.name.toLowerCase()} = ${parent.associatedClass.name}()        
    8383#end 
     84#end 
    8485#foreach($attribute in $attributes) 
    85 ${tab}${tab}self.${attribute.name} 
     86${tab}${tab}self.${attribute.name} #if($attribute.hasMultiplicity()) = [] 
     87#else = None 
    8688#end 
    8789#end 
  • mauRepo/xmi2sqlalchemy/trunk/src/test/java/ngn/services/newmoon/DOMParser.java

    r8017 r8043  
    1515import ndg.services.newmoon.UMLElementsArchive; 
    1616import ndg.services.newmoon.collect.CollectClasses; 
    17 import ndg.services.newmoon.velocity.python.GenerateClassesClosure; 
     17import ndg.services.newmoon.velocity.python.GenerateClasses; 
    1818import ndg.services.newmoon.velocity.python.GenerateFromClassModel; 
    1919import ndg.services.newmoon.velocity.python.GenerateModuleHelper; 
     
    9999                         
    100100                        //Generates the python classes                   
    101                         GenerateFromClassModel gen = new GenerateFromClassModel(new GenerateClassesClosure(outDir)); 
     101                        GenerateFromClassModel gen = new GenerateFromClassModel(new GenerateClasses(outDir)); 
    102102                        gen.execute(UMLElementsArchive.getInstance().getClassModel()); 
    103103 
  • mauRepo/xmi2sqlalchemy/trunk/src/test/resources/removeAll

    r8017 r8043  
    1 DROP TABLE IF EXISTS absractobservableproperty,  
    2 ci_address, ci_citation, ci_contact, ci_date, 
    3 ci_onlineresource, ci_responsibleparty, ci_series, 
    4 ci_telephone, clocktime, compositeobservableproperty, 
    5 date, dateprecision, datetime, distance, dq_dataquality, 
    6 dq_element, dq_result, dq_scope, ex_extent,  
    7 ex_geographicdescription, ex_geographicextent, ex_temporalextent, 
    8 ex_verticalextent, genericname, gf_constraint, gf_propertytype, 
    9 gfi_domainfeature, gfi_feature, gm_object, io_identifiedobjectbase,  
    10 le_algorithm, le_nominalresolution, le_processing, le_source, 
    11 length, li_lineage, li_processstep, li_source, localname,  
    12 location, md_aggregateinformation, md_applicationschemainformation,  
    13 md_browsegraphic, md_constraints, md_contentinformation,  
    14 md_digitaltransferoptions, md_distribution, md_distributor, 
    15 md_extendedelementinformation, md_format, md_identification, 
    16 md_identifier, md_keywords, md_maintenanceinformation,  
    17 md_medium, md_metadata, md_metadataextensioninformation, 
    18 md_portrayalcataloguereference, md_referencesystem, md_representativefraction, 
    19 md_scopedescription, md_spatialrepresentation, md_standardorderprocess,  
    20 md_usage, measure, mi_event, mi_instrument, mi_objective,  
    21 mi_operation, mi_platform, mi_platformpass, mo_acquisition, 
    22 mo_compositeprocess, mo_computation, mo_fetureofinterest,  
    23 mo_inputoutput, mo_instrument, mo_instrumentplatformpair,  
    24 mo_location, mo_observation, mo_observationcollection, mo_onlineresource, 
    25 mo_operation, mo_organization, mo_platform, mo_process, mo_processing, 
    26 mo_project, mo_responsiblepartyinfo, mo_result, mo_specimen,  
    27 mo_specimenprocess, namedvalue, number, observablepropertyconstraint, 
    28 om_observation, om_process, rs_identifier, rs_referencesystem, 
    29 any, sc_crs, scale, scopedname, sf_process, sf_samplingfeature, 
    30 sf_specimen, simpleobservableproperty, time, tm_duration, 
    31 tm_geometricprimitive, tm_instant, tm_object, tm_period, 
    32 tm_periodduration, tm_position, tm_primitive, tm_temporalposition, 
    33 unitofmeasure, uomlength, uomscale, url, ceda_acquisition, ceda_citation, 
    34 ceda_compositeprocess, ceda_instrument, ceda_notes, ceda_observation, 
    35 ceda_observationcollection, ceda_operation, ceda_platform, ceda_process, 
    36 ceda_processing, ceda_project, ceda_result, ceda_review, ci_organisation, 
    37 ci_responsibility, ceda_observationcollection_ceda_project, md_identifier_ci_citation, 
    38 mo_instrument_mo_instrument, mo_observationcollection_mo_observationcollection, 
    39 mo_observationcollection_mo_project, mo_operation_mo_operation, mo_platform_mo_platform, 
    40 mo_project_mo_project, mo_result_mo_result, om_observation_om_observation, mo_project_mo_observation, 
    41 mo_observation_mo_observationcollection, ci_citation_md_identifier, ceda_project_ceda_observation, 
    42 ceda_observation_ceda_observationcollection, ci_individual, ci_party, ci_responsiblepartyinfo, 
    43 ceda_process_ceda_acquisition, ceda_process_ceda_compositeprocess, ci_onlineresource_mo_onlineresource, 
    44 clocktime_datetime, date_datetime, earootclass, ex_geographicextent_ex_geographicdescription, 
    45 genericname_localname, genericname_scopedname, gf_attributetype, gf_featuretype, gf_propertytype_gf_attributetype, 
    46  
    47 CASCADE; 
    48  
    49 DROP SEQUENCE IF EXISTS absractobservableproperty_id_seq, any_id_seq, 
    50 ci_address_id_seq, ci_citation_id_seq, ci_contact_id_seq, ci_date_id_seq, 
    51 ci_onlineresource_id_seq, ci_responsibleparty_id_seq, ci_series_id_seq, 
    52 ci_telephone_id_seq, clocktime_id_seq, compositeobservableproperty_id_seq, 
    53 date_id_seq, dateprecision_id_seq, datetime_id_seq, distance_id_seq, 
    54 dq_dataquality_id_seq, dq_element_id_seq, dq_result_id_seq, clocktime_id_seq, 
    55 ceda_acquisition_id_seq, ceda_citation_id_seq, ceda_compositeprocess_id_seq, 
    56 ceda_instrument_id_seq, ceda_notes_id_seq, ceda_observation_id_seq,  
    57 ceda_observationcollection_id_seq, ceda_operation_id_seq, ceda_platform_id_seq, 
    58 ceda_process_id_seq, ceda_processing_id_seq, ceda_project_id_seq, ceda_result_id_seq, 
    59 ceda_review_id_seq, ci_organisation_id_seq, ci_responsibility_id_seq, dq_scope_id_seq, 
    60 ex_extent_id_seq, ex_geographicdescription_id_seq, ex_geographicextent_id_seq,  
    61 ex_temporalextent_id_seq, ex_verticalextent_id_seq, genericname_id_seq,  
    62 gf_constraint_id_seq, gf_propertytype_id_seq, gfi_domainfeature_id_seq 
    63 CASCADE;  
    64  
    65  
    66  SELECT    
     1 SELECT    
    672 'DROP TABLE IF EXISTS '||c.relname ||' CASCADE;'   
    683 FROM pg_catalog.pg_class c   
     
    8318 AND pg_catalog.pg_table_is_visible(c.oid)   
    8419 ORDER BY 1;   
    85  
    86 DROP TABLE IF EXISTS ceda_acquisition CASCADE; 
    87 DROP TABLE IF EXISTS ceda_citation CASCADE; 
    88 DROP TABLE IF EXISTS ceda_compositeprocess CASCADE; 
    89 DROP TABLE IF EXISTS ceda_instrument CASCADE; 
    90 DROP TABLE IF EXISTS ceda_notes CASCADE; 
    91 DROP TABLE IF EXISTS ceda_observation CASCADE; 
    92 DROP TABLE IF EXISTS ceda_observationcollection CASCADE; 
    93 DROP TABLE IF EXISTS ceda_operation CASCADE; 
    94 DROP TABLE IF EXISTS ceda_platform CASCADE; 
    95 DROP TABLE IF EXISTS ceda_process CASCADE; 
    96 DROP TABLE IF EXISTS ceda_process_ceda_acquisition CASCADE; 
    97 DROP TABLE IF EXISTS ceda_process_ceda_compositeprocess CASCADE; 
    98 DROP TABLE IF EXISTS ceda_process_ceda_processing CASCADE; 
    99 DROP TABLE IF EXISTS ceda_processing CASCADE; 
    100 DROP TABLE IF EXISTS ceda_project CASCADE; 
    101 DROP TABLE IF EXISTS ceda_result CASCADE; 
    102 DROP TABLE IF EXISTS ceda_review CASCADE; 
    103 DROP TABLE IF EXISTS ci_address CASCADE; 
    104 DROP TABLE IF EXISTS ci_citation CASCADE; 
    105 DROP TABLE IF EXISTS ci_contact CASCADE; 
    106 DROP TABLE IF EXISTS ci_date CASCADE; 
    107 DROP TABLE IF EXISTS ci_onlineresource CASCADE; 
    108 DROP TABLE IF EXISTS ci_onlineresource_mo_onlineresource CASCADE; 
    109 DROP TABLE IF EXISTS ci_responsibleparty CASCADE; 
    110 DROP TABLE IF EXISTS ci_series CASCADE; 
    111 DROP TABLE IF EXISTS ci_telephone CASCADE; 
    112 DROP TABLE IF EXISTS clocktime CASCADE; 
    113 DROP TABLE IF EXISTS clocktime_datetime CASCADE; 
    114 DROP TABLE IF EXISTS date CASCADE; 
    115 DROP TABLE IF EXISTS date_datetime CASCADE; 
    116 DROP TABLE IF EXISTS dateprecision CASCADE; 
    117 DROP TABLE IF EXISTS datetime CASCADE; 
    118 DROP TABLE IF EXISTS dq_dataquality CASCADE; 
    119 DROP TABLE IF EXISTS dq_element CASCADE; 
    120 DROP TABLE IF EXISTS dq_result CASCADE; 
    121 DROP TABLE IF EXISTS dq_scope CASCADE; 
    122 DROP TABLE IF EXISTS earootclass CASCADE; 
    123 DROP TABLE IF EXISTS ex_extent CASCADE; 
    124 DROP TABLE IF EXISTS ex_geographicdescription CASCADE; 
    125 DROP TABLE IF EXISTS ex_geographicextent CASCADE; 
    126 DROP TABLE IF EXISTS ex_geographicextent_ex_geographicdescription CASCADE; 
    127 DROP TABLE IF EXISTS ex_temporalextent CASCADE; 
    128 DROP TABLE IF EXISTS ex_verticalextent CASCADE; 
    129 DROP TABLE IF EXISTS genericname CASCADE; 
    130 DROP TABLE IF EXISTS genericname_localname CASCADE; 
    131 DROP TABLE IF EXISTS genericname_scopedname CASCADE; 
    132 DROP TABLE IF EXISTS gf_attributetype CASCADE; 
    133 DROP TABLE IF EXISTS gf_constraint CASCADE; 
    134 DROP TABLE IF EXISTS gf_featuretype CASCADE; 
    135 DROP TABLE IF EXISTS gf_propertytype CASCADE; 
    136 DROP TABLE IF EXISTS gf_propertytype_gf_attributetype CASCADE; 
    137 DROP TABLE IF EXISTS gm_object CASCADE; 
    138 DROP TABLE IF EXISTS io_identifiedobjectbase CASCADE; 
    139 DROP TABLE IF EXISTS io_identifiedobjectbase_sc_crs CASCADE; 
    140 DROP TABLE IF EXISTS li_lineage CASCADE; 
    141 DROP TABLE IF EXISTS li_processstep CASCADE; 
    142 DROP TABLE IF EXISTS li_source CASCADE; 
    143 DROP TABLE IF EXISTS localname CASCADE; 
    144 DROP TABLE IF EXISTS localname_typename CASCADE; 
    145 DROP TABLE IF EXISTS md_aggregateinformation CASCADE; 
    146 DROP TABLE IF EXISTS md_applicationschemainformation CASCADE; 
    147 DROP TABLE IF EXISTS md_browsegraphic CASCADE; 
    148 DROP TABLE IF EXISTS md_constraints CASCADE; 
    149 DROP TABLE IF EXISTS md_contentinformation CASCADE; 
    150 DROP TABLE IF EXISTS md_distribution CASCADE; 
    151 DROP TABLE IF EXISTS md_extendedelementinformation CASCADE; 
    152 DROP TABLE IF EXISTS md_format CASCADE; 
    153 DROP TABLE IF EXISTS md_identification CASCADE; 
    154 DROP TABLE IF EXISTS md_identifier CASCADE; 
    155 DROP TABLE IF EXISTS md_identifier_rs_identifier CASCADE; 
    156 DROP TABLE IF EXISTS md_keywords CASCADE; 
    157 DROP TABLE IF EXISTS md_maintenanceinformation CASCADE; 
    158 DROP TABLE IF EXISTS md_metadata CASCADE; 
    159 DROP TABLE IF EXISTS md_metadataextensioninformation CASCADE; 
    160 DROP TABLE IF EXISTS md_portrayalcataloguereference CASCADE; 
    161 DROP TABLE IF EXISTS md_referencesystem CASCADE; 
    162 DROP TABLE IF EXISTS md_representativefraction CASCADE; 
    163 DROP TABLE IF EXISTS md_scopedescription CASCADE; 
    164 DROP TABLE IF EXISTS md_spatialrepresentation CASCADE; 
    165 DROP TABLE IF EXISTS md_usage CASCADE; 
    166 DROP TABLE IF EXISTS measure CASCADE; 
    167 DROP TABLE IF EXISTS measure_scale CASCADE; 
    168 DROP TABLE IF EXISTS measure_time CASCADE; 
    169 DROP TABLE IF EXISTS mo_acquisition CASCADE; 
    170 DROP TABLE IF EXISTS mo_acquisition_ceda_acquisition CASCADE; 
    171 DROP TABLE IF EXISTS mo_compositeprocess CASCADE; 
    172 DROP TABLE IF EXISTS mo_compositeprocess_ceda_compositeprocess CASCADE; 
    173 DROP TABLE IF EXISTS mo_computation CASCADE; 
    174 DROP TABLE IF EXISTS mo_computation_mo_processing CASCADE; 
    175 DROP TABLE IF EXISTS mo_inputoutput CASCADE; 
    176 DROP TABLE IF EXISTS mo_instrument CASCADE; 
    177 DROP TABLE IF EXISTS mo_instrument_ceda_instrument CASCADE; 
    178 DROP TABLE IF EXISTS mo_instrumentplatformpair CASCADE; 
    179 DROP TABLE IF EXISTS mo_location CASCADE; 
    180 DROP TABLE IF EXISTS mo_observation CASCADE; 
    181 DROP TABLE IF EXISTS mo_observation_ceda_observation CASCADE; 
    182 DROP TABLE IF EXISTS mo_observationcollection CASCADE; 
    183 DROP TABLE IF EXISTS mo_observationcollection_ceda_observationcollection CASCADE; 
    184 DROP TABLE IF EXISTS mo_onlineresource CASCADE; 
    185 DROP TABLE IF EXISTS mo_operation CASCADE; 
    186 DROP TABLE IF EXISTS mo_operation_ceda_operation CASCADE; 
    187 DROP TABLE IF EXISTS mo_platform CASCADE; 
    188 DROP TABLE IF EXISTS mo_platform_ceda_platform CASCADE; 
    189 DROP TABLE IF EXISTS mo_process CASCADE; 
    190 DROP TABLE IF EXISTS mo_process_ceda_process CASCADE; 
    191 DROP TABLE IF EXISTS mo_processing CASCADE; 
    192 DROP TABLE IF EXISTS mo_processing_ceda_processing CASCADE; 
    193 DROP TABLE IF EXISTS mo_process_mo_acquisition CASCADE; 
    194 DROP TABLE IF EXISTS mo_process_mo_compositeprocess CASCADE; 
    195 DROP TABLE IF EXISTS mo_process_mo_computation CASCADE; 
    196 DROP TABLE IF EXISTS mo_project CASCADE; 
    197 DROP TABLE IF EXISTS mo_project_ceda_project CASCADE; 
    198 DROP TABLE IF EXISTS mo_responsiblepartyinfo CASCADE; 
    199 DROP TABLE IF EXISTS mo_result CASCADE; 
    200 DROP TABLE IF EXISTS mo_result_ceda_result CASCADE; 
    201 DROP TABLE IF EXISTS multiplicity CASCADE; 
    202 DROP TABLE IF EXISTS namedvalue CASCADE; 
    203 DROP TABLE IF EXISTS obs_coll_migration CASCADE; 
    204 DROP TABLE IF EXISTS observation_migration CASCADE; 
    205 DROP TABLE IF EXISTS om_observation CASCADE; 
    206 DROP TABLE IF EXISTS om_observation_mo_observation CASCADE; 
    207 DROP TABLE IF EXISTS om_process CASCADE; 
    208 DROP TABLE IF EXISTS om_process_mo_process CASCADE; 
    209 DROP TABLE IF EXISTS rs_identifier CASCADE; 
    210 DROP TABLE IF EXISTS rs_referencesystem CASCADE; 
    211 DROP TABLE IF EXISTS rs_referencesystem_sc_crs CASCADE; 
    212 DROP TABLE IF EXISTS scale CASCADE; 
    213 DROP TABLE IF EXISTS sc_crs CASCADE; 
    214 DROP TABLE IF EXISTS scopedname CASCADE; 
    215 DROP TABLE IF EXISTS time CASCADE; 
    216 DROP TABLE IF EXISTS tm_duration CASCADE; 
    217 DROP TABLE IF EXISTS tm_duration_tm_periodduration CASCADE; 
    218 DROP TABLE IF EXISTS tm_geometricprimitive CASCADE; 
    219 DROP TABLE IF EXISTS tm_geometricprimitive_tm_instant CASCADE; 
    220 DROP TABLE IF EXISTS tm_geometricprimitive_tm_period CASCADE; 
    221 DROP TABLE IF EXISTS tm_instant CASCADE; 
    222 DROP TABLE IF EXISTS tm_object CASCADE; 
    223 DROP TABLE IF EXISTS tm_object_tm_primitive CASCADE; 
    224 DROP TABLE IF EXISTS tm_period CASCADE; 
    225 DROP TABLE IF EXISTS tm_periodduration CASCADE; 
    226 DROP TABLE IF EXISTS tm_position CASCADE; 
    227 DROP TABLE IF EXISTS tm_primitive CASCADE; 
    228 DROP TABLE IF EXISTS tm_primitive_tm_geometricprimitive CASCADE; 
    229 DROP TABLE IF EXISTS tm_temporalposition CASCADE; 
    230 DROP TABLE IF EXISTS typename CASCADE; 
    231 DROP TABLE IF EXISTS unitofmeasure CASCADE; 
    232 DROP TABLE IF EXISTS unitofmeasure_uomlength CASCADE; 
    233 DROP TABLE IF EXISTS unitofmeasure_uomscale CASCADE; 
    234 DROP TABLE IF EXISTS uomlength CASCADE; 
    235 DROP TABLE IF EXISTS uomscale CASCADE; 
    236 DROP TABLE IF EXISTS url CASCADE; 
    237  
    238 DROP SEQUENCE IF EXISTS any_id_seq CASCADE; 
    239 DROP SEQUENCE IF EXISTS ceda_acquisition_id_seq CASCADE; 
    240 DROP SEQUENCE IF EXISTS ceda_citation_id_seq CASCADE; 
    241 DROP SEQUENCE IF EXISTS ceda_compositeprocess_id_seq CASCADE; 
    242 DROP SEQUENCE IF EXISTS ceda_instrument_id_seq CASCADE; 
    243 DROP SEQUENCE IF EXISTS ceda_notes_id_seq CASCADE; 
    244 DROP SEQUENCE IF EXISTS ceda_observationcollection_id_seq CASCADE; 
    245 DROP SEQUENCE IF EXISTS ceda_observation_id_seq CASCADE; 
    246 DROP SEQUENCE IF EXISTS ceda_operation_id_seq CASCADE; 
    247 DROP SEQUENCE IF EXISTS ceda_platform_id_seq CASCADE; 
    248 DROP SEQUENCE IF EXISTS ceda_process_id_seq CASCADE; 
    249 DROP SEQUENCE IF EXISTS ceda_processing_id_seq CASCADE; 
    250 DROP SEQUENCE IF EXISTS ceda_project_id_seq CASCADE; 
    251 DROP SEQUENCE IF EXISTS ceda_result_id_seq CASCADE; 
    252 DROP SEQUENCE IF EXISTS ceda_review_id_seq CASCADE; 
    253 DROP SEQUENCE IF EXISTS ci_address_id_seq CASCADE; 
    254 DROP SEQUENCE IF EXISTS ci_citation_id_seq CASCADE; 
    255 DROP SEQUENCE IF EXISTS ci_contact_id_seq CASCADE; 
    256 DROP SEQUENCE IF EXISTS ci_date_id_seq CASCADE; 
    257 DROP SEQUENCE IF EXISTS ci_onlineresource_id_seq CASCADE; 
    258 DROP SEQUENCE IF EXISTS ci_responsibleparty_id_seq CASCADE; 
    259 DROP SEQUENCE IF EXISTS ci_series_id_seq CASCADE; 
    260 DROP SEQUENCE IF EXISTS ci_telephone_id_seq CASCADE; 
    261 DROP SEQUENCE IF EXISTS clocktime_id_seq CASCADE; 
    262 DROP SEQUENCE IF EXISTS date_id_seq CASCADE; 
    263 DROP SEQUENCE IF EXISTS dateprecision_id_seq CASCADE; 
    264 DROP SEQUENCE IF EXISTS datetime_id_seq CASCADE; 
    265 DROP SEQUENCE IF EXISTS dq_dataquality_id_seq CASCADE; 
    266 DROP SEQUENCE IF EXISTS dq_element_id_seq CASCADE; 
    267 DROP SEQUENCE IF EXISTS dq_result_id_seq CASCADE; 
    268 DROP SEQUENCE IF EXISTS dq_scope_id_seq CASCADE; 
    269 DROP SEQUENCE IF EXISTS earootclass_id_seq CASCADE; 
    270 DROP SEQUENCE IF EXISTS ex_extent_id_seq CASCADE; 
    271 DROP SEQUENCE IF EXISTS ex_geographicdescription_id_seq CASCADE; 
    272 DROP SEQUENCE IF EXISTS ex_geographicextent_id_seq CASCADE; 
    273 DROP SEQUENCE IF EXISTS ex_temporalextent_id_seq CASCADE; 
    274 DROP SEQUENCE IF EXISTS ex_verticalextent_id_seq CASCADE; 
    275 DROP SEQUENCE IF EXISTS genericname_id_seq CASCADE; 
    276 DROP SEQUENCE IF EXISTS gf_attributetype_id_seq CASCADE; 
    277 DROP SEQUENCE IF EXISTS gf_constraint_id_seq CASCADE; 
    278 DROP SEQUENCE IF EXISTS gf_featuretype_id_seq CASCADE; 
    279 DROP SEQUENCE IF EXISTS gf_propertytype_id_seq CASCADE; 
    280 DROP SEQUENCE IF EXISTS gm_object_id_seq CASCADE; 
    281 DROP SEQUENCE IF EXISTS io_identifiedobjectbase_id_seq CASCADE; 
    282 DROP SEQUENCE IF EXISTS li_lineage_id_seq CASCADE; 
    283 DROP SEQUENCE IF EXISTS li_processstep_id_seq CASCADE; 
    284 DROP SEQUENCE IF EXISTS li_source_id_seq CASCADE; 
    285 DROP SEQUENCE IF EXISTS localname_id_seq CASCADE; 
    286 DROP SEQUENCE IF EXISTS md_aggregateinformation_id_seq CASCADE; 
    287 DROP SEQUENCE IF EXISTS md_applicationschemainformation_id_seq CASCADE; 
    288 DROP SEQUENCE IF EXISTS md_browsegraphic_id_seq CASCADE; 
    289 DROP SEQUENCE IF EXISTS md_constraints_id_seq CASCADE; 
    290 DROP SEQUENCE IF EXISTS md_contentinformation_id_seq CASCADE; 
    291 DROP SEQUENCE IF EXISTS md_distribution_id_seq CASCADE; 
    292 DROP SEQUENCE IF EXISTS md_extendedelementinformation_id_seq CASCADE; 
    293 DROP SEQUENCE IF EXISTS md_format_id_seq CASCADE; 
    294 DROP SEQUENCE IF EXISTS md_identification_id_seq CASCADE; 
    295 DROP SEQUENCE IF EXISTS md_identifier_id_seq CASCADE; 
    296 DROP SEQUENCE IF EXISTS md_keywords_id_seq CASCADE; 
    297 DROP SEQUENCE IF EXISTS md_maintenanceinformation_id_seq CASCADE; 
    298 DROP SEQUENCE IF EXISTS md_metadataextensioninformation_id_seq CASCADE; 
    299 DROP SEQUENCE IF EXISTS md_metadata_id_seq CASCADE; 
    300 DROP SEQUENCE IF EXISTS md_portrayalcataloguereference_id_seq CASCADE; 
    301 DROP SEQUENCE IF EXISTS md_referencesystem_id_seq CASCADE; 
    302 DROP SEQUENCE IF EXISTS md_representativefraction_id_seq CASCADE; 
    303 DROP SEQUENCE IF EXISTS md_scopedescription_id_seq CASCADE; 
    304 DROP SEQUENCE IF EXISTS md_spatialrepresentation_id_seq CASCADE; 
    305 DROP SEQUENCE IF EXISTS md_usage_id_seq CASCADE; 
    306 DROP SEQUENCE IF EXISTS measure_id_seq CASCADE; 
    307 DROP SEQUENCE IF EXISTS mo_acquisition_id_seq CASCADE; 
    308 DROP SEQUENCE IF EXISTS mo_compositeprocess_id_seq CASCADE; 
    309 DROP SEQUENCE IF EXISTS mo_computation_id_seq CASCADE; 
    310 DROP SEQUENCE IF EXISTS mo_inputoutput_id_seq CASCADE; 
    311 DROP SEQUENCE IF EXISTS mo_instrument_id_seq CASCADE; 
    312 DROP SEQUENCE IF EXISTS mo_instrumentplatformpair_id_seq CASCADE; 
    313 DROP SEQUENCE IF EXISTS mo_location_id_seq CASCADE; 
    314 DROP SEQUENCE IF EXISTS mo_observationcollection_id_seq CASCADE; 
    315 DROP SEQUENCE IF EXISTS mo_observation_id_seq CASCADE; 
    316 DROP SEQUENCE IF EXISTS mo_onlineresource_id_seq CASCADE; 
    317 DROP SEQUENCE IF EXISTS mo_operation_id_seq CASCADE; 
    318 DROP SEQUENCE IF EXISTS mo_platform_id_seq CASCADE; 
    319 DROP SEQUENCE IF EXISTS mo_process_id_seq CASCADE; 
    320 DROP SEQUENCE IF EXISTS mo_processing_id_seq CASCADE; 
    321 DROP SEQUENCE IF EXISTS mo_project_id_seq CASCADE; 
    322 DROP SEQUENCE IF EXISTS mo_responsiblepartyinfo_id_seq CASCADE; 
    323 DROP SEQUENCE IF EXISTS mo_result_id_seq CASCADE; 
    324 DROP SEQUENCE IF EXISTS multiplicity_id_seq CASCADE; 
    325 DROP SEQUENCE IF EXISTS namedvalue_id_seq CASCADE; 
    326 DROP SEQUENCE IF EXISTS om_observation_id_seq CASCADE; 
    327 DROP SEQUENCE IF EXISTS om_process_id_seq CASCADE; 
    328 DROP SEQUENCE IF EXISTS rs_identifier_id_seq CASCADE; 
    329 DROP SEQUENCE IF EXISTS rs_referencesystem_id_seq CASCADE; 
    330 DROP SEQUENCE IF EXISTS scale_id_seq CASCADE; 
    331 DROP SEQUENCE IF EXISTS sc_crs_id_seq CASCADE; 
    332 DROP SEQUENCE IF EXISTS scopedname_id_seq CASCADE; 
    333 DROP SEQUENCE IF EXISTS time_id_seq CASCADE; 
    334 DROP SEQUENCE IF EXISTS tm_duration_id_seq CASCADE; 
    335 DROP SEQUENCE IF EXISTS tm_geometricprimitive_id_seq CASCADE; 
    336 DROP SEQUENCE IF EXISTS tm_instant_id_seq CASCADE; 
    337 DROP SEQUENCE IF EXISTS tm_object_id_seq CASCADE; 
    338 DROP SEQUENCE IF EXISTS tm_periodduration_id_seq CASCADE; 
    339 DROP SEQUENCE IF EXISTS tm_period_id_seq CASCADE; 
    340 DROP SEQUENCE IF EXISTS tm_position_id_seq CASCADE; 
    341 DROP SEQUENCE IF EXISTS tm_primitive_id_seq CASCADE; 
    342 DROP SEQUENCE IF EXISTS tm_temporalposition_id_seq CASCADE; 
    343 DROP SEQUENCE IF EXISTS typename_id_seq CASCADE; 
    344 DROP SEQUENCE IF EXISTS unitofmeasure_id_seq CASCADE; 
    345 DROP SEQUENCE IF EXISTS uomlength_id_seq CASCADE; 
    346 DROP SEQUENCE IF EXISTS uomscale_id_seq CASCADE; 
    347 DROP SEQUENCE IF EXISTS url_id_seq CASCADE; 
    348  
    349 SELECT obs_coll_migration.data_ent_id AS obs_coll_migration_data_ent_id, obs_coll_migration.data_ent_name AS obs_coll_migration_data_ent_name, obs_coll_migration.obs_coll_id AS obs_coll_migration_obs_coll_id, obs_coll_migration.data_ent_creation AS obs_coll_migration_data_ent_creation, obs_coll_migration.exist_path AS obs_coll_migration_exist_path  
    350 FROM obs_coll_migration  
    351 WHERE obs_coll_migration.data_ent_id = 'tag:badc.nerc.ac.uk,2009-12-10:/view/badc.nerc.ac.uk__ATOM__dataent_hadgem1-ct' 
    352  
    353 SELECT observation_migration.depl_id AS observation_migration_depl_id, observation_migration.depl_name AS observation_migration_depl_name, observation_migration.obs_id AS observation_migration_obs_id, observation_migration.depl_creation AS observation_migration_depl_creation, observation_migration.exist_path AS observation_migration_exist_path  
    354 FROM observation_migration  
    355 WHERE depl_name = 'dep_11731402648516527.atom'  
    356  
    357 SELECT ceda_observation.ceda_observation_id AS ceda_observation_ceda_observation_id, ceda_observation.mo_observation_id AS ceda_observation_mo_observation_id, ceda_observation.ceda_observationcollection_member AS ceda_observation_ceda_observationcollection_member, ceda_observation."dataLineage" AS "ceda_observation_dataLineage", ceda_observation.t_type AS ceda_observation_t_type  
    358 FROM ceda_observation  
    359 WHERE ceda_observation.ceda_observation_id = 980 
    360  
    361 SELECT obs_coll_migration.data_ent_id AS obs_coll_migration_data_ent_id, obs_coll_migration.data_ent_name AS obs_coll_migration_data_ent_name, obs_coll_migration.obs_coll_id AS obs_coll_migration_obs_coll_id, obs_coll_migration.data_ent_creation AS obs_coll_migration_data_ent_creation, obs_coll_migration.exist_path AS obs_coll_migration_exist_path  
    362 FROM obs_coll_migration  
    363 WHERE obs_coll_migration.data_ent_id = 'tag:badc.nerc.ac.uk,2009-12-10:/view/badc.nerc.ac.uk__ATOM__dataent_COAPEC' 
    364  
    365 SELECT observation_migration.depl_id AS observation_migration_depl_id, observation_migration.depl_name AS observation_migration_depl_name, observation_migration.obs_id AS observation_migration_obs_id, observation_migration.depl_creation AS observation_migration_depl_creation, observation_migration.exist_path AS observation_migration_exist_path  
    366 FROM observation_migration  
    367 WHERE depl_name = 'dep_11655964239611677.atom' 
    368  
Note: See TracChangeset for help on using the changeset viewer.