CSL-JSON support plans?

A place for users to ask each other questions, make suggestions, and discuss Bookends.
Post Reply
fhap13
Posts: 5
Joined: Mon Apr 23, 2012 10:37 pm

CSL-JSON support plans?

Post by fhap13 »

Hello,
what are plans to possibly include CSL-JSON (https://citationstyles.org) support in Bookends. There's an interesting tool to connect a reference manager with Obsidian that I'd like to implement in future projects (https://github.com/hans/obsidian-citation-plugin).

Thanks in advance,
Francis
Jon
Site Admin
Posts: 10071
Joined: Tue Jul 13, 2004 6:27 pm
Location: Bethesda, MD
Contact:

Re: CSL-JSON support plans?

Post by Jon »

No, we don't use CSL.

Jon
Sonny Software
iandol
Posts: 465
Joined: Fri Jan 25, 2008 2:31 pm

Re: CSL-JSON support plans?

Post by iandol »

fhap13 wrote: Sun Dec 13, 2020 2:12 pm what are plans to possibly include CSL-JSON (https://citationstyles.org) support in Bookends. There's an interesting tool to connect a reference manager with Obsidian that I'd like to implement in future projects (https://github.com/hans/obsidian-citation-plugin).
I export to BibTeX (which Bookends does support), then use Pandoc to auto-convert to CSL-JSON (Pandoc can convert several bibliography formats). That will get you a mirror of your Bookends Database in CSL-JSON format.

The annoyance is that as Bookends cannot keep its database synced to a BibTeX file, you have to do this manually. This can be automated using Applescript, but Applescript BibTeX export is incredibly slow, currently my 7400 references takes ~30mins to export, and due to a memory leak somewhere inflates memory. Manual export (File > Export References (Hits)…), is much quicker, no memory leak, but is hard to automate.

But can't you get much of the benefits of this plugin using Bookend's floating citations and a couple of text snippets?

---

Note to Jon: CSL-JSON is a JSON representation of references themselves (like RIS, BibTeX etc.), separable from the associated machinery of converting to formatted references. I'm not sure if Bookends Formats Manager cold be made to generate JSON style references? JSON doesn't care about whitespace (you use JSON already for Preferences of course), but it does require proper wrapping of all contents within [] (I can't see how to do that), and entries in {} with commas except for the last entry (somewhat like BibTeX actually), and at least separate names to be parsed for family and first?

Example BibLaTeX

Code: Select all

@article{lisitsyn2020,
author = {Lisitsyn, Dmitriy and Grothe, Iris and Kreiter, Andreas K. and Ernst, Udo A.},
title = {Visual Stimulus Content in {V4} Is Conveyed by Gamma-Rhythmic Information Packages},
journaltitle = {The Journal of Neuroscience},
volume = {40},
number = {50},
pages = {9650},
date = {2020},
doi = {10.1523/JNEUROSCI.0689-20.2020} }
Equivalent CSL-JSON:

Code: Select all

[{
  "DOI": "10.1523/JNEUROSCI.0689-20.2020",
  "author": [{"family": "Lisitsyn","given": "Dmitriy"},{"family": "Grothe","given": "Iris"},{"family": "Kreiter","given": "Andreas K."},{"family": "Ernst","given": "Udo A."}],
  "container-title": "The Journal of Neuroscience",
  "id": "lisitsyn2020",
  "issue": "50",
  "issued": {"date-parts": [[2020]]},
  "page": "9650",
  "title": "Visual stimulus content in <span class=\"nocase\">V4</span> is conveyed by gamma-rhythmic information packages",
  "type": "article-journal",
  "volume": "40"
}]
Jon
Site Admin
Posts: 10071
Joined: Tue Jul 13, 2004 6:27 pm
Location: Bethesda, MD
Contact:

Re: CSL-JSON support plans?

Post by Jon »

It might be tedious to create, but I don't see why Bookends can't output square brackets were needed. The formatted could output surname only, but there is no way to output just the first name (there is no need for such a thing when formatting references).

Jon
Sonny Software
fhap13
Posts: 5
Joined: Mon Apr 23, 2012 10:37 pm

Re: CSL-JSON support plans?

Post by fhap13 »

iandol wrote: Sun Dec 13, 2020 8:07 pm
fhap13 wrote: Sun Dec 13, 2020 2:12 pm what are plans to possibly include CSL-JSON (https://citationstyles.org) support in Bookends. There's an interesting tool to connect a reference manager with Obsidian that I'd like to implement in future projects (https://github.com/hans/obsidian-citation-plugin).
I export to BibTeX (which Bookends does support), then use Pandoc to auto-convert to CSL-JSON (Pandoc can convert several bibliography formats). That will get you a mirror of your Bookends Database in CSL-JSON format.

Thanks. I'll look into this. It's a good way to handle references for some literature analysis and reviews, but working on a project means adding references, so the sync issue is a problem for my workflow...

The annoyance is that as Bookends cannot keep its database synced to a BibTeX file, you have to do this manually. This can be automated using Applescript, but Applescript BibTeX export is incredibly slow, currently my 7400 references takes ~30mins to export, and due to a memory leak somewhere inflates memory. Manual export (File > Export References (Hits)…), is much quicker, no memory leak, but is hard to automate.

Thanks here for these insights.

But can't you get much of the benefits of this plugin using Bookend's floating citations and a couple of text snippets?

I'm not sure I follow. Care to expand?
---

Note to Jon: CSL-JSON is a JSON representation of references themselves (like RIS, BibTeX etc.), separable from the associated machinery of converting to formatted references. I'm not sure if Bookends Formats Manager cold be made to generate JSON style references? JSON doesn't care about whitespace (you use JSON already for Preferences of course), but it does require proper wrapping of all contents within [] (I can't see how to do that), and entries in {} with commas except for the last entry (somewhat like BibTeX actually), and at least separate names to be parsed for family and first?

Example BibLaTeX

Code: Select all

@article{lisitsyn2020,
author = {Lisitsyn, Dmitriy and Grothe, Iris and Kreiter, Andreas K. and Ernst, Udo A.},
title = {Visual Stimulus Content in {V4} Is Conveyed by Gamma-Rhythmic Information Packages},
journaltitle = {The Journal of Neuroscience},
volume = {40},
number = {50},
pages = {9650},
date = {2020},
doi = {10.1523/JNEUROSCI.0689-20.2020} }
Equivalent CSL-JSON:

Code: Select all

[{
  "DOI": "10.1523/JNEUROSCI.0689-20.2020",
  "author": [{"family": "Lisitsyn","given": "Dmitriy"},{"family": "Grothe","given": "Iris"},{"family": "Kreiter","given": "Andreas K."},{"family": "Ernst","given": "Udo A."}],
  "container-title": "The Journal of Neuroscience",
  "id": "lisitsyn2020",
  "issue": "50",
  "issued": {"date-parts": [[2020]]},
  "page": "9650",
  "title": "Visual stimulus content in <span class=\"nocase\">V4</span> is conveyed by gamma-rhythmic information packages",
  "type": "article-journal",
  "volume": "40"
}]
iandol
Posts: 465
Joined: Fri Jan 25, 2008 2:31 pm

Re: CSL-JSON support plans?

Post by iandol »

fhap13 wrote: Mon Dec 14, 2020 4:13 pm Thanks. I'll look into this. It's a good way to handle references for some literature analysis and reviews, but working on a project means adding references, so the sync issue is a problem for my workflow...
Yes, this is an example of why improving the automation of Bookends is worthwhile, allowing Bookends to integrate across many different workflows. Jon has done a super job of getting the Applescript interface set up and useful, and if we can fix some of the issues with exporting large databases then I think automation should be a viable solution to your problem. There is a script that tries to export only differences (i.e. slow on first export then should be faster, I never tried it): viewtopic.php?f=6&t=4920 — maybe it can work for your needs?
fhap13 wrote: Mon Dec 14, 2020 4:13 pm But can't you get much of the benefits of this plugin using Bookend's floating citations and a couple of text snippets?
I'm not sure I follow. Care to expand?
Well, I don't really know what Obsidan is apart from a vague notion of markdown note system, and thus my understanding of the plugin is vaguer still; but all this plugin seems to do is allow you to search through your references and create a note about a reference. Bookends already offers a floating search function to find and insert reference identifiers/formatted refs, and with something like Alfred or TextExpander you could trigger Obsidan with some sort of template text, then call Bookends to insert the reference. If you wanted to be cool you could automate this all via a triggered script (BetterTouchTool, Alfred etc.)
fhap13
Posts: 5
Joined: Mon Apr 23, 2012 10:37 pm

Re: CSL-JSON support plans?

Post by fhap13 »

You wrote:
Well, I don't really know what Obsidan is apart from a vague notion of markdown note system, and thus my understanding of the plugin is vaguer still; but all this plugin seems to do is allow you to search through your references and create a note about a reference. Bookends already offers a floating search function to find and insert reference identifiers/formatted refs, and with something like Alfred or TextExpander you could trigger Obsidan with some sort of template text, then call Bookends to insert the reference. If you wanted to be cool you could automate this all via a triggered script (BetterTouchTool, Alfred etc.)


Obsidian offers a minimal mark-up based (and extended) framework with markdown and linking possibilities. You have the gist for my desire: link texts in Obsidian to references and PDFs in Bookends. Let me expand a bit. For my project-based workflow, I'd like to be able to expand my notes and drafts in Obsidian with links to references in Bookends (and documents in DevonThink Pro, which works already) and be able to move with less friction between these apps to stay focused on creative writing and including other research into my corpus. If Zettelkasten rings a bell, than so be it, but I'm focused more on supporting projects at this point.

I'll try to get to the script and try it, but the end of year 2020 is pretty crazy... Thanks for thoughts and sharing.
drspk
Posts: 7
Joined: Thu Feb 21, 2019 7:16 am

Re: CSL-JSON support plans?

Post by drspk »

I use Hook (www.hookproductivity.com) to add markdown-formatted links from Bookends to my Obsidian notes. The beauty is that these work between desktop and mobile: in iOS, I use 1Writer to manage my Obsidian .md notes and the links automatically open Bookends references.

Between them, Obsidian and Hook are my discoveries of 2020 in terms of software. While it's frustrating that Obsidian is an Electron app and not native, it has transformed my way of working and is supercharged with Hook.
Post Reply