-
-
Notifications
You must be signed in to change notification settings - Fork 538
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
Added support for parsing citation.cff files #3625
base: develop
Are you sure you want to change the base?
Added support for parsing citation.cff files #3625
Conversation
Parses citation files containing information about citing software/dataset. Added tests to validate the parser. Added documentation for citation.cff in list of supported package parsers. fixes aboutcode-org#3580 Check comments for mapping of keys between citation.cff and models.py Signed-off-by: Zumitify <sumitpagar123@gmail.com>
cc5d509
to
b3faffb
Compare
Please refer to #3580 (comment) for explanation and mapping between cff file fields and model.py fields. |
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.
@Zumitify Thanks++for the PR! Already looking good and works mostly ok.
See comments below and the comment made in the issue: #3580 (comment) for more details and answers to your questions there.
class CitationHandler(models.DatafileHandler): | ||
datasource_id = 'citation_cff' | ||
default_package_type = 'citation' | ||
path_patterns = ('*/CITATION.cff',) |
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.
Based on https://github.com/search?q=path%3A*.cff&type=Code&ref=advsearch&l=&l=&p=1 these are often also in lowercase and others, and as we do a case-sensitive matching here (should we? 🤔) we would fail on lowercase and others, should specify more cases here.
- citation file format | ||
- CFF | ||
version: 1.1.0 | ||
doi: 10.5281/zenodo.1184077 |
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.
The DOI
is very important here, maybe we should have this in PackageData.extra_data, maybe also date-released
?
repository: https://github.com/citation-file-format/ | ||
repository-artifact: https://rubygems.org/gems/cff | ||
repository-code: https://github.com/citation-file-format/ruby-cff | ||
references: |
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.
Here we have to think if references can be listed as dependencies. See https://github.com/citation-file-format/citation-file-format/blob/main/schema-guide.md#referencing-other-work which does support this. Maybe only for the references with a type: software
?
Also regen the failed tests here: https://dev.azure.com/nexB/scancode-toolkit/_build/results?buildId=12395&view=logs&j=1412dbfa-421a-5a40-8ddf-7073fc46aa19&t=13c90161-2109-5957-f563-a96fefc7d869 |
@AyanSinhaMahapatra Thanks for the response. Let me go over them and I'll try to address your code comments and questions soon. |
@Zumitify gentle ping |
Parses citation files containing information about citing software/dataset.
Added tests to validate the parser.
fixes #3580 Check comments for mapping of keys between citation.cff and models.py
Tasks
Run tests locally to check for errors.
Signed-off-by: Zumitify sumitpagar123@gmail.com