Changeset 8017 for mauRepo


Ignore:
Timestamp:
15/12/11 17:17:48 (8 years ago)
Author:
mnagni
Message:
 
Location:
mauRepo/xmi2sqlalchemy/trunk/src
Files:
3 added
2 deleted
12 edited
1 moved

Legend:

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

    r8004 r8017  
    55import java.io.InputStream; 
    66import java.util.Calendar; 
     7import java.util.List; 
    78import java.util.concurrent.Callable; 
    89 
     
    2728import ndg.services.newmoon.xmiModel.UMLTaggedValue; 
    2829import ndg.services.newmoon.xmiModel.UMLValueTagged; 
     30import ndg.services.newmoon.xmiModel.UML_Element; 
    2931import ndg.services.newmoon.xmiModel.UML_ID; 
    3032import ndg.services.newmoon.xmiModel.adapter.UML_IDAdapder; 
    3133import ndg.services.newmoon.xmiModel.v11.Dictionary; 
    3234 
     35import org.apache.commons.collections.CollectionUtils; 
     36import org.apache.commons.collections.SetUtils; 
    3337import org.apache.commons.io.IOUtils; 
     38import org.apache.commons.lang.StringUtils; 
    3439import org.slf4j.Logger; 
    3540import org.slf4j.LoggerFactory; 
     
    120125                 
    121126                DepenciesParser dp = new DepenciesParser(mainUmlModel); 
    122                 dp.startProcess();                       
     127                dp.startProcess();       
     128                processGeneralizations(); 
     129                processAssociations(); 
    123130                return mainUmlModel; 
    124131        } 
     
    534541        }  
    535542         
    536         /* 
     543 
    537544        private void processGeneralizations() { 
    538                 List<UMLGeneralization> generalizations = helper.getAllUMLGeneralizations(); 
     545                List<UMLGeneralization> generalizations = UMLElementsArchive.getInstance().getUMLElementByType(UMLGeneralization.class); 
    539546                for (UMLGeneralization generalization : generalizations) { 
    540                         UML_Element subtype = helper.findElementByID(generalization.getSubtype()); 
     547                        UML_Element subtype = UMLElementsArchive.getInstance().getType(generalization.getSubtype()); 
    541548                        if (subtype instanceof UMLClass) { 
    542549                                ((UMLClass)subtype).getGeneralization().add(generalization); 
    543550                        } 
    544551                } 
    545         }*/ 
     552        } 
     553         
     554        private void processAssociations() { 
     555                List<UMLAssociation> associations = UMLElementsArchive.getInstance().getUMLElementByType(UMLAssociation.class); 
     556                for (UMLAssociation association : associations) { 
     557                        if (association.getAssociationEnds().size() == 2) { 
     558                                UMLAssociationEnd[] ends = association.getAssociationEnds().toArray(new UMLAssociationEnd[0]); 
     559                                processEndAssociations(ends[0], ends[1]); 
     560                        } 
     561                } 
     562        } 
     563         
     564        private void processEndAssociations(UMLAssociationEnd source, UMLAssociationEnd target) { 
     565                UML_Element elSource = UMLElementsArchive.getInstance().getType(source.getType()); 
     566                UML_Element elTarget = UMLElementsArchive.getInstance().getType(target.getType()); 
     567                if (StringUtils.isNotEmpty(target.getName()) && elSource instanceof UMLClass) { 
     568                        CollectionUtils.addIgnoreNull(((UMLClass)elSource).getAssociationEnds(), target); 
     569                } 
     570                if (StringUtils.isNotEmpty(source.getName()) && elTarget instanceof UMLClass) { 
     571                        CollectionUtils.addIgnoreNull(((UMLClass)elTarget).getAssociationEnds(), source); 
     572                }                        
     573        } 
    546574} 
  • mauRepo/xmi2sqlalchemy/trunk/src/main/java/ndg/services/newmoon/NmParserHelper.java

    r7974 r8017  
    6060         
    6161        /** 
    62          * @param document 
    63          */ 
    64         /* 
    65         public NmParserHelper(byte[] docInputStream) { 
    66                 super(); 
    67                 this.inputSource = new InputSource(new ByteArrayInputStream(docInputStream)); 
    68         } 
    69         */ 
    70          
    71         /* 
    72         public Node findElementByID(String umlId) {      
    73                 XPathFactory  factory=XPathFactory.newInstance(); 
    74                 XPath xPath=factory.newXPath(); 
    75                 String expression = "//*[@xmi.id='" + umlId + "']"; 
    76                 try { 
    77                         return (Node) xPath.evaluate(expression, 
    78                                 inputSource, XPathConstants.NODE); 
    79                 } catch (XPathExpressionException e) { 
    80                         logger.error("Cannont find any element", e); 
    81                 } 
    82                 return null; 
    83         } 
    84         */ 
    85          
    86         /*       
    87         public UML_Element findElementByID(UML_ID umlId) { 
    88                 return UMLElementsArchive.getInstance().getUMLElement(umlId); 
    89         } 
    90         */ 
    91          
    92         public List<UMLGeneralization> getAllUMLGeneralizations() { 
    93                 return UMLElementsArchive.getInstance().getUMLElementByType(UMLGeneralization.class); 
    94         } 
    95          
    96         public List<UMLAssociation> getAllUMLAssociations() { 
    97                 return UMLElementsArchive.getInstance().getUMLElementByType(UMLAssociation.class); 
    98         } 
    99          
    100         /** 
    10162         * Returns the package name expression of the given UMLPackage. 
    10263         * The format is in the typical Python/Java form ('.' separated) 
  • mauRepo/xmi2sqlalchemy/trunk/src/main/java/ndg/services/newmoon/UMLElementsArchive.java

    r8009 r8017  
    212212                                continue; // should throw an exception (?) 
    213213 
    214                         UMLClass ret = getUMLClassFromUMLModelByNameAndModelId(elementOwner.getName(), requiredUmlModel.getModelId()); 
    215                         if (ret != null) 
    216                                 return ret; 
     214//                      UMLClass ret = getUMLClassFromUMLModelByNameAndModelId(elementOwner.getName(), requiredUmlModel.getModelId()); 
     215                         
     216                        List<UMLClass> classes = getUMLClassesByUMLModel(requiredUmlModel); 
     217                        for (UMLClass clazz : classes) { 
     218                                if (clazz.getName().equals(elementOwner.getName())) { 
     219                                        return clazz; 
     220                                }                                        
     221                        } 
     222 
     223//                      if (ret != null) 
     224//                              return ret; 
    217225                } 
    218226                return null; 
     
    244252        } 
    245253         
    246         public Set<UMLAssociationEnd> getAssociationEndsForUMLClass(UMLClass umlClass) { 
    247                 if (umlClass == null) 
    248                         return null; 
    249                  
    250                 Set<UMLAssociationEnd> associationEnds = new HashSet<UMLAssociationEnd>();               
    251                 for(UMLAssociation association : getUMLAssociations()) { 
    252                         UMLAssociationEnd source = null; 
    253                         UMLAssociationEnd target = null; 
    254                         for(UMLAssociationEnd end : association.getAssociationEnds()) { 
    255                                 if(umlClass.getId().equals(end.getType().getId()) && StringUtils.isEmpty(end.getName())) {                                       
    256                                         source = end; 
    257                                 } 
    258                                 if (!StringUtils.isEmpty(end.getName())) { 
    259                                         target = end; 
    260                                 } 
    261                         } 
    262                         if (source == null)  
    263                                 continue;                        
    264                         CollectionUtils.addIgnoreNull(associationEnds, target);                                          
    265                 } 
    266  
    267                 return associationEnds; 
    268         }        
    269          
    270254        public Set<UMLClass> getSupertypesForUMLClass(UMLClass umlClass) { 
    271255                Set<UMLClass> supertypes = new HashSet<UMLClass>(); 
     
    273257                if (umlClass == null) 
    274258                        return supertypes; 
    275  
    276                 Set<UMLGeneralization> generalizations = getUMLGeneralizationByUMLClass(umlClass); 
    277                  
    278                 if (CollectionUtils.isEmpty(generalizations)) 
    279                         return supertypes; 
    280                  
    281                 for(UMLGeneralization generalization : generalizations) { 
     259                 
     260                for(UMLGeneralization generalization : umlClass.getGeneralization()) { 
    282261                        CollectionUtils.addIgnoreNull(supertypes, getType(generalization.getSupertype())); 
    283262                } 
     
    296275        }        
    297276         
     277        /* 
    298278        private Set<UMLGeneralization> getUMLGeneralizationByUMLClass(UMLClass umlClass) { 
    299279                synchronized (umlGeneralizationByUMLClass) { 
     
    319299                return generalization; 
    320300        }        
     301        */ 
    321302         
    322303        private List<UMLDependency> getUMLDependenciesByUMLModel(UMLModel umlModel) { 
     
    830811        } 
    831812 
    832         /* 
    833          * (non-Javadoc) 
     813        /** 
     814         * Returns the value of a TaggedValue element. 
    834815         *  
    835          * @see 
    836          * ndg.services.newmoon.xmiModel.UMLAttribute#getTaggedValue(java.lang.String 
    837          * ) 
     816         * @param valueTagged a {@link UMLValueTagged} element 
     817         * @param tagName the name of the <code>TaggedValue</code> element 
     818         * @return the value or <code>null</code> is the tag does not exist 
    838819         */ 
    839820        public String getTaggedValue(UMLValueTagged valueTagged, String tagName) { 
  • mauRepo/xmi2sqlalchemy/trunk/src/main/java/ndg/services/newmoon/collect/CollectClassesClosure.java

    r8009 r8017  
    130130 
    131131        private void collectAttributes(ClassModel cm) throws NewmoonException, IOException { 
    132                 if (cm.getAssociatedClass().getAttributes().size() == 0) 
    133                         return; 
    134132                CollectAttributesClosure cac = new CollectAttributesClosure(cm); 
    135133                CollectionUtils.forAllDo(cm.getAssociatedClass().getAttributes(), cac); 
    136                 CollectionUtils.forAllDo( 
    137                                 UMLElementsArchive.getInstance().getAssociationEndsForUMLClass(cm.getAssociatedClass()), cac); 
     134                CollectionUtils.forAllDo(cm.getAssociatedClass().getAssociationEnds(), cac); 
    138135 
    139136                // Temporary commented 
  • mauRepo/xmi2sqlalchemy/trunk/src/main/java/ndg/services/newmoon/velocity/python/GenerateTables.java

    r8013 r8017  
    6363 *  
    6464 */ 
    65 public class GenerateTables_ { 
     65public class GenerateTables { 
    6666 
    6767        private enum CONTEXT { 
     
    8787        private GenerateModuleHelper helper; 
    8888         
    89         private final Logger logger = LoggerFactory.getLogger(GenerateTables_.class); 
     89        private final Logger logger = LoggerFactory.getLogger(GenerateTables.class); 
    9090         
    9191        private final File baseDir; 
     
    9494         * @param baseDir 
    9595         */ 
    96         public GenerateTables_(File baseDir) { 
     96        public GenerateTables(File baseDir) { 
    9797                super(); 
    9898                this.baseDir = baseDir; 
  • mauRepo/xmi2sqlalchemy/trunk/src/main/java/ndg/services/newmoon/xmiModel/UMLClass.java

    r7998 r8017  
    3232package ndg.services.newmoon.xmiModel; 
    3333 
     34import java.util.Set; 
     35 
    3436 
    3537/** 
     
    3840 */ 
    3941public interface UMLClass extends UMLClassDataType, UMLStereotyped { 
    40  
     42        public Set<UMLGeneralization> getGeneralization(); 
     43        public Set<UMLAssociationEnd> getAssociationEnds(); 
    4144} 
  • mauRepo/xmi2sqlalchemy/trunk/src/main/resources/global_library.vm

    r8013 r8017  
     1#macro( truncate $text) 
     2#if($text.length() > 40) 
     3$text.substring(0, 40)#else$text#end 
     4#end 
     5 
    16#macro( substituteClassType $typeName) 
    27#if($typeName.equals('CharacterString')) 
     
    3338#set ($ft = $relation.fromTable.associatedClass.name) 
    3439#set ($tmn = $tableModel.associatedClass.name) 
     40#set ($totalName_1 = "${tt.toLowerCase()}_${ft.toLowerCase()}") 
     41#set ($totalName_2 = "${ft.toLowerCase()}_${relation.name}") 
    3542#if ($relation.isManyToMany()) 
    3643'${relation.name}': relationship(${tt},  
    37 secondary=${tt.toLowerCase()}_${ft.toLowerCase()}_table 
     44secondary=#truncate($totalName_1)_table 
    3845#if ($relation.backrefName), backref='_${relation.backrefName}' #end 
    3946#elseif($relation.isOneToMany()) 
     
    4956#end 
    5057#if($relation.isOneToOne() || $relation.isOneToMany()) 
    51 , primaryjoin=${tt.toLowerCase()}_table.c.${ft.toLowerCase()}_${relation.name}==${tmn.toLowerCase()}_table.c.${tmn.toLowerCase()}_id 
     58, primaryjoin=${tt.toLowerCase()}_table.c.#truncate($totalName_2)==${tmn.toLowerCase()}_table.c.${tmn.toLowerCase()}_id 
    5259#end 
    5360)#end 
  • mauRepo/xmi2sqlalchemy/trunk/src/main/resources/velocity/python/association.vm

    r7974 r8017  
    22#set ($rn = ${associationTable.rightTable.associatedClass.name.toLowerCase()}) 
    33#set ($ln = ${associationTable.leftTable.associatedClass.name.toLowerCase()}) 
    4 ${rn}_${ln}_table = Table('${rn}_${ln}', metadata, 
     4#set ($totalName = "${rn}_${ln}") 
     5#truncate($totalName)_table = Table('#truncate($totalName)', metadata, 
    56${tab}Column('left_node_id', Integer, ForeignKey(${rn}_table.c.${rn}_id)), 
    67${tab}Column('right_node_id', Integer, ForeignKey(${ln}_table.c.${ln}_id)) 
  • mauRepo/xmi2sqlalchemy/trunk/src/main/resources/velocity/python/pythonClass.vm

    r8013 r8017  
    7979#macro( attributes $attributes, $parents) 
    8080#foreach($attribute in $attributes) 
    81 #if($attribute.parent) 
    82 ${tab}${tab}self._${attribute.name} 
    83 #end 
     81${tab}${tab}self.${attribute.name} 
    8482#end 
    8583#if($parents) 
  • mauRepo/xmi2sqlalchemy/trunk/src/main/resources/velocity/python/sqlAlchemyTables.vm

    r8012 r8017  
    2424#macro( fk $foreignKey, $tableModel) 
    2525#set ($fkName = ${foreignKey.tableModel.associatedClass.name.toLowerCase()}) 
    26 Column('${fkName}_${foreignKey.parentAttributeName}', Integer, ForeignKey('${fkName}.${fkName}_id'#checkUseAlter($foreignKey, $fkName))), 
     26#set ($totalName = "${fkName}_${foreignKey.parentAttributeName.toLowerCase()}") 
     27Column('#truncate($totalName)', Integer, ForeignKey('${fkName}.${fkName}_id'#checkUseAlter($foreignKey, $fkName))), 
    2728#end 
    2829 
  • mauRepo/xmi2sqlalchemy/trunk/src/main/resources/xmiMaps.properties

    r7974 r8017  
    5252GeoSciML=https://www.seegrid.csiro.au/subversion/GeoSciML/model/geosciml.xml 
    5353 
    54 UpComingISO=http://proj.badc.rl.ac.uk/moles/export/187/trunk/ConceptualModel/UpComingISO.xml 
    55 MOLES3.4_Proper=http://proj.badc.rl.ac.uk/moles/export/188/trunk/ConceptualModel/MOLES3_4.xml 
     54UpComingISO=http://proj.badc.rl.ac.uk/svn/moles/trunk/ConceptualModel/UpComingISO.xml 
     55MOLES3.4=http://proj.badc.rl.ac.uk/svn/moles/trunk/ConceptualModel/MOLES3_4.xml 
  • mauRepo/xmi2sqlalchemy/trunk/src/test/java/ngn/services/newmoon/DOMParser.java

    r8004 r8017  
    1818import ndg.services.newmoon.velocity.python.GenerateFromClassModel; 
    1919import ndg.services.newmoon.velocity.python.GenerateModuleHelper; 
    20 import ndg.services.newmoon.velocity.python.GenerateTables_; 
     20import ndg.services.newmoon.velocity.python.GenerateTables; 
    2121import ndg.services.newmoon.xmiModel.UMLClass; 
    2222import ndg.services.newmoon.xmiModel.UMLModel; 
     
    7070                Map<NewmoonManager.NM_PARAM, String> params = new HashMap<NewmoonManager.NM_PARAM, String>(); 
    7171                params.put(NewmoonManager.NM_PARAM.EXECUTION_DIR, GenerateModuleHelper.class.getClassLoader().getResource(".").getPath()); 
    72                 params.put(NewmoonManager.NM_PARAM.XMI_DOC, "CEDA_Model/CEDA_ModelXMI.xml"); 
     72                params.put(NewmoonManager.NM_PARAM.XMI_DOC, "CEDA_Model/CEDA_Model.xml"); 
    7373                params.put(NewmoonManager.NM_PARAM.OUTPUT_DIR, "encode"); 
    7474                 
     
    103103 
    104104                        //Generates the sqlalchemy tables 
    105                         GenerateTables_ gen2 = new GenerateTables_(outDir); 
     105                        GenerateTables gen2 = new GenerateTables(outDir); 
    106106                        gen2.execute(umlModel); 
    107107                } catch (Exception e) { 
  • mauRepo/xmi2sqlalchemy/trunk/src/test/resources/removeAll

    r8013 r8017  
    8484 ORDER BY 1;   
    8585 
     86DROP TABLE IF EXISTS ceda_acquisition CASCADE; 
     87DROP TABLE IF EXISTS ceda_citation CASCADE; 
     88DROP TABLE IF EXISTS ceda_compositeprocess CASCADE; 
     89DROP TABLE IF EXISTS ceda_instrument CASCADE; 
     90DROP TABLE IF EXISTS ceda_notes CASCADE; 
     91DROP TABLE IF EXISTS ceda_observation CASCADE; 
     92DROP TABLE IF EXISTS ceda_observationcollection CASCADE; 
     93DROP TABLE IF EXISTS ceda_operation CASCADE; 
     94DROP TABLE IF EXISTS ceda_platform CASCADE; 
     95DROP TABLE IF EXISTS ceda_process CASCADE; 
    8696DROP TABLE IF EXISTS ceda_process_ceda_acquisition CASCADE; 
    8797DROP TABLE IF EXISTS ceda_process_ceda_compositeprocess CASCADE; 
    8898DROP TABLE IF EXISTS ceda_process_ceda_processing CASCADE; 
     99DROP TABLE IF EXISTS ceda_processing CASCADE; 
     100DROP TABLE IF EXISTS ceda_project CASCADE; 
     101DROP TABLE IF EXISTS ceda_result CASCADE; 
     102DROP TABLE IF EXISTS ceda_review CASCADE; 
     103DROP TABLE IF EXISTS ci_address CASCADE; 
     104DROP TABLE IF EXISTS ci_citation CASCADE; 
     105DROP TABLE IF EXISTS ci_contact CASCADE; 
     106DROP TABLE IF EXISTS ci_date CASCADE; 
     107DROP TABLE IF EXISTS ci_onlineresource CASCADE; 
    89108DROP TABLE IF EXISTS ci_onlineresource_mo_onlineresource CASCADE; 
     109DROP TABLE IF EXISTS ci_responsibleparty CASCADE; 
     110DROP TABLE IF EXISTS ci_series CASCADE; 
     111DROP TABLE IF EXISTS ci_telephone CASCADE; 
     112DROP TABLE IF EXISTS clocktime CASCADE; 
    90113DROP TABLE IF EXISTS clocktime_datetime CASCADE; 
     114DROP TABLE IF EXISTS date CASCADE; 
    91115DROP TABLE IF EXISTS date_datetime CASCADE; 
     116DROP TABLE IF EXISTS dateprecision CASCADE; 
     117DROP TABLE IF EXISTS datetime CASCADE; 
     118DROP TABLE IF EXISTS dq_dataquality CASCADE; 
     119DROP TABLE IF EXISTS dq_element CASCADE; 
     120DROP TABLE IF EXISTS dq_result CASCADE; 
     121DROP TABLE IF EXISTS dq_scope CASCADE; 
    92122DROP TABLE IF EXISTS earootclass CASCADE; 
     123DROP TABLE IF EXISTS ex_extent CASCADE; 
     124DROP TABLE IF EXISTS ex_geographicdescription CASCADE; 
     125DROP TABLE IF EXISTS ex_geographicextent CASCADE; 
    93126DROP TABLE IF EXISTS ex_geographicextent_ex_geographicdescription CASCADE; 
     127DROP TABLE IF EXISTS ex_temporalextent CASCADE; 
     128DROP TABLE IF EXISTS ex_verticalextent CASCADE; 
     129DROP TABLE IF EXISTS genericname CASCADE; 
    94130DROP TABLE IF EXISTS genericname_localname CASCADE; 
    95131DROP TABLE IF EXISTS genericname_scopedname CASCADE; 
    96132DROP TABLE IF EXISTS gf_attributetype CASCADE; 
     133DROP TABLE IF EXISTS gf_constraint CASCADE; 
    97134DROP TABLE IF EXISTS gf_featuretype CASCADE; 
     135DROP TABLE IF EXISTS gf_propertytype CASCADE; 
    98136DROP TABLE IF EXISTS gf_propertytype_gf_attributetype CASCADE; 
     137DROP TABLE IF EXISTS gm_object CASCADE; 
     138DROP TABLE IF EXISTS io_identifiedobjectbase CASCADE; 
    99139DROP TABLE IF EXISTS io_identifiedobjectbase_sc_crs CASCADE; 
     140DROP TABLE IF EXISTS li_lineage CASCADE; 
     141DROP TABLE IF EXISTS li_processstep CASCADE; 
     142DROP TABLE IF EXISTS li_source CASCADE; 
     143DROP TABLE IF EXISTS localname CASCADE; 
    100144DROP TABLE IF EXISTS localname_typename CASCADE; 
     145DROP TABLE IF EXISTS md_aggregateinformation CASCADE; 
     146DROP TABLE IF EXISTS md_applicationschemainformation CASCADE; 
     147DROP TABLE IF EXISTS md_browsegraphic CASCADE; 
     148DROP TABLE IF EXISTS md_constraints CASCADE; 
     149DROP TABLE IF EXISTS md_contentinformation CASCADE; 
     150DROP TABLE IF EXISTS md_distribution CASCADE; 
     151DROP TABLE IF EXISTS md_extendedelementinformation CASCADE; 
     152DROP TABLE IF EXISTS md_format CASCADE; 
     153DROP TABLE IF EXISTS md_identification CASCADE; 
     154DROP TABLE IF EXISTS md_identifier CASCADE; 
    101155DROP TABLE IF EXISTS md_identifier_rs_identifier CASCADE; 
     156DROP TABLE IF EXISTS md_keywords CASCADE; 
     157DROP TABLE IF EXISTS md_maintenanceinformation CASCADE; 
     158DROP TABLE IF EXISTS md_metadata CASCADE; 
     159DROP TABLE IF EXISTS md_metadataextensioninformation CASCADE; 
     160DROP TABLE IF EXISTS md_portrayalcataloguereference CASCADE; 
     161DROP TABLE IF EXISTS md_referencesystem CASCADE; 
     162DROP TABLE IF EXISTS md_representativefraction CASCADE; 
     163DROP TABLE IF EXISTS md_scopedescription CASCADE; 
     164DROP TABLE IF EXISTS md_spatialrepresentation CASCADE; 
     165DROP TABLE IF EXISTS md_usage CASCADE; 
     166DROP TABLE IF EXISTS measure CASCADE; 
    102167DROP TABLE IF EXISTS measure_scale CASCADE; 
    103168DROP TABLE IF EXISTS measure_time CASCADE; 
     169DROP TABLE IF EXISTS mo_acquisition CASCADE; 
    104170DROP TABLE IF EXISTS mo_acquisition_ceda_acquisition CASCADE; 
     171DROP TABLE IF EXISTS mo_compositeprocess CASCADE; 
    105172DROP TABLE IF EXISTS mo_compositeprocess_ceda_compositeprocess CASCADE; 
     173DROP TABLE IF EXISTS mo_computation CASCADE; 
    106174DROP TABLE IF EXISTS mo_computation_mo_processing CASCADE; 
     175DROP TABLE IF EXISTS mo_inputoutput CASCADE; 
     176DROP TABLE IF EXISTS mo_instrument CASCADE; 
    107177DROP TABLE IF EXISTS mo_instrument_ceda_instrument CASCADE; 
     178DROP TABLE IF EXISTS mo_instrumentplatformpair CASCADE; 
     179DROP TABLE IF EXISTS mo_location CASCADE; 
     180DROP TABLE IF EXISTS mo_observation CASCADE; 
    108181DROP TABLE IF EXISTS mo_observation_ceda_observation CASCADE; 
     182DROP TABLE IF EXISTS mo_observationcollection CASCADE; 
    109183DROP TABLE IF EXISTS mo_observationcollection_ceda_observationcollection CASCADE; 
     184DROP TABLE IF EXISTS mo_onlineresource CASCADE; 
     185DROP TABLE IF EXISTS mo_operation CASCADE; 
    110186DROP TABLE IF EXISTS mo_operation_ceda_operation CASCADE; 
     187DROP TABLE IF EXISTS mo_platform CASCADE; 
    111188DROP TABLE IF EXISTS mo_platform_ceda_platform CASCADE; 
     189DROP TABLE IF EXISTS mo_process CASCADE; 
    112190DROP TABLE IF EXISTS mo_process_ceda_process CASCADE; 
     191DROP TABLE IF EXISTS mo_processing CASCADE; 
    113192DROP TABLE IF EXISTS mo_processing_ceda_processing CASCADE; 
    114193DROP TABLE IF EXISTS mo_process_mo_acquisition CASCADE; 
    115194DROP TABLE IF EXISTS mo_process_mo_compositeprocess CASCADE; 
    116195DROP TABLE IF EXISTS mo_process_mo_computation CASCADE; 
     196DROP TABLE IF EXISTS mo_project CASCADE; 
    117197DROP TABLE IF EXISTS mo_project_ceda_project CASCADE; 
     198DROP TABLE IF EXISTS mo_responsiblepartyinfo CASCADE; 
     199DROP TABLE IF EXISTS mo_result CASCADE; 
    118200DROP TABLE IF EXISTS mo_result_ceda_result CASCADE; 
    119201DROP TABLE IF EXISTS multiplicity CASCADE; 
     202DROP TABLE IF EXISTS namedvalue CASCADE; 
    120203DROP TABLE IF EXISTS obs_coll_migration CASCADE; 
    121204DROP TABLE IF EXISTS observation_migration CASCADE; 
     205DROP TABLE IF EXISTS om_observation CASCADE; 
    122206DROP TABLE IF EXISTS om_observation_mo_observation CASCADE; 
     207DROP TABLE IF EXISTS om_process CASCADE; 
    123208DROP TABLE IF EXISTS om_process_mo_process CASCADE; 
     209DROP TABLE IF EXISTS rs_identifier CASCADE; 
     210DROP TABLE IF EXISTS rs_referencesystem CASCADE; 
    124211DROP TABLE IF EXISTS rs_referencesystem_sc_crs CASCADE; 
     212DROP TABLE IF EXISTS scale CASCADE; 
     213DROP TABLE IF EXISTS sc_crs CASCADE; 
     214DROP TABLE IF EXISTS scopedname CASCADE; 
     215DROP TABLE IF EXISTS time CASCADE; 
     216DROP TABLE IF EXISTS tm_duration CASCADE; 
    125217DROP TABLE IF EXISTS tm_duration_tm_periodduration CASCADE; 
     218DROP TABLE IF EXISTS tm_geometricprimitive CASCADE; 
    126219DROP TABLE IF EXISTS tm_geometricprimitive_tm_instant CASCADE; 
    127220DROP TABLE IF EXISTS tm_geometricprimitive_tm_period CASCADE; 
     221DROP TABLE IF EXISTS tm_instant CASCADE; 
     222DROP TABLE IF EXISTS tm_object CASCADE; 
    128223DROP TABLE IF EXISTS tm_object_tm_primitive CASCADE; 
     224DROP TABLE IF EXISTS tm_period CASCADE; 
     225DROP TABLE IF EXISTS tm_periodduration CASCADE; 
     226DROP TABLE IF EXISTS tm_position CASCADE; 
     227DROP TABLE IF EXISTS tm_primitive CASCADE; 
    129228DROP TABLE IF EXISTS tm_primitive_tm_geometricprimitive CASCADE; 
     229DROP TABLE IF EXISTS tm_temporalposition CASCADE; 
    130230DROP TABLE IF EXISTS typename CASCADE; 
     231DROP TABLE IF EXISTS unitofmeasure CASCADE; 
    131232DROP TABLE IF EXISTS unitofmeasure_uomlength CASCADE; 
    132233DROP TABLE IF EXISTS unitofmeasure_uomscale CASCADE; 
     234DROP TABLE IF EXISTS uomlength CASCADE; 
     235DROP TABLE IF EXISTS uomscale CASCADE; 
     236DROP TABLE IF EXISTS url CASCADE; 
     237 
     238DROP SEQUENCE IF EXISTS any_id_seq CASCADE; 
     239DROP SEQUENCE IF EXISTS ceda_acquisition_id_seq CASCADE; 
     240DROP SEQUENCE IF EXISTS ceda_citation_id_seq CASCADE; 
     241DROP SEQUENCE IF EXISTS ceda_compositeprocess_id_seq CASCADE; 
     242DROP SEQUENCE IF EXISTS ceda_instrument_id_seq CASCADE; 
     243DROP SEQUENCE IF EXISTS ceda_notes_id_seq CASCADE; 
     244DROP SEQUENCE IF EXISTS ceda_observationcollection_id_seq CASCADE; 
     245DROP SEQUENCE IF EXISTS ceda_observation_id_seq CASCADE; 
     246DROP SEQUENCE IF EXISTS ceda_operation_id_seq CASCADE; 
     247DROP SEQUENCE IF EXISTS ceda_platform_id_seq CASCADE; 
     248DROP SEQUENCE IF EXISTS ceda_process_id_seq CASCADE; 
     249DROP SEQUENCE IF EXISTS ceda_processing_id_seq CASCADE; 
     250DROP SEQUENCE IF EXISTS ceda_project_id_seq CASCADE; 
     251DROP SEQUENCE IF EXISTS ceda_result_id_seq CASCADE; 
     252DROP SEQUENCE IF EXISTS ceda_review_id_seq CASCADE; 
     253DROP SEQUENCE IF EXISTS ci_address_id_seq CASCADE; 
     254DROP SEQUENCE IF EXISTS ci_citation_id_seq CASCADE; 
     255DROP SEQUENCE IF EXISTS ci_contact_id_seq CASCADE; 
     256DROP SEQUENCE IF EXISTS ci_date_id_seq CASCADE; 
     257DROP SEQUENCE IF EXISTS ci_onlineresource_id_seq CASCADE; 
     258DROP SEQUENCE IF EXISTS ci_responsibleparty_id_seq CASCADE; 
     259DROP SEQUENCE IF EXISTS ci_series_id_seq CASCADE; 
     260DROP SEQUENCE IF EXISTS ci_telephone_id_seq CASCADE; 
     261DROP SEQUENCE IF EXISTS clocktime_id_seq CASCADE; 
     262DROP SEQUENCE IF EXISTS date_id_seq CASCADE; 
     263DROP SEQUENCE IF EXISTS dateprecision_id_seq CASCADE; 
     264DROP SEQUENCE IF EXISTS datetime_id_seq CASCADE; 
     265DROP SEQUENCE IF EXISTS dq_dataquality_id_seq CASCADE; 
     266DROP SEQUENCE IF EXISTS dq_element_id_seq CASCADE; 
     267DROP SEQUENCE IF EXISTS dq_result_id_seq CASCADE; 
     268DROP SEQUENCE IF EXISTS dq_scope_id_seq CASCADE; 
     269DROP SEQUENCE IF EXISTS earootclass_id_seq CASCADE; 
     270DROP SEQUENCE IF EXISTS ex_extent_id_seq CASCADE; 
     271DROP SEQUENCE IF EXISTS ex_geographicdescription_id_seq CASCADE; 
     272DROP SEQUENCE IF EXISTS ex_geographicextent_id_seq CASCADE; 
     273DROP SEQUENCE IF EXISTS ex_temporalextent_id_seq CASCADE; 
     274DROP SEQUENCE IF EXISTS ex_verticalextent_id_seq CASCADE; 
     275DROP SEQUENCE IF EXISTS genericname_id_seq CASCADE; 
     276DROP SEQUENCE IF EXISTS gf_attributetype_id_seq CASCADE; 
     277DROP SEQUENCE IF EXISTS gf_constraint_id_seq CASCADE; 
     278DROP SEQUENCE IF EXISTS gf_featuretype_id_seq CASCADE; 
     279DROP SEQUENCE IF EXISTS gf_propertytype_id_seq CASCADE; 
     280DROP SEQUENCE IF EXISTS gm_object_id_seq CASCADE; 
     281DROP SEQUENCE IF EXISTS io_identifiedobjectbase_id_seq CASCADE; 
     282DROP SEQUENCE IF EXISTS li_lineage_id_seq CASCADE; 
     283DROP SEQUENCE IF EXISTS li_processstep_id_seq CASCADE; 
     284DROP SEQUENCE IF EXISTS li_source_id_seq CASCADE; 
     285DROP SEQUENCE IF EXISTS localname_id_seq CASCADE; 
     286DROP SEQUENCE IF EXISTS md_aggregateinformation_id_seq CASCADE; 
     287DROP SEQUENCE IF EXISTS md_applicationschemainformation_id_seq CASCADE; 
     288DROP SEQUENCE IF EXISTS md_browsegraphic_id_seq CASCADE; 
     289DROP SEQUENCE IF EXISTS md_constraints_id_seq CASCADE; 
     290DROP SEQUENCE IF EXISTS md_contentinformation_id_seq CASCADE; 
     291DROP SEQUENCE IF EXISTS md_distribution_id_seq CASCADE; 
     292DROP SEQUENCE IF EXISTS md_extendedelementinformation_id_seq CASCADE; 
     293DROP SEQUENCE IF EXISTS md_format_id_seq CASCADE; 
     294DROP SEQUENCE IF EXISTS md_identification_id_seq CASCADE; 
     295DROP SEQUENCE IF EXISTS md_identifier_id_seq CASCADE; 
     296DROP SEQUENCE IF EXISTS md_keywords_id_seq CASCADE; 
     297DROP SEQUENCE IF EXISTS md_maintenanceinformation_id_seq CASCADE; 
     298DROP SEQUENCE IF EXISTS md_metadataextensioninformation_id_seq CASCADE; 
     299DROP SEQUENCE IF EXISTS md_metadata_id_seq CASCADE; 
     300DROP SEQUENCE IF EXISTS md_portrayalcataloguereference_id_seq CASCADE; 
     301DROP SEQUENCE IF EXISTS md_referencesystem_id_seq CASCADE; 
     302DROP SEQUENCE IF EXISTS md_representativefraction_id_seq CASCADE; 
     303DROP SEQUENCE IF EXISTS md_scopedescription_id_seq CASCADE; 
     304DROP SEQUENCE IF EXISTS md_spatialrepresentation_id_seq CASCADE; 
     305DROP SEQUENCE IF EXISTS md_usage_id_seq CASCADE; 
     306DROP SEQUENCE IF EXISTS measure_id_seq CASCADE; 
     307DROP SEQUENCE IF EXISTS mo_acquisition_id_seq CASCADE; 
     308DROP SEQUENCE IF EXISTS mo_compositeprocess_id_seq CASCADE; 
     309DROP SEQUENCE IF EXISTS mo_computation_id_seq CASCADE; 
     310DROP SEQUENCE IF EXISTS mo_inputoutput_id_seq CASCADE; 
     311DROP SEQUENCE IF EXISTS mo_instrument_id_seq CASCADE; 
     312DROP SEQUENCE IF EXISTS mo_instrumentplatformpair_id_seq CASCADE; 
     313DROP SEQUENCE IF EXISTS mo_location_id_seq CASCADE; 
     314DROP SEQUENCE IF EXISTS mo_observationcollection_id_seq CASCADE; 
     315DROP SEQUENCE IF EXISTS mo_observation_id_seq CASCADE; 
     316DROP SEQUENCE IF EXISTS mo_onlineresource_id_seq CASCADE; 
     317DROP SEQUENCE IF EXISTS mo_operation_id_seq CASCADE; 
     318DROP SEQUENCE IF EXISTS mo_platform_id_seq CASCADE; 
     319DROP SEQUENCE IF EXISTS mo_process_id_seq CASCADE; 
     320DROP SEQUENCE IF EXISTS mo_processing_id_seq CASCADE; 
     321DROP SEQUENCE IF EXISTS mo_project_id_seq CASCADE; 
     322DROP SEQUENCE IF EXISTS mo_responsiblepartyinfo_id_seq CASCADE; 
     323DROP SEQUENCE IF EXISTS mo_result_id_seq CASCADE; 
     324DROP SEQUENCE IF EXISTS multiplicity_id_seq CASCADE; 
     325DROP SEQUENCE IF EXISTS namedvalue_id_seq CASCADE; 
     326DROP SEQUENCE IF EXISTS om_observation_id_seq CASCADE; 
     327DROP SEQUENCE IF EXISTS om_process_id_seq CASCADE; 
     328DROP SEQUENCE IF EXISTS rs_identifier_id_seq CASCADE; 
     329DROP SEQUENCE IF EXISTS rs_referencesystem_id_seq CASCADE; 
     330DROP SEQUENCE IF EXISTS scale_id_seq CASCADE; 
     331DROP SEQUENCE IF EXISTS sc_crs_id_seq CASCADE; 
     332DROP SEQUENCE IF EXISTS scopedname_id_seq CASCADE; 
     333DROP SEQUENCE IF EXISTS time_id_seq CASCADE; 
     334DROP SEQUENCE IF EXISTS tm_duration_id_seq CASCADE; 
     335DROP SEQUENCE IF EXISTS tm_geometricprimitive_id_seq CASCADE; 
     336DROP SEQUENCE IF EXISTS tm_instant_id_seq CASCADE; 
     337DROP SEQUENCE IF EXISTS tm_object_id_seq CASCADE; 
     338DROP SEQUENCE IF EXISTS tm_periodduration_id_seq CASCADE; 
     339DROP SEQUENCE IF EXISTS tm_period_id_seq CASCADE; 
     340DROP SEQUENCE IF EXISTS tm_position_id_seq CASCADE; 
     341DROP SEQUENCE IF EXISTS tm_primitive_id_seq CASCADE; 
     342DROP SEQUENCE IF EXISTS tm_temporalposition_id_seq CASCADE; 
     343DROP SEQUENCE IF EXISTS typename_id_seq CASCADE; 
     344DROP SEQUENCE IF EXISTS unitofmeasure_id_seq CASCADE; 
     345DROP SEQUENCE IF EXISTS uomlength_id_seq CASCADE; 
     346DROP SEQUENCE IF EXISTS uomscale_id_seq CASCADE; 
     347DROP SEQUENCE IF EXISTS url_id_seq CASCADE; 
     348 
     349SELECT 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  
     350FROM obs_coll_migration  
     351WHERE obs_coll_migration.data_ent_id = 'tag:badc.nerc.ac.uk,2009-12-10:/view/badc.nerc.ac.uk__ATOM__dataent_hadgem1-ct' 
     352 
     353SELECT 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  
     354FROM observation_migration  
     355WHERE depl_name = 'dep_11731402648516527.atom'  
     356 
     357SELECT 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  
     358FROM ceda_observation  
     359WHERE ceda_observation.ceda_observation_id = 980 
     360 
     361SELECT 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  
     362FROM obs_coll_migration  
     363WHERE obs_coll_migration.data_ent_id = 'tag:badc.nerc.ac.uk,2009-12-10:/view/badc.nerc.ac.uk__ATOM__dataent_COAPEC' 
     364 
     365SELECT 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  
     366FROM observation_migration  
     367WHERE depl_name = 'dep_11655964239611677.atom' 
     368 
Note: See TracChangeset for help on using the changeset viewer.