Changeset 2263
- Timestamp:
- 12/03/07 23:34:44 (14 years ago)
- Location:
- TI01-discovery/trunk/ingestAutomation/OAIBatch
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
TI01-discovery/trunk/ingestAutomation/OAIBatch/SpaceTimeIngestFromMOLES.py
r2262 r2263 32 32 def do_insert(Mid,west,south,east,north,startdate,enddate): 33 33 sql = "INSERT INTO spatiotemp (id, coordinates, startdate, enddate) VALUES ( '"+Mid+ "', sbox'(("+west+"d , "+south+"d), ("+east+"d , "+north+"d))', '"+startdate+"', '"+enddate+"');" 34 #sql.replace("'null'",None)34 sql.replace("nulld","null") 35 35 print sql 36 36 cursor = connection.cursor() … … 43 43 def do_update(Mid,west,south,east,north,startdate,enddate): 44 44 sql = "UPDATE spatiotemp SET coordinates = sbox'(("+west+"d , "+south+"d), ("+east+"d , "+north+"d))', startdate='"+startdate+"', enddate= '"+enddate+"', update_time= now() WHERE id='"+Mid+"';" 45 #sql.replace("'null'",None)45 sql.replace("nulld","null") 46 46 print sql 47 47 cursor = connection.cursor() … … 71 71 no_bbox = False 72 72 no_dates = False 73 east = 074 west = 075 north = 076 south = 077 startdate=" January 1, 01 BC"78 enddate=" January 1, 01 BC"73 east = 'null' 74 west = 'null' 75 north = 'null' 76 south = 'null' 77 startdate="null" 78 enddate="null" 79 79 dgMeta=MRW.dgMetadata() 80 80 try: … … 192 192 #print "North = %s" %south 193 193 194 print "west= %s,south %s, east %s, north %s, startdate %s, enddate %s" %(west,south,east,north,startdate,enddate) 194 195 if id_exists( Mid ): 195 196 print "INFO: doc %s exists, updating\n" %Mid … … 197 198 else: 198 199 print "INFO: doc %s does not exist, inserting new record\n" %Mid 200 199 201 do_insert( Mid, west, south, east, north, startdate, enddate ) 200 202 numfilesproc += 1 -
TI01-discovery/trunk/ingestAutomation/OAIBatch/nocs_config.properties
r1988 r2263 16 16 namespace noc.soton.ac.uk 17 17 # 18 #Say whether this is a full NDG data Provider who uses NDG identifiers etc. 19 NDG_dataProvider -
TI01-discovery/trunk/ingestAutomation/OAIBatch/oai_ingest.py
r2252 r2263 213 213 ident=getID(original_filename) 214 214 if NDG_dataProvider: 215 molesLocalID = ident.split(":",2)[2] 215 ident.replace(":","__") 216 molesLocalID = ident.split("__",2)[2] 216 217 else: 217 218 molesLocalID = ident
Note: See TracChangeset
for help on using the changeset viewer.