diff options
author | Bryan Newbold <bnewbold@robocracy.org> | 2019-05-13 14:23:02 -0700 |
---|---|---|
committer | Bryan Newbold <bnewbold@robocracy.org> | 2019-05-13 14:23:06 -0700 |
commit | 955d4942d5111cbbd8f4b99d4e3c6d79262dab6e (patch) | |
tree | 87757a7afdf00ab6de5ed7455267654bf49b5239 /python/fatcat_tools/transforms | |
parent | 287e892abb4adac8ea7f7211524a41c7cd06851c (diff) | |
download | fatcat-955d4942d5111cbbd8f4b99d4e3c6d79262dab6e.tar.gz fatcat-955d4942d5111cbbd8f4b99d4e3c6d79262dab6e.zip |
partial python impl of ext_id and release_stage refactors
Diffstat (limited to 'python/fatcat_tools/transforms')
-rw-r--r-- | python/fatcat_tools/transforms/csl.py | 8 | ||||
-rw-r--r-- | python/fatcat_tools/transforms/elasticsearch.py | 21 |
2 files changed, 15 insertions, 14 deletions
diff --git a/python/fatcat_tools/transforms/csl.py b/python/fatcat_tools/transforms/csl.py index 7bc026ed..079e0501 100644 --- a/python/fatcat_tools/transforms/csl.py +++ b/python/fatcat_tools/transforms/csl.py @@ -109,13 +109,13 @@ def release_to_csl(entity): container_title=entity.container and entity.container.name, #container-title-short #dimensions - DOI=entity.doi, + DOI=entity.ext_ids.doi, #edition #event #event-place #first-reference-note-number #genre - ISBN=entity.isbn13, + ISBN=entity.ext_ids.isbn13, ISSN=entity.container and entity.container.issnl, issue=entity.issue, #jurisdiction @@ -131,8 +131,8 @@ def release_to_csl(entity): #original-title # TODO: page=entity.pages, page_first=entity.pages and entity.pages.split('-')[0], - PMCID=entity.pmcid, - PMID=entity.pmid, + PMCID=entity.ext_ids.pmcid, + PMID=entity.ext_ids.pmid, publisher=(entity.container and entity.container.publisher) or entity.publisher, #publisher-place #references diff --git a/python/fatcat_tools/transforms/elasticsearch.py b/python/fatcat_tools/transforms/elasticsearch.py index 73ac046e..971d1c11 100644 --- a/python/fatcat_tools/transforms/elasticsearch.py +++ b/python/fatcat_tools/transforms/elasticsearch.py @@ -45,17 +45,18 @@ def release_to_elasticsearch(entity, force_bool=True): title = release.title, original_title = release.original_title, release_type = release.release_type, - release_status = release.release_status, + release_status = release.release_stage, language = release.language, license = release.license_slug, - doi = release.doi, - pmid = release.pmid, - pmcid = release.pmcid, - isbn13 = release.isbn13, - wikidata_qid = release.wikidata_qid, - core_id = release.core_id, - arxiv_id = release.core_id, - jstor_id = release.jstor_id, + doi = release.ext_ids.doi, + pmid = release.ext_ids.pmid, + pmcid = release.ext_ids.pmcid, + isbn13 = release.ext_ids.isbn13, + wikidata_qid = release.ext_ids.wikidata_qid, + core_id = release.ext_ids.core, + arxiv_id = release.ext_ids.arxiv, + jstor_id = release.ext_ids.jstor, + # TODO: mag, ark ) is_oa = None @@ -121,7 +122,7 @@ def release_to_elasticsearch(entity, force_bool=True): else: t['publisher'] = release.publisher - if release.jstor_id or (release.doi and release.doi.startswith('10.2307/')): + if release.ext_ids.jstor or (release.ext_ids.doi and release.ext_ids.doi.startswith('10.2307/')): in_jstor = True files = release.files or [] |