Skip to content

feat(docmaps): generate docmap when publishing

Ben Whitmore requested to merge docmaps-20221123 into main

If a docmap-scheme json file (which is a kind of template) is supplied, then a docmap step runs when any manuscript is published.

The docmap-scheme file specifies what outputs get generated and for which platforms. Currently platforms other than 'hypothesis' are ignored.

Specifying a 'hypothesis' output actually results in two outputs being generated: the desired content/fields are published as a hypothesis annotation, and the same content is also made available as a published artifact accessible from the frontpage. Both these outputs are stored in a docmap in the DB.

A docmap can then be retrieved using a public graphql endpoint, by passing in the original preprint's URI as the key.

The expected use case is:

  1. A manuscripts in kotahi is published, resulting in a) hypothesis annotations, b) artifact pages accessible from the frontpage and c) a docmap.
  2. Sciety harvests hypothesis annotations
  3. Sciety queries kotahi's docmap endpoint, passing the preprint's original URI as the key
  4. Sciety receive the docmap, which gives them information they need, such as who wrote a review

I don't believe at this point that the artifact pages are actually needed by Sciety.

I have also fixed -- indeed, substantially rebuilt -- the broken system for supplying evaluation pages for DOIs to link to. This was needed when publishing evaluations to Crossref, and it caused simple evaluation pages to be created, accessible from the frontpage. I extended this behaviour to also create these pages when you publish hypothesis annotations. I've deprecated the evaluationsHypothesisMap structure (but left it in the DB in case rollback is needed) and replaced it with a publishedArtifacts table.

Edited by Ben Whitmore

Merge request reports