- tr = tr.findNext()
- TypeN = rdfsNS['type']
- NameN = submissionOntology['name']
- SpeciesN = submissionOntology['species']
- LibraryURN = submissionOntology['library_urn']
-
- while tr is not None:
- td = tr.findAll('td')
- if td is not None and len(td) > 1:
- subUrnText = td[0].contents[0].contents[0].encode(CHARSET)
- subUrn = RDF.Uri(submission_view_url(subUrnText))
-
- add_stmt(model, subUrn, TypeN, submissionOntology['Submission'])
-
- name = get_contents(td[4])
- add_stmt(model, subUrn, NameN, name)
-
- species = get_contents(td[2])
- if species is not None:
- add_stmt(model, subUrn, SpeciesN, species)
-
- library_id = get_library_id(name)
- if library_id is not None:
- add_submission_to_library_urn(model,
- subUrn,
- LibraryURN,
- library_id)
-
- add_submission_creation_date(model, subUrn, cookie)
-
- # grab changing atttributes
- status = get_contents(td[6]).strip()
- last_mod_datetime = get_date_contents(td[8])
- last_mod = last_mod_datetime.isoformat()
-
- update_submission_detail(model, subUrn, status, last_mod, cookie=cookie)
-
- logging.info("Processed {0}".format( subUrn))
-
- tr = tr.findNext('tr')
+ table_row = table_row.findNext()
+ name_n = submissionOntology['name']
+ species_n = submissionOntology['species']
+ library_urn = submissionOntology['library_urn']
+
+ while table_row is not None:
+ cell = table_row.findAll('td')
+ if cell is not None and len(cell) > 1:
+ submission_id = cell[0].contents[0].contents[0].encode(CHARSET)
+ if limit is None or submission_id in limit:
+ subUrn = RDF.Uri(submission_view_url(submission_id))
+
+ add_stmt(model, subUrn, TYPE_N, submissionOntology['Submission'])
+
+ name = get_contents(cell[4])
+ add_stmt(model, subUrn, name_n, name)
+
+ species = get_contents(cell[2])
+ if species is not None:
+ add_stmt(model, subUrn, species_n, species)
+
+ library_id = get_library_id(name)
+ if library_id is not None:
+ add_submission_to_library_urn(model,
+ subUrn,
+ library_urn,
+ library_id)
+
+ add_submission_creation_date(model, subUrn, cookie)
+
+ # grab changing atttributes
+ status = get_contents(cell[6]).strip()
+ last_mod_datetime = get_date_contents(cell[8])
+ last_mod = last_mod_datetime.isoformat()
+
+ update_submission_detail(model, subUrn, status, last_mod,
+ cookie=cookie)
+
+ logging.info("Processed {0}".format(subUrn))
+
+ table_row = table_row.findNext('tr')