Skip to content

Commit

Permalink
parent-doi: add link to record landing page
Browse files Browse the repository at this point in the history
  • Loading branch information
zzacharo committed Jul 21, 2023
1 parent d8491f0 commit 43cad45
Show file tree
Hide file tree
Showing 6 changed files with 244 additions and 3 deletions.
1 change: 1 addition & 0 deletions invenio_app_rdm/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -647,6 +647,7 @@ def files_rest_permission_factory(obj, action):
"robots": "/robots.txt",
"help_search": "/help/search",
"help_statistics": "/help/statistics",
"help_versioning": "/help/versioning",
"record_search": "/search",
"record_detail": "/records/<pid_value>",
"record_export": "/records/<pid_value>/export/<export_format>",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,17 @@
list_string_values, show_dates, show_detail, show_detail_conference %}

{%- set id_doi = record.pids.get('doi', {}).get('identifier') %}

<div class="sidebar-container">
<h2 class="ui medium top attached header mt-0">{{ _('Details')}}</h2>
<div id="record-details" class="ui segment bottom attached rdm-sidebar">

<dl class="details-list">
{% if id_doi %}
{%- include "invenio_app_rdm/records/details/doi.html" %}
{% endif %}
{%- block record_dois %}
{% if id_doi %}
{%- include "invenio_app_rdm/records/details/doi.html" %}
{% endif %}
{%- endblock record_dois %}
{{ show_detail(_('Resource type'), record.ui.resource_type.title_l10n) if record.ui.resource_type }}
{{ show_detail(_('Publication date'), record.ui.publication_date_l10n) if record.ui.publication_date_l10n }}
{{ show_detail(_('Publisher'), metadata.publisher) if metadata.publisher }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,11 @@ import React, { useEffect, useState } from "react";
import { Grid, Icon, Message, Placeholder, List, Divider } from "semantic-ui-react";
import { i18next } from "@translations/invenio_app_rdm/i18next";
import PropTypes from "prop-types";
import { Trans } from "react-i18next";

const deserializeRecord = (record) => ({
id: record.id,
parent: record.parent,
parent_id: record.parent.id,
publication_date: record.ui.publication_date_l10n_medium,
version: record.ui.version,
Expand Down Expand Up @@ -81,6 +83,7 @@ const PreviewMessage = () => {

export const RecordVersionsList = ({ record, isPreview }) => {
const recordDeserialized = deserializeRecord(record);
const recordParentDOI = recordDeserialized?.parent?.pids?.doi?.identifier;
const recid = recordDeserialized.id;
const [loading, setLoading] = useState(true);
const [currentRecordInResults, setCurrentRecordInResults] = useState(false);
Expand Down Expand Up @@ -152,6 +155,21 @@ export const RecordVersionsList = ({ record, isPreview }) => {
</Grid.Row>
</Grid>
)}
{recordParentDOI && (
<List.Item className="parent-doi pr-0">
<List.Content floated="left">
<Trans>
<p>
<strong>Cite all versions?</strong> You can cite all versions by using
the DOI{" "}
<a href={recordDeserialized.links.parent_doi}>{recordParentDOI}</a>.
This DOI represents all versions, and will always resolve to the latest
one. <a href="/help/versioning">Read more</a>.
</p>
</Trans>
</List.Content>
</List.Item>
)}
</List>
);
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,15 @@
word-wrap: break-word;
font-size: 80%;
}

&.parent-doi:last-child {
border-top: none;
}

&.parent-doi {
margin-top: .5rem;
word-wrap: break-word;
}
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,195 @@
{#
Copyright (C) 2021-2023 CERN.
Copyright (C) 2021 Northwestern University.

Invenio App RDM is free software; you can redistribute it and/or modify it
under the terms of the MIT License; see LICENSE file for more details.
#}
{%- set title = _("FAQ versioning") %}
{%- extends config.BASE_TEMPLATE %}

{%- block page_body %}
<div class="ui two column grid container rel-mt-2">
<div class="ui row">
<div class="ui sixteen wide column">
<h2 id="versioning">DOI versioning</h2>
</div>
<div class="ui eight wide column">
<h5>
<p>What is DOI versioning?</p>
</h5>
<p>DOI versioning allows you to:</p>
<ul>
<li>edit/update the record’s files after they have been published.</li>
<li>cite a specific version of a record.</li>
<li>cite all of versions of a record.</li>
</ul>
<h5>
<p>How does DOI versioning work?</p>
</h5>
<p>
When you publish an upload on Zenodo for the first time, we register two
DOIs:
</p>
<ul>
<li>
a DOI representing the <strong>specific version</strong> of your record.
</li>
<li>
a DOI representing <strong>all of the versions</strong> of your record.
</li>
</ul>
<p>Afterwards, we register a DOI for every new version of your upload.</p>
<p>
This is best illustrated by an example of a software package. If the
software has been released in two versions (v1.0 and v1.1) on Zenodo, then
the following DOIs would have been registered:
</p>
<ul>
<li><strong>v1.0 (specific version):</strong> 10.5281/zenodo.60943</li>
<li><strong>v1.1 (specific version):</strong> 10.5281/zenodo.800648</li>
<li><strong>Concept (all versions):</strong> 10.5281/zenodo.705645</li>
</ul>
<p>
The first two DOIs for versions <strong>v1.0</strong> and
<strong>v.1.1</strong> represent the specific versions of the software.
The last DOI represents all the versions of the given software package,
i.e. the concept of the software package and the ensemble of versions. We
therefore also call the them <strong>Version DOIs</strong> and
<strong>Concept DOIs</strong> (note, technically both are just normal
DOIs).
</p>
<p>
You may notice that the version DOIs do not include a “.v1”-suffix. Read
below to find out why.
</p>
<h5>
<p>Which DOI should I use in citations?</p>
</h5>
<p>
You should normally always use the DOI for the
<strong>specific version</strong> of your record in citations. This is to
ensure that other researchers can access the
<strong>exact</strong> research artefact you used for reproducibility. By
default, Zenodo uses the specific version to generate citations.
</p>
<p>
You can use the Concept DOI representing all versions in citations when it
is desirable to cite an evolving research artifact, without being specific
about the version.
</p>
<h5>
<p>Where does the Concept DOI resolve to?</p>
</h5>
<p>
Currently the Concept DOI resolves to the landing page of the latest
version of your record. This is not fully correct, and in the future we
will change this to create a landing page specifically representing the
concept behind the record and all of its versions.
</p>
<h5>
<p>Do you support versioning for already existing records?</p>
</h5>
<p>
Yes. However, for uploads published before the 30th of May 2017, you have
to first upgrade your record to support versioning. This is done by
clicking the “Upgrade to versioned record” button on the record page.
</p>
<p>
IMPORTANT If you have previously uploaded multiple versions of an upload
as individual records on Zenodo, then DO NOT click the button to upgrade
your record with versioning support. Please
<a href="https://zenodo.org/support">contact us</a> so we can link the
records under one versioning scheme.
</p>
<p>
Clicking the “Upgrade to versioned record” button on any of the records
you would like to link, will irreversibly register them as
individually-versioned records.
</p>
<p>
If you used the GitHub integration to archive your software on Zenodo,
then we have already migrated and linked your records to support
versioning.
</p>
</div>
<div class="ui eight wide column">
<h5>
<p>
I only want to change the title of my upload, do I still get a new DOI?
</p>
</h5>
<p>
No, as before you can continue to edit the metadata of your upload without
creating a new version of a record. You should only create a new version
if you want to update the files of your record.
</p>

<h5>
<p>Why don’t the DOIs have a version number suffix like “.v1”?</p>
</h5>
<p>
Including semantic information such as the version number in a DOI is bad
practice, because this information may change over time, while DOIs must
remain persistent and should not change.
</p>
<p>
Moreover, Zenodo DOI versioning is linear, which means that the Zenodo
version number may in fact not be the real version number of the resource.
Take for instance software, where it is common practice to have dot
versions and make new releases in a non-linear order (e.g. first v1.0,
then v1.1, then v2.0, then v1.2).
</p>
<p>
The versioning suffix is also not a functionality of the DOI system, i.e.
adding .v2 to DOI will not resolve to version 2 of a resource for any DOI
from any provider. Different providers also use different patterns such as
e.g. .v2, .2, /2.
</p>
<p>
Most importantly, version suffixes are not machine readable. A discovery
system that understands DOIs, will not know that .v1 and .v2 of a DOI are
in fact two versions of the same resource.
</p>
<p>
A better solution to this problem is to semantically link two DOIs in the
metadata of a DOI. This ensures that discovery systems have a
machine-readable way to discover that two DOIs are versions of the same
resource.
</p>
<p>
See also <a href="https://doi.org/10.5438/55E5-T5C0">Cool DOIs</a> blog
post by Martin Fenner, DataCite Technical Director.
</p>

<h5>
<p>Why do you include “zenodo” in the DOI?</p>
</h5>
<p>
Currently DOIs registered by Zenodo follows the pattern
“10.5281/zenodo.<integer
>” where 10.5281 is the Zenodo DOI prefix and
<integer>
is a sequentially assigned integer. The word “zenodo” is semantic
information, and as mentioned in the previous question it is a bad
idea to include semantic information in DOIs as it may change over
time. The current practice was introduced when Zenodo was launched in
May 2013, and while it is not ideal we did not want to change the
existing practice.</integer
></integer
>
</p>

<h5>
<p>Do you duplicate all the files for every new version of a record?</p>
</h5>
<p>
No, if you change a 10kb README file in 50GB dataset we do not duplicate
the entire 50GB dataset. Invenio v3, the underlying digital repository
platform that powers Zenodo, efficiently handles the file storage so we
only store the new extra 10kb.
</p>
</div>
</div>
</div>
{% endblock page_body %}
15 changes: 15 additions & 0 deletions invenio_app_rdm/theme/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ def create_blueprint(app):
blueprint.add_url_rule(
**create_url_rule(routes["help_statistics"], default_view_func=help_statistics)
)
blueprint.add_url_rule(
**create_url_rule(routes["help_versioning"], default_view_func=help_versioning)
)

@blueprint.before_app_first_request
def init_menu():
Expand Down Expand Up @@ -115,6 +118,18 @@ def help_statistics():
)


def help_versioning():
"""DOI versioning help guide."""
# Default to rendering english page if locale page not found.
locale = get_locale()
return render_template(
[
f"invenio_app_rdm/help/versioning.{locale}.html",
"invenio_app_rdm/help/versioning.en.html",
]
)


def notification_settings():
"""View for notification settings."""
preferences_notifications_form = NotificationsForm(
Expand Down

0 comments on commit 43cad45

Please sign in to comment.