-
Notifications
You must be signed in to change notification settings - Fork 3
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
Add codemeta.json #30
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
{ | ||
"@context": "https://doi.org/10.5063/schema/codemeta-2.0", | ||
"@type": "SoftwareSourceCode", | ||
"license": "https://spdx.org/licenses/MIT", | ||
"codeRepository": "https://github.com/openMetadataInitiative/openMINDS_MATLAB", | ||
"contIntegration": "https://github.com/openMetadataInitiative/openMINDS_MATLAB/actions", | ||
"issueTracker": "https://github.com/openMetadataInitiative/openMINDS_MATLAB/issues", | ||
"name": "openMINDS MATLAB", | ||
"description": "openMINDS MATLAB is a toolbox to support the creation and use of openMINDS metadata models and schemas in MATLAB, with import and export in JSON-LD format. The package contains all openMINDS schemas as MATLAB classes in addition to schema base classes and utility methods.", | ||
"applicationCategory": "neuroscience", | ||
"releaseNotes": "https://github.com/openMetadataInitiative/openMINDS_MATLAB/releases", | ||
"funding": "https://cordis.europa.eu/project/id/945539", | ||
"developmentStatus": "active", | ||
"funder": { | ||
"@type": "Organization", | ||
"name": "European Commission" | ||
}, | ||
"programmingLanguage": [ | ||
"MATLAB" | ||
], | ||
"operatingSystem": [ | ||
"Linux", | ||
"Windows", | ||
"macOS" | ||
], | ||
"softwareRequirements": [ | ||
"MATLAB R2022b or later" | ||
], | ||
"relatedLink": [ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. instead or in addition you could define isPartOf since this repo is part of the open metadata initiative organisation on github |
||
"https://openminds-documentation.readthedocs.io" | ||
], | ||
"author": [ | ||
{ | ||
"@type": "Person", | ||
"@id": "https://orcid.org/0000-0002-8297-1753", | ||
"givenName": "Eivind", | ||
"familyName": "Hennestad" | ||
} | ||
], | ||
"version": "0.9.3", | ||
"downloadUrl": "https://github.com/openMetadataInitiative/openMINDS_MATLAB/releases/download/v0.9.3/openMINDS_MATLAB_v0_9_3.mltbx", | ||
"dateModified": "2024-10-01" | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. should have an empty line at the end |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
function codeMetaInfo = updateCodeMetaFile(versionString) | ||
|
||
arguments | ||
versionString (1,1) string {mustBeTextScalar, mustBeValidVersionString} | ||
end | ||
|
||
if startsWith(versionString, "v") | ||
versionStringNumeric = extractAfter(versionString, 1); | ||
else | ||
error('Expected versionString to start with "v"') | ||
end | ||
|
||
projectRootDirectory = ommtools.projectdir(); | ||
|
||
codeMetaFilePath = fullfile(projectRootDirectory, 'codemeta.json'); | ||
codeMetaInfo = jsondecode( fileread(codeMetaFilePath) ); | ||
|
||
codeMetaInfo.version = versionStringNumeric; | ||
codeMetaInfo.downloadUrl = sprintf("https://github.com/openMetadataInitiative/openMINDS_MATLAB/releases/download/%s/openMINDS_MATLAB_%s.mltbx", ... | ||
versionString, strrep(versionString, '.', '_')); | ||
codeMetaInfo.dateModified = string(datetime('today', 'Format', 'yyyy-MM-dd')); | ||
|
||
jsonStr = jsonencode(codeMetaInfo, 'PrettyPrint', true); | ||
|
||
% Fix json-ld @props | ||
jsonStr = strrep(jsonStr, 'x_context', '@context'); | ||
jsonStr = strrep(jsonStr, 'x_type', '@type'); | ||
jsonStr = strrep(jsonStr, 'x_id', '@id'); | ||
|
||
fid = fopen(codeMetaFilePath, 'wt'); | ||
fwrite(fid, jsonStr); | ||
fclose(fid); | ||
end | ||
|
||
function mustBeValidVersionString(versionString) | ||
pattern = 'v\d+\.\d+\.\d+'; | ||
assert( ~ismissing( regexp(versionString, pattern, 'match', 'once')), 'Invalid version string. Must be formatted as v<major>.<minor>.<patch>' ) | ||
end | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. should have an empty line at the end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I assume that this is not enough (depending on the version). Right now you would receive funding through EBRAINS 2.0 I guess?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should this not be an array? with funder inside? not sure how codemeta handles this...