exporting to CSL JSON results in loss of fields
Apparent bug when exporting to JSON from Zotero standalone, version 4.0.17 running on Windows 7 Enterprise.
When exporting a book reference or entry-encyclopedia with a contributor, there is a difference in the markup output between TEI XML and JSON. The CSL JSON export appears to lose the contributor, i.e. it is missing the respStmt – not included. Similarly the "Series (number)" also disappears when exporting a Journal article as CSL JSON. Therefore, this issue may be more widespread.
Please note the difference in the export from a book item when comparing between TEI (okay):
<?xml version="1.0"?>
<listBibl xmlns="http://www.tei-c.org/ns/1.0"><biblStruct type="book" xml:id="s2013"><monogr><title level="m">jello</title><author><forename>first</forename><surname>s</surname></author><respStmt><resp>contributor</resp><persName><name>contributor1, 2nd</name></persName></respStmt><edition>3</edition><imprint><pubPlace>here</pubPlace><biblScope type="vol">13</biblScope><publisher>me</publisher><date>2013</date><note type="accessed">2014-03-14</note><note type="url">cnn.com</note></imprint></monogr><series><title level="s">134</title><biblScope type="vol">XI</biblScope></series><idno type="ISBN">1324123413</idno><idno type="callNumber">BS134</idno></biblStruct></listBibl>
==========
and same book item exported as CSL JSON (missing item for responsibility statement/CONTRIBUTOR):
[
{
"id": 22,
"type": "book",
"title": "jello",
"collection-title": "134",
"collection-number": "XI",
"publisher": "me",
"publisher-place": "here",
"volume": "13",
"number-of-volumes": "20",
"number-of-pages": "13",
"edition": "3",
"source": "1324",
"archive": "afd",
"archive_location": "1",
"event-place": "here",
"abstract": "ab",
"URL": "cnn.com",
"ISBN": "1324123413",
"call-number": "BS134",
"note": "adaddsads",
"shortTitle": "o",
"language": "spanglish",
"author": [
{
"family": "s",
"given": "first"
}
],
"issued": {
"date-parts": [
[
"2013",
3
]
]
},
"accessed": {
"date-parts": [
[
"2014",
3,
14
]
]
}
}
]
--------
Thanks for fixing this or letting me know if I am incorrect in my analysis.
William Straub
Systems Librarian and Web Developer
When exporting a book reference or entry-encyclopedia with a contributor, there is a difference in the markup output between TEI XML and JSON. The CSL JSON export appears to lose the contributor, i.e. it is missing the respStmt – not included. Similarly the "Series (number)" also disappears when exporting a Journal article as CSL JSON. Therefore, this issue may be more widespread.
Please note the difference in the export from a book item when comparing between TEI (okay):
<?xml version="1.0"?>
<listBibl xmlns="http://www.tei-c.org/ns/1.0"><biblStruct type="book" xml:id="s2013"><monogr><title level="m">jello</title><author><forename>first</forename><surname>s</surname></author><respStmt><resp>contributor</resp><persName><name>contributor1, 2nd</name></persName></respStmt><edition>3</edition><imprint><pubPlace>here</pubPlace><biblScope type="vol">13</biblScope><publisher>me</publisher><date>2013</date><note type="accessed">2014-03-14</note><note type="url">cnn.com</note></imprint></monogr><series><title level="s">134</title><biblScope type="vol">XI</biblScope></series><idno type="ISBN">1324123413</idno><idno type="callNumber">BS134</idno></biblStruct></listBibl>
==========
and same book item exported as CSL JSON (missing item for responsibility statement/CONTRIBUTOR):
[
{
"id": 22,
"type": "book",
"title": "jello",
"collection-title": "134",
"collection-number": "XI",
"publisher": "me",
"publisher-place": "here",
"volume": "13",
"number-of-volumes": "20",
"number-of-pages": "13",
"edition": "3",
"source": "1324",
"archive": "afd",
"archive_location": "1",
"event-place": "here",
"abstract": "ab",
"URL": "cnn.com",
"ISBN": "1324123413",
"call-number": "BS134",
"note": "adaddsads",
"shortTitle": "o",
"language": "spanglish",
"author": [
{
"family": "s",
"given": "first"
}
],
"issued": {
"date-parts": [
[
"2013",
3
]
]
},
"accessed": {
"date-parts": [
[
"2014",
3,
14
]
]
}
}
]
--------
Thanks for fixing this or letting me know if I am incorrect in my analysis.
William Straub
Systems Librarian and Web Developer
You can see a full mapping here:
http://aurimasv.github.io/z2csl/typeMap.xml
If you need a full export of Zotero data, Zotero RDF is the (only) way to go.
It's a small problem code-wise; there are just a couple of field ID mismatches in the export method. I've filed a suggested fix and confirmed that it works. When the team have a chance to review the patch, it should be fixed right up.
https://github.com/zotero/zotero/pull/478
> Only variables defined in CSL are (and can be) included.
Will non-CSL variables actually break CSL readers, like pandoc? I stuck a "file" variable into a library export in CSL JSON format and pandoc seemed ok.