Skip to content

Commit

Permalink
Merge pull request #2119 from MIT-LCP/doi-is-derived-from
Browse files Browse the repository at this point in the history
Add "IsDerivedFrom" to DOI metadata
  • Loading branch information
tompollard authored Oct 24, 2023
2 parents 76ed4ff + a302aa1 commit 2f80538
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions physionet-django/console/utility.py
Original file line number Diff line number Diff line change
Expand Up @@ -516,6 +516,24 @@ def generate_doi_payload(project, core_project=False, event="draft"):
else:
relation = []

# projects from which this project is derived
for parent_project in project.parent_projects.all():
if parent_project.doi:
relation.append({
"relationType": "IsDerivedFrom",
"relatedIdentifier": parent_project.doi,
"relatedIdentifierType": "DOI",
})
else:
url = "https://{0}{1}".format(current_site, reverse(
'published_project',
args=(parent_project.slug, parent_project.version)))
relation.append({
"relationType": "IsDerivedFrom",
"relatedIdentifier": url,
"relatedIdentifierType": "URL",
})

resource_type = 'Dataset'
if project.resource_type.name == 'Software':
resource_type = 'Software'
Expand Down

0 comments on commit 2f80538

Please sign in to comment.