Iqss/7349 2 improve related pub citation entry #9086
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What this PR does / why we need it: Per issue #7349, Google does not like aspects of how we send related publication info. Specifically, the citation key (where we record related pubs) has to be text or a CreativeWork object. For a CreativeWork object, Google expects a name or URL, and we weren't sending either. This PR adds a 'url' if an identifier URL is provided and moves our 'text' entry (the Citation child field) to 'name' which addresses the case where a URL isn't provided. (Nominally the Citation field is neither the name of the CreativeWork or its text contents, but there doesn't appear to be a better option and the Citation should at least include the title along with author/publication info.
Which issue(s) this PR closes:
Closes #7349
Special notes for your reviewer: This is one of ~4 PRs to close the issue
FWIW: For authors, we've added methods that try to provide a URL form for most/all identifier types allowed - something similar could probably be done here to also capture cases where someone has entered type 'doi' and the numeric identifier and the id itself but no url. Currently entries in those fields are not used in creating the schema.org output.
We are also currently sending the URL as an '@id' and as 'identifier', so with the change here we now send the url 3 times (adding a 'url' key). The other two could still be useful so I've left them for now. Conversely, I've removed the 'text' key given that it is not really a valid use (our content doesn't match the definition). Both just judgement calls.
Suggestions on how to test this: Just verify the unit tests run. Can confirm manually by adding a related publication with a Citation and or URL fields and verifying that they show up as the 'url' and 'name'.
Does this PR introduce a user interface change? If mockups are available, please link/include them here:
Is there a release notes update needed for this change?: included
Additional documentation: