elifesciences / elife-crossref-xml-generation

Crossref deposit of journal articles
MIT License
4 stars 3 forks source link

Support for structured abstracts #89

Closed gnott closed 4 years ago

gnott commented 4 years ago

Re issue https://github.com/elifesciences/issues/issues/5743

To support parsing and depositing of structured abstracts to Crossref -- abstracts which have <sec> tags in them -- this PR includes code to enhance these type of deposits.

Versions of the elifetools and elifearticle libraries used here make it possible to extract an article XML's abstract in XML format, and an Article object's abstract_xml property is set to this value.

The existing logic for transforming a JATS abstract to a Crossref abstract is moved to a new code module. It is expanded to clean and convert any <sec> and <title> tags.

In the existing test cases based on article XML fixtures, there are two altered as a result of this:

There's not too much more to be done, since this is feature complete and the tests are passing. Merging and deploying can wait for a couple final questions posed to stakeholders.

coveralls commented 4 years ago

Coverage Status

Coverage remained the same at 100.0% when pulling 79c6e7a700b93dd243cb6853e2271342c514a629 on abstract into fb156c84d324eb737a0b554ae5b67bb201fe68e0 on develop.

gnott commented 4 years ago

Most recent commit also has a side-effect of including more tag attributes in abstract tags that were previously not included. It will also add appropriate XML namespaces to to the <jats:abstract> tag for (hopefully) easier parsing if the XML snippet is used from the Crossref API (assuming Crossref keeps the namespace attributes after it is ingested).