Skip to content

boydorr/ResearchSoftwareMetadata.jl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

81 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ResearchSoftwareMetadata

Stable Dev Build Status Coverage DOI ColPrac: Contributor's Guide on Collaborative Practices for Community Packages

Summary

ResearchSoftwareMetadata is a Julia package that provides a crosswalk between Project.toml, codemeta.json, .zenodo.json and the package LICENSE file, giving a consistent way of providing metadata for research software, so that the Julia General Registry, GitHub and Zenodo all pick up the same metadata, following the Research Software MetaData guidelines.

Installation

The package is registered in the General registry so can be built and installed with add. For example:

(@v1.12) pkg> add ResearchSoftwareMetadata
   Resolving package versions...
    Updating `~/.julia/environments/v1.12/Project.toml`
  [58378933] + ResearchSoftwareMetadata v0.3.0
    Updating `~/.julia/environments/v1.12/Manifest.toml`

(@v1.12) pkg>

Usage

First you need to add a small amount of additional metadata into your Project.toml file.

To capture the license you are using and propagate it throughout the metadata files and through your julia code, add an SPDX license identifier to the file:

license = "BSD-2-Clause"

All of the other metadata that this package uses lives in a single [rsmd] table. To supplement the metadata on the authors of the package, add the ORCID for each author and the ROR for the organisation(s) they are affiliated with. You can add as many authors and as much or as little information as you like about each one by adding additional [[rsmd.author_details]] blocks.

[rsmd]

    [[rsmd.author_details]]
    name = "Richard Reeve"
    orcid = "0000-0003-2589-8091"

        [[rsmd.author_details.affiliation]]
        ror = "00vtgdb53"

You can also optionally add a description of the package, keywords associated with it, the software category it belongs to, its repostatus.org development_status, and the DOIs of any publications associated with the package. All of these are propagated into codemeta.json and .zenodo.json, and any values already in codemeta.json but missing from Project.toml will be backfilled into it. Any of these keys found at the top level of Project.toml (the old layout) are automatically migrated into [rsmd]:

[rsmd]
keywords = ["julia", "metadata"]
category = "metadata"
description = "A package that does things"
development_status = "active"
publications = ["10.5281/zenodo.12789179"]

Then, from the root of your package, you can just run a crosswalk:

using Pkg

# Create a new project with ResearchSoftwareMetadata in it
Pkg.activate(; temp = true)
Pkg.add("ResearchSoftwareMetadata")

# Carry out a crosswalk between the different metadata formats
using ResearchSoftwareMetadata
ResearchSoftwareMetadata.crosswalk()

If you want to pass in some additional metadata (the category of the software, or the keywords associated with it, both of which are written back into [rsmd] in Project.toml), or you want to increase the package version during the crosswalk, you can do that as follows:

# Add in additional metadata
ResearchSoftwareMetadata.crosswalk(category = "metadata", keywords = ["julia", "metadata", "research software", "RSMD"])

# Increase version number during crosswalk
ResearchSoftwareMetadata.increase_patch() # Bump patch version (e.g. 0.4.1 -> 0.4.2)
ResearchSoftwareMetadata.increase_minor() # Bump minor version (e.g. 0.4.2 -> 0.5.0)
ResearchSoftwareMetadata.increase_major() # Bump major version (e.g. 0.5.0 -> 1.0.0)

You might also consider reformatting all of your julia code to a consistent format. A .JuliaFormatter.toml file in the package root defines what the formatting standard should be.

Pkg.add("JuliaFormatter")
Pkg.develop("MyPackage")
using JuliaFormatter
using MyPackage
format(MyPackage)

Automated checking

You can also make your package's own test suite check automatically that the metadata crosswalk is clean and the code is well formatted, by copying a few files from this package's test/ directory into your own. See Automated package checks in the documentation for instructions.

About

Research Software Metadata crosswalk code

Resources

License

Stars

1 star

Watchers

1 watching

Forks

Packages

 
 
 

Contributors

Languages