Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Map Contributor Roles to Citations #1972

Merged
merged 28 commits into from May 5, 2022
Merged

Map Contributor Roles to Citations #1972

merged 28 commits into from May 5, 2022

Conversation

qweliant
Copy link
Collaborator

@qweliant qweliant commented Apr 25, 2022

addresses #1972

Putting the mapping here again bc it may be useful

Mapping:

PubPub Role List CSL-JSON HTML Meta Crossref contributor_role
none selected (default) author citation_author author
--- --- --- ---
Illustrator illustrator n/a n/a
--- --- --- ---
Visualization illustrator n/a n/a
--- --- --- ---
Writing - Review & Editing editor citation_editor editor
--- --- --- ---
Editor editor citation_editor editor
--- --- --- ---
Series Editor collection-editor citation_editor editor
--- --- --- ---
Translator translator n/a translator
--- --- --- ---
Chair chair n/a chair

Problems

  • Collection level contributors are listed in the citation
  • The collection level citations should be listed with their roles on the pubs
    • and ONLY if they are contributors with list on byline checked and role filled in
  • Only people at the pub level have roles specified in metadata. This should extend to collection level contributors
  • How do citations get generated?
    • For starters, there are PubAttributions and CollectionAttributions
    • Users list themselves as attributors in the collection or pub dashboard.
    • and a call is made to the API setting each one
    • an onChange function gets passed from AttributionEditor.tsx into AttributionDetailControls.tsx and will persist attributors if isAuthor is checked. this is done in generateCitationHtml.ts
    • if isAuthor and the type is a collection or pub attribution the author will merge into the citation list of authors

Solutions

  • Had to change use of parenthesis on lines 51 to 54 in generateCitationHTML.tsx
  • How do i map roles to citations?
    • query for contributors with matching role field using getAllPubContributorsRoles in generateCitationHTML.tsx and contributors.tsx
  • How to add roles to metadata?
    • include contributors in metadata using contributorRoleTags() found in ssr.tsx if attributions are passed in

Expectations

  • Only collection level contributors with list in byline selected will appear in citations, html-metadata, crossref, exports, and rss feed
    • this means pretty much anywhere getAllPubContributors(...) is used with the exception of PubPreview.tsx, PubOverview.tsx, and PubDetails.tsx
  • Contributors are now listed in crossref deposit preview alongside their roles
    • contributors without list in byline checked will still appear in crossref deposits as a reader
  • If the contributor has a role:
    • the first role they choose will be the role used for citations, crossref, and metadata
    • this role will map according to the table above

image

image

image

image

image

image

Test

  • visit a collection, i used this. be sure it has contributors, one is an editor, some have roles, some have none, and some have multiple roles
  • click list on collection byline for a random number of contributors
  • view the collection preview and be sure the byline has the right contributors
  • view the pub preview and be sure only the list on byline contributors have citation credits
  • view the pub copy citations button and the pub citations in the PubHeader to be sure citations are consistent
  • open up the console and be sure citation_editor tag exists for any editor
  • for any pub in a collection with multiple contributors be sure when generating a crossref deposit that
    • contributors with a role have the correct role mapping in the crossref preview and xml
    • the (primary author? content maker?) idk has the right role listed if they have one

@qweliant qweliant modified the milestone: Cycle 68 Apr 25, 2022
@qweliant qweliant self-assigned this Apr 26, 2022
@qweliant qweliant added the bug label Apr 26, 2022
@qweliant qweliant linked an issue Apr 26, 2022 that may be closed by this pull request
@qweliant qweliant marked this pull request as ready for review April 28, 2022 19:40
@qweliant qweliant changed the title Map Contributor Roles to Citations and Collection Deposits Map Contributor Roles to Citations Apr 30, 2022
Copy link
Member

@gabestein gabestein left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for all the work here! It looks great, with three issues that are probably my mistake in speccing.

  1. If someone is given a role and has the byline checked, they should only be listed in the citation and HTML metadata as that role, not also as an author. (The crossref deposits look correct).

Currently in the Cups example, Dents Harvey, Car and Pru are listed twice in the citation: as authors and Editor, Editor, Translator, respectively. They should only be listed once, as editors/translators.

