summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@robocracy.org>2019-05-21 17:33:58 -0700
committerBryan Newbold <bnewbold@robocracy.org>2019-05-21 17:33:58 -0700
commit76d9a8437a895860ca22f771ded73b5a18ba31e5 (patch)
treef3d3fad1764ad6e4bc8b27a33541e78f3e0c8c70
parent818a891a5e306e84e8165dec28cc4a5961180e8c (diff)
downloadfatcat-76d9a8437a895860ca22f771ded73b5a18ba31e5.tar.gz
fatcat-76d9a8437a895860ca22f771ded73b5a18ba31e5.zip
importers: create containers by default
-rw-r--r--python/fatcat_tools/importers/crossref.py3
-rw-r--r--python/fatcat_tools/importers/jalc.py4
-rw-r--r--python/fatcat_tools/importers/jstor.py2
-rw-r--r--python/fatcat_tools/importers/pubmed.py3
4 files changed, 8 insertions, 4 deletions
diff --git a/python/fatcat_tools/importers/crossref.py b/python/fatcat_tools/importers/crossref.py
index 311cbc52..162bff6c 100644
--- a/python/fatcat_tools/importers/crossref.py
+++ b/python/fatcat_tools/importers/crossref.py
@@ -120,7 +120,7 @@ class CrossrefImporter(EntityImporter):
editgroup_extra=eg_extra,
**kwargs)
- self.create_containers = kwargs.get('create_containers')
+ self.create_containers = kwargs.get('create_containers', True)
extid_map_file = kwargs.get('extid_map_file')
self.extid_map_db = None
if extid_map_file:
@@ -246,6 +246,7 @@ class CrossrefImporter(EntityImporter):
name=clean(obj['container-title'][0], force_xml=True))
ce_edit = self.create_container(ce)
container_id = ce_edit.ident
+ self._issnl_id_map[issnl] = container_id
# license slug
license_slug = None
diff --git a/python/fatcat_tools/importers/jalc.py b/python/fatcat_tools/importers/jalc.py
index e2ccb230..0a6a69bf 100644
--- a/python/fatcat_tools/importers/jalc.py
+++ b/python/fatcat_tools/importers/jalc.py
@@ -30,7 +30,7 @@ class JalcImporter(EntityImporter):
editgroup_extra=eg_extra,
**kwargs)
- self.create_containers = kwargs.get('create_containers')
+ self.create_containers = kwargs.get('create_containers', True)
extid_map_file = kwargs.get('extid_map_file')
self.extid_map_db = None
if extid_map_file:
@@ -217,6 +217,8 @@ class JalcImporter(EntityImporter):
extra=(container_extra or None))
ce_edit = self.create_container(ce)
container_id = ce_edit.ident
+ # short-cut future imports in same batch
+ self._issnl_id_map[issnl] = container_id
# the vast majority of works are in japanese
# TODO: any indication when *not* in japanese?
diff --git a/python/fatcat_tools/importers/jstor.py b/python/fatcat_tools/importers/jstor.py
index d8f0463e..3ffa12de 100644
--- a/python/fatcat_tools/importers/jstor.py
+++ b/python/fatcat_tools/importers/jstor.py
@@ -34,7 +34,7 @@ class JstorImporter(EntityImporter):
editgroup_extra=eg_extra,
**kwargs)
- self.create_containers = kwargs.get('create_containers')
+ self.create_containers = kwargs.get('create_containers', True)
self.read_issn_map_file(issn_map_file)
diff --git a/python/fatcat_tools/importers/pubmed.py b/python/fatcat_tools/importers/pubmed.py
index 7c4e8311..055462b6 100644
--- a/python/fatcat_tools/importers/pubmed.py
+++ b/python/fatcat_tools/importers/pubmed.py
@@ -136,7 +136,7 @@ class PubmedImporter(EntityImporter):
else:
print("Not using external ID map")
- self.create_containers = kwargs.get('create_containers')
+ self.create_containers = kwargs.get('create_containers', True)
self.read_issn_map_file(issn_map_file)
def lookup_ext_ids(self, pmid):
@@ -294,6 +294,7 @@ class PubmedImporter(EntityImporter):
extra=(container_extra or None))
ce_edit = self.create_container(ce)
container_id = ce_edit.ident
+ self._issnl_id_map[issnl] = container_id
ji = journal.JournalIssue
volume = None