Changeset 1898 for TI01-discovery/trunk


Ignore:
Timestamp:
19/12/06 19:07:48 (13 years ago)
Author:
selatham
Message:

further ingest work

Location:
TI01-discovery/trunk/ingestAutomation/OAIBatch
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • TI01-discovery/trunk/ingestAutomation/OAIBatch/SpaceTimeIngestFromMOLES.py

    r1821 r1898  
    4848            if filename.find('.xml') != -1: 
    4949                full_filename = indir + "/" + filename 
     50                no_bbox, no_dates = False 
    5051                dgMeta=MRW.dgMetadata() 
    5152                try: 
     
    5657                try: 
    5758                    bbox=dgMeta.dgMetadataRecord.dgDataEntity.dgDataSummary.dgDataCoverage.dgSpatialCoverage.BoundingBox 
     59                    print bbox 
    5860                except: 
    5961                    print "INFO: XML moles document %s does not contain a bounding box." %full_filename 
    60  
     62                    no_bbox=True 
    6163                try: 
    6264                    dates=dgMeta.dgMetadataRecord.dgDataEntity.dgDataSummary.dgDataCoverage.dgTemporalCoverage.DateRange 
    63                 except: 
    64                     print "INFO: XML moles document %s does not contain a bounding box." %full_filename 
     65                    print dates 
     66                except: 
     67                    print "INFO: XML moles document %s does not contain temporal info." %full_filename 
     68                    no_dates=True 
    6569 
    66                 coverage= [dates.DateRangeEnd, dates.DateRangeStart, bbox.LimitNorth, bbox.LimitSouth,bbox.LimitEast, bbox.LimitWest] 
     70                if no_bbox and no_dates: 
     71                    print "INFO: XML moles document %s does not contain any spatiotemporal info." %full_filename 
     72                    continue 
     73                #coverage= [dates.DateRangeEnd, dates.DateRangeStart, bbox.LimitNorth, bbox.LimitSouth,bbox.LimitEast, bbox.LimitWest] 
    6774                #Mid = dgMeta.dgMetadataRecord.dgMetadataID.repositoryIdentifier+"__"+dgMeta.dgMetadataRecord.dgMetadataID.localIdentifier 
    6875                Mid = filename 
    69                 print coverage, Mid 
     76                print Mid 
    7077                #parse the coordinates somewhat 
    7178                #west 
  • TI01-discovery/trunk/ingestAutomation/OAIBatch/oai_ingest.py

    r1889 r1898  
    2727import commands 
    2828import string 
     29import SpaceTimeIngestFromMOLES 
    2930#import oaiClean 
    3031 
     
    178179    print "ERROR: couldn't create the minimum moles records" 
    179180    sys.exit 
     181#are there any records 
     182outdir = "./DIF2MOLES" 
     183try: 
     184    os.stat(outdir) 
     185except: 
     186    print "ERROR: couldn't create the minimum moles records for %s" %datacentre 
     187    sys.exit() 
    180188 
    181189# ingest the created discovery minimum molesrecords into eXist db. 
     
    187195 
    188196#Extract the spatiotemporal info from created moles and put in Postgres db 
    189 outdir = "./DIF2MOLES" 
    190 try: 
    191     SpaceTimeIngestFromMOLES.main(outdir) 
    192 except: 
    193     print "ERROR: SpaceTimeIngestFromMOLES failed. Carrying on to do backups" 
     197SpaceTimeIngestFromMOLES.main(outdir) 
    194198 
    195199#Make copies of discovery and oai/originals and DIF2MOLES areas to backup area for tape backups 
Note: See TracChangeset for help on using the changeset viewer.