Existing:
Team, P., Dent, H., Dent, C., & Dent, P. (2022). Cups. In H. Dent & C. Dent (Eds.), P. Dent (Trans.), A Mid Book TBH. KFG Press. Retrieved from http://localhost:9876/pub/cz29l94c

Screen Shot 2022-05-02 at 14 12 07

Expected:
Team, P. (2022). Cups. In H. Dent & C. Dent (Eds.), P. Dent (Trans.), A Mid Book TBH. KFG Press. Retrieved from http://localhost:9876/pub/cz29l94c

The same is true for HTML metadata. Existing:

Screen Shot 2022-05-02 at 14 17 38

Expected:

Screen Shot 2022-05-02 at 14 19 34


  1. The role functionality should also apply to pub-level contributors. That is, if someone at the pub level is listed as an editor, the citation, html metadata, and crossref deposit should list them as an editor, not an author. Currently, these folks are still listed as authors.

  1. We should update the crossref deposit previews to show the contributors we'll now be depositing, at various levels. For example, this preview of the Cups deposit should show all the dents, and their roles, listed in the "Book Metadata" section. I totally missed this in spec! My apologies.

Screen Shot 2022-05-02 at 14 15 34

server/routes/pubDocument.tsx Outdated Show resolved Hide resolved
server/utils/citations/generateCitationHtml.ts Outdated Show resolved Hide resolved
server/utils/ssr.tsx Outdated Show resolved Hide resolved
utils/contributors.ts Show resolved Hide resolved
utils/contributors.ts Outdated Show resolved Hide resolved
utils/crossref/schema/contributors.js Outdated Show resolved Hide resolved
@qweliant qweliant requested review from 3mcd and gabestein May 3, 2022 21:22
@qweliant qweliant marked this pull request as draft May 4, 2022 14:34
@qweliant qweliant marked this pull request as ready for review May 4, 2022 17:59
@qweliant qweliant requested review from gabestein, 3mcd and idreyn May 4, 2022 17:59
Copy link
Member

@gabestein gabestein left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the quick update! I think we're just about there. Three quick things:

  1. If you set one person as an editor at the pub level, it looks like everybody is being treated as an editor in html meta and the citation (Crossref is okaY). What should happen is only the contributors who are actually editors get treated as such. See: http://localhost:9876/pub/cz29l94c/draft

Screen Shot 2022-05-04 at 14 26 44

Screen Shot 2022-05-04 at 14 26 55

Screen Shot 2022-05-04 at 14 27 47

  1. The preview doesn't quite match the XML. The collection-level contributors should be displayed at the collection level, the pub-level contributors at the pub level. Right now all are displayed at the pub level. (The XML is fine, it's just the preview).

Screen Shot 2022-05-04 at 14 28 27

  1. Let's add parentheses around the contributor type, otherwise it looks a bit odd. E.g.:

PubPub Team (editor)

@qweliant
Copy link
Collaborator Author

qweliant commented May 4, 2022

Thanks for the quick update! I think we're just about there. Three quick things:

  1. If you set one person as an editor at the pub level, it looks like everybody is being treated as an editor in html meta and the citation (Crossref is okaY). What should happen is only the contributors who are actually editors get treated as such. See: http://localhost:9876/pub/cz29l94c/draft
Screen Shot 2022-05-04 at 14 26 44 Screen Shot 2022-05-04 at 14 26 55 Screen Shot 2022-05-04 at 14 27 47
  1. The preview doesn't quite match the XML. The collection-level contributors should be displayed at the collection level, the pub-level contributors at the pub level. Right now all are displayed at the pub level. (The XML is fine, it's just the preview).
Screen Shot 2022-05-04 at 14 28 27
  1. Let's add parentheses around the contributor type, otherwise it looks a bit odd. E.g.:

PubPub Team (editor)

I'm gettin the expected behavior for adding an additional author
image

…scious and has dreams and definitely an inner thought processs
@qweliant qweliant requested a review from gabestein May 4, 2022 20:25
@gabestein
Copy link
Member

I'm gettin the expected behavior for adding an additional author

Me too. I must have just forgotten to refresh or something.

Copy link
Member

@gabestein gabestein left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!!

@qweliant qweliant merged commit 1709ecc into master May 5, 2022
@qweliant qweliant deleted the map-contributer-roles branch May 5, 2022 15:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Map contributor role in Pub citations and collection deposits
3 participants