aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@archive.org>2020-06-23 18:38:09 -0700
committerBryan Newbold <bnewbold@archive.org>2020-06-23 18:38:09 -0700
commit73197cc91df821ee5ad36ac553b239c4467b793c (patch)
treec0b71fdf9edad46afae3f0adcc6b3ab1d2e0f4c8
parent2ad4ad111c67dd5c3c9f91a3b2cd56325a7022d6 (diff)
downloadchocula-73197cc91df821ee5ad36ac553b239c4467b793c.tar.gz
chocula-73197cc91df821ee5ad36ac553b239c4467b793c.zip
fix issn_meta country detection
-rw-r--r--chocula/directories/issn_meta.py13
1 files changed, 8 insertions, 5 deletions
diff --git a/chocula/directories/issn_meta.py b/chocula/directories/issn_meta.py
index 23b2fed..4416125 100644
--- a/chocula/directories/issn_meta.py
+++ b/chocula/directories/issn_meta.py
@@ -32,12 +32,15 @@ class IssnMetaLoader(DirectoryLoader):
info = DirectoryInfo(directory_slug=self.source_slug,)
# format is an array of metadata elements
for el in row:
- if (
- "value" in el
- and el["@id"].startswith("http://id.loc.gov/vocabulary/countries")
- and len(el["@id"].split("/")[-1]) == 2
+ if "label" in el and el["@id"].startswith(
+ "http://id.loc.gov/vocabulary/countries"
):
- info.country = parse_country(el["value"])
+ value = el["label"]
+ if "(State)" in value:
+ value = ""
+ if value == "Russia (Federation)":
+ value = "Russia"
+ info.country = parse_country(el["label"])
if not "@type" in el:
continue
if el["@type"] == "http://id.loc.gov/ontologies/bibframe/IssnL":