larsgw / citation.js

Citation.js converts formats like BibTeX, Wikidata JSON and ContentMine JSON to CSL-JSON to convert to other formats like APA, Vancouver and back to BibTeX.
https://citation.js.org/
MIT License
219 stars 30 forks source link

[format BibTeX] proceedings-article from crossref data all formated to @misc #210

Closed ntutangyun closed 3 years ago

ntutangyun commented 3 years ago

Hi,

I've encountered this issue where I wish to generate bibTeX format string, from json data returned from crossRef API.

However, all the entires are formated with @misc, even for those with type: "proceedings-article".

Test sample:

{"indexed":{"date-parts":[[2021,1,12]],"date-time":"2021-01-12T21:45:07Z","timestamp":1610487907923},"reference-count":0,"publisher":"IEEE","isbn-type":[{"value":"9781538644522","type":"electronic"}],"content-domain":{"domain":[],"crossmark-restriction":false},"published-print":{"date-parts":[[2018,6]]},"DOI":"10.1109/ivs.2018.8500632","type":"proceedings-article","created":{"date-parts":[[2018,10,23]],"date-time":"2018-10-23T00:56:23Z","timestamp":1540256183000},"source":"Crossref","is-referenced-by-count":48,"title":["Ontology based Scene Creation for the Development of Automated Vehicles"],"prefix":"10.1109","author":[{"given":"Gerrit","family":"Bagschik","sequence":"first","affiliation":[]},{"given":"Till","family":"Menzel","sequence":"additional","affiliation":[]},{"given":"Markus","family":"Maurer","sequence":"additional","affiliation":[]}],"member":"263","event":{"name":"2018 IEEE Intelligent Vehicles Symposium (IV)","location":"Changshu","start":{"date-parts":[[2018,6,26]]},"end":{"date-parts":[[2018,6,30]]}},"container-title":["2018 IEEE Intelligent Vehicles Symposium (IV)"],"link":[{"URL":"http://xplorestaging.ieee.org/ielx7/8472796/8500355/08500632.pdf?arnumber=8500632","content-type":"unspecified","content-version":"vor","intended-application":"similarity-checking"}],"deposited":{"date-parts":[[2018,11,6]],"date-time":"2018-11-06T02:44:10Z","timestamp":1541472250000},"score":50.040874,"issued":{"date-parts":[[2018,6]]},"ISBN":["9781538644522"],"references-count":0,"URL":"http://dx.doi.org/10.1109/ivs.2018.8500632"}
larsgw commented 3 years ago

Thank you for taking the time to report this.

proceedings-article is not a valid entry type in CSL-JSON (the internal format), it should be paper-conference, but Citation.js should be able to correct for that automatically.

Are other entries affected, and if so what type do they have?

ntutangyun commented 3 years ago

I'm using 0.5.0-alpha.9

yes the data is return from CrossRef API.


const citation = await Cite.async(data);
citation.format('bibtex');

// and I get:  @misc{} ...