Comments (12)
Do you have a specific JSON standard for bib data in mind? It's not that difficult to add an output option for JSON and I've considered it before but I was never sure how useful that would be if it's not some format that something expected.
from biber.
@plk thanks for your reply. I have found this standard.
from biber.
This looks interesting. @moewew - I wonder if we might just drop biblatexml
as a format and use this instead as it has independent support?
from biber.
There is also CSL-JSON, which might be interesting for interoperability with CSL styles: https://github.com/citation-style-language/schema#csl-json-schema. Not sure how different that is from bibjson.
Question is if we can map everything Biber does with .bib
files (field annotations and friends) to this JSON format.
biblatexml
and bblxml
(is that the same thing?) don't appear to be used all that often, so I don't have any reservations against removing it, if that makes things easier. (In a Google search I only found references to the implementation and the documentation and no indication that people actually use it.)
from biber.
I'll have a look at CSL-JSON. BibJSON has no fixed schema so we can basically do anything we want but then again having no fixed schema means it's of more limited use.
from biber.
Have a look at this - I have implemented a bibjson
output format using a schema based on the biblatexml
schema. See how this looks. It will be possible to output a JSON schema for this as an option when outputting to bibjson. I would probably look at implementing CSL-JSON format instead of or in addition to this, depending on what we decide. CSL-JSON is more restricted as it doesn't allow for some things that biber
can do, like arbitrary name parts, annotations, etc.
https://gist.github.com/plk/99cdd0379da2c2b53f110bcb6e2a3430
from biber.
Digging around a bit, it looks like bibjson
isn't much used and CSL-JSON might be the best choice. It does mean that arbitrary biber
.bib
files won't work as its schema is fixed but I'm not sure what use a custom schema solution would be anyway as it won't be interoperable with anything.
from biber.
@plk Thanks, the sample JSON file look great to me. My initial idea for this feature was to simply map each key/value pair in the bibtex file to a key/value pair in the JSON file, and the implementation would look like this (in pseudocode):
import json_module
convert_to_json(internal_variable_holding_bibliographic_data)
This way, the user would know which keys they should expect in the JSON output just by reading biblatex's documentation.
As you point out though, this solution would create an additional, noninteroperable "standard".
Another option might be to adopt the CSL-JSON standard, but the manual should warn the user that the conversion from bibtex to JSON could be "lossy", depending on the input file.
What do you think?
from biber.
I think probably CSL-JSON is a better choice as any custom JSON won't have any parser for its schema without someone writing one which makes the use-case extremely niche and we already have a completely customisable output format with biblatexml
which also writes the accompanying schema. The only real use-case I can see for bibjson
is that it would replace biblatexml
but I'm not convinced about that as you sacrifice some things with JSON compared with XML (attributes vs content is a nice distinction in XML that makes it easier for humans to read and the speed of JSON parsing isn't really much of an issue in batch bibliography operations). I knocked up a bibjson
example just because it's quicker as there are no schema requirements.
from biber.
@plk then I'm ok with biber using CSL-JSON as its JSON output format.
from biber.
I've had a look at this and from experience implementing things like RIS, Endnote and some other JSON output formats in the past (now all deprecated due to lack of use), I'm not sure this is a good idea. The mapping from CSL-JSON to biblatex
types and fields is messy and to make any sense at all, it would have to be modifiable by the user and include contextual, dynamic elements. This is not trivial to implement and maintain. Keeping this sort of thing in sync with changes in CSL-JSON data schemata etc. is too much to track for little gain. This sort of "glue" interface between different data models is basically of limited use in general and only works for generic entries. We do have the "biblatexml" output format which could be programatically changed into some sort of JSON output, depending on the use case but a general transformation from the internal data model is just too messy to be of much use to a wide enough audience I suspect. I'm not sure even what use a generic json output format is since this would have to be modified for any reasonable use case and you might as well just parse the biblatexml output.
from biber.
I see. Thanks for taking the time to discuss this feature request.
from biber.
Related Issues (20)
- How does Biber finds its files HOT 5
- calling biber throws error: Couldn't load any math lib(s), not even fallback to Calc.pm HOT 3
- Still add whatis entries HOT 1
- Biber parsing problem with abstracts and the = symbol HOT 1
- Integration of @set entry type in Biblist? HOT 8
- Biber crashes on MacOS 12.6.8/MacTex-2023 HOT 12
- missing multiscript.bltxml in CTAN biber-ms package HOT 2
- biber-linux_aarch64: providing a regular contribution HOT 4
- biber 2.17 biber-darwin_x86_64.tar.gz is missing HOT 2
- single datafieldset in config file gives "Not an ARRAY reference" error HOT 3
- Typo in `biber` HOT 2
- wrap lines in tool mode HOT 16
- Typo in PDF doku HOT 2
- libnsl.so.1missing since Fedora 28 HOT 8
- GitHub Actions for building/testing biber fails HOT 10
- Successful compilation of Biber on OpenBSD 7.4 using perlbrew
- Biber 2.20 error HOT 14
- biber 2.20 musl binaries HOT 2
- « Wide character in die at -e line 624 » with some Unicode characters in outdir’s path HOT 10
- biber 2.20 is not available in TeXLive x86_64-linuxmusl HOT 14
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from biber.