Skip to content
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

Compile bilbiography for analyses #547

Merged
merged 11 commits into from Apr 30, 2019
Merged

Compile bilbiography for analyses #547

merged 11 commits into from Apr 30, 2019

Conversation

adelavega
Copy link
Collaborator

Closes #543

Looks like CSL is a good JSON standard for citations. In a .json file, I will keep a list of citations, with keys representing either tools, datasets or extractor_names. I don't think there should ever be clashes.
Then, an API endpoint will simply take a base set of tools + the dataset_name + extractor_names in an analysis, and return a CSL-JSON.

We could additionally try using citeproc-py to render a bibliography in APA or other format. However, the python library looks a bit clunky and not actively maintained, so I'm weary of using it. Also, this limits the formats we can provide (as it would require going back and forth, and doing it only on compilation).

Instead, I think its best if we use citations.js, a much more actively developed library, to render / compile the bibliography. This way, users could select a format, and compile it, including BibTex or another common format.

@adelavega adelavega changed the title Compile bilbiography for analyses WIP: Compile bilbiography for analyses Apr 26, 2019
@adelavega
Copy link
Collaborator Author

To add more detail as to how bibliography.json is being populated. Zenodo natively exports to CSL-JSON, which is nice. For papers, I am importing to a local Zotero library, which can then be easily exported to CSL-JSON.

@codecov-io
Copy link

codecov-io commented Apr 26, 2019

Codecov Report

Merging #547 into master will increase coverage by 0.52%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #547      +/-   ##
==========================================
+ Coverage   84.03%   84.56%   +0.52%     
==========================================
  Files          38       39       +1     
  Lines        1616     1671      +55     
==========================================
+ Hits         1358     1413      +55     
  Misses        258      258
Impacted Files Coverage Δ
neuroscout/resources/analysis/__init__.py 100% <ø> (ø) ⬆️
neuroscout/resources/__init__.py 100% <ø> (ø) ⬆️
neuroscout/resources/analysis/schemas.py 97.29% <100%> (+0.19%) ⬆️
neuroscout/resources/analysis/bib.py 100% <100%> (ø)
neuroscout/resources/analysis/endpoints.py 90.57% <100%> (+1.32%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update fbc9e1a...c493401. Read the comment docs.

@adelavega
Copy link
Collaborator Author

adelavega commented Apr 30, 2019

image

This is almost done. @tyarkoni @rwblair what do you think?

Still need to add many more references (most glaringly for extractors). I decided to keep this info out of the db, and simply in a JSON file btw.

Unfortunately, I could not get citation.js to work, so instead the API returns APA formatted strings. That package seems to be in active development, so I'm hopeful in the near future I can instead pass CSL-JSON, which the frontend can then convert on the fly to BibText, and various Text formats.

@adelavega adelavega changed the title WIP: Compile bilbiography for analyses Compile bilbiography for analyses Apr 30, 2019
@adelavega
Copy link
Collaborator Author

I modified bibliography.json so that the second key refers to the feature name for extractors. .* matches all. This is for extractors like the PredefinedDictionary which have features with different references each.

For datasets, and tools, they always have a .* defined, and that is what is always matched.

@tyarkoni
Copy link

Looks great!

@adelavega adelavega merged commit 92e7c7e into master Apr 30, 2019
@adelavega adelavega deleted the enh/citations branch April 30, 2019 21:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Citation reports
3 participants