diff --git a/FoxmlWorker.py b/FoxmlWorker.py index 6a76b73..e31ece3 100644 --- a/FoxmlWorker.py +++ b/FoxmlWorker.py @@ -103,7 +103,7 @@ class FWorker: re_nodes = self.root.findall( f'.//foxml:datastream[@ID="RELS-EXT"]/foxml:datastreamVersion/foxml:xmlContent/rdf:RDF', namespaces=self.namespaces) - if re_nodes is None: + if not re_nodes: return re_values re_node = re_nodes[-1] for child in re_node.iter(): diff --git a/ImportServerUtilities.py b/ImportServerUtilities.py index a19e382..adbe653 100644 --- a/ImportServerUtilities.py +++ b/ImportServerUtilities.py @@ -46,9 +46,10 @@ class ImportServerUtilities: # Gets PIDS, filtered by namespace directly from objectStore @IU.ImportUtilities.timeit def get_pids_from_objectstore(self, namespace=''): + namespace = f"info%3Afedora%2F{namespace}%3A" wildcard = '*/*' if namespace: - wildcard = f'*/*{namespace}*' + wildcard = f'*/{namespace}*' pids = [] for p in Path(self.objectStore).rglob(wildcard): pid = unquote(p.name).replace('info:fedora/', '') @@ -158,10 +159,8 @@ class ImportServerUtilities: self.iu.conn.commit() -MS = ImportServerUtilities('island_archives') -tables = ['bdh', 'craipe', 'sdu', 'herbarium', 'islemag', 'leg', 'herbarium', 'islemag', 'pwc', 'peimag', 'lmmi'] -for table in tables: - MS.add_mods_to_database(table) +MS = ImportServerUtilities('climate') +MS.build_record_from_pids('climate', 'outputs/climate_complete.csv')