Failure to import .xml file from Citavi
I followed instructions for exporting my library from Citavi 5 to Zotero (https://www.zotero.org/support/kb/importing_standardized_formats)
I renamed the .cit5bak file to .xml as directed (though the .cit5bak file was not zipped, whereas the linked instructions said it would be) and copied all the pdfs from the relevant Citavi folder into the same folder as the .xml, for import into Zotero.
When I tried to import the .xml file into Zotero I got an error code: 111293816
and an instruction to post the number here for review.
Thanks for any help...
Dan
I renamed the .cit5bak file to .xml as directed (though the .cit5bak file was not zipped, whereas the linked instructions said it would be) and copied all the pdfs from the relevant Citavi folder into the same folder as the .xml, for import into Zotero.
When I tried to import the .xml file into Zotero I got an error code: 111293816
and an instruction to post the number here for review.
Thanks for any help...
Dan
Does Zotero import the PDFs if they are in the same folder?
Thanks a lot!
I have 24 GB of RAM on my PC, and at least 10 GB are free at virtually any time.
Could someone confirm that the import from citavi 5 is working with the latest version of Zotero? Because if it isn't, there is no point in spending lots of time trying...
You can check if your xml file looks markedly different, but large imports into Zotero can indeed take much longer than 30mins and may very well freeze in the process. No harm in letting it run overnight or in the background while you do something else.
It might still crash due to memory issues-- Zotero isn't great with managing memory on imports, but it would actually crash (i.e. shut down) in that case.
Looking at the imported titles, I notice that only a fraction of the information for each title seems to have been imported, so maybe it crashed?
Here are some of the fields that I would have expected to be transferred from the XML file into Zotero but wheren't:
1. Language
2. Short Title
3. Related titles (as linked in Citavi)
4. sequence number (ID)
5. Categories
6. Date added
7. Date modified
8. Library catalogue and call number
9. number of pages
If any of these are not imported by design, is there any way of modifying the import process to include these?
Of the items listed, Sequence number, Date added, Date modified wouldn't import on purpose, the former because it doesn't exist in Zotero, the latter because they're set at the database level in Zotero. I think item relations are a beast to import, so we're probably not super likely to do that.
Are categories the same as keywords and tags?
The other fields should be easily doable.
I have used the sequence number as a unique identifier in various places and would very much like to preserve it. I read somewhere that fields that don't have a corresponding field in Zotero will be written into the extra field (and I have seen that happen in some cases). Is there any way of controlling which fields get written into the extra field?
Losing the date added and date modified fields would also be an unecessary loss of information (it may sound strange, but seeing when I added a refrence and when I last edited it implies quite a lot of things). Is it not possible to tell the database to set these fields based on the imported values upon import? After that, the date modified should of course be updated as usual.
Item relations: doesn't that exist as "Related" in Zotero?
In Citavi, categories serve a different purpose than keywords (keywords describe the content of the item, a typical use for categories are outline headings or research questions within a project or manuscript), but technically they are the same (except that categories can be nested) so they could be imported into tags. SInce category names start with a number, they would be easily distinguishable from keyword-tags. But they might also make the tags box in zotero overcrowded because category names can be quite long (like headings). If collections can be nested and if a reference can simultaneously be in multiple collections, it might make more sense to import categories into collections.
So, by "easily doable" you mean what? Is there a file that I can edit?
I also found the Citavi XML translator file and tried to modify it so that it would import some additional fields into the extra field, but I didn't succeed. Once I modified the file, the import failed.
What I tried to do is use existing lines of code, that import a field into the extras field and modify it, but there seems to be more to it that just that. Could someone give me a hint?
@adamsmith I really appreciate your help. Here is the part of the Citavi 5 XML.js that I modified. The added lines are marked with "// added" at the end of the line. These are not the only modifications I would like to make but I thought I'd start with that.
//Main information for each reference.
var item;
var references = ZU.xpath(doc, '//References/Reference');
var unfinishedReferences = [];
var itemIdList = {};
for (var i=0, n=references.length; i<n; i++) {
var type = ZU.xpathText(references[i], 'ReferenceType');
if (type && typeMapping[type]) {
item = new Zotero.Item(typeMapping[type]);
} else {
Z.debug("Not yet supported type: " + type);
Z.debug("Therefore use default type 'journalArticle'");
item = new Zotero.Item("journalArticle");
}
item.itemID = ZU.xpathText(references[i], './@id');
//Z.debug(item.itemID);
item.title = ZU.xpathText(references[i], './Title');
var subtitle = ZU.xpathText(references[i], './Subtitle');
if (subtitle) {
item.title += ": " + subtitle;
}
item.abstractNote = ZU.xpathText(references[i], './Abstract');
item.url = ZU.xpathText(references[i], './OnlineAddress');
item.volume = ZU.xpathText(references[i], './Volume');
item.issue = ZU.xpathText(references[i], './Number');
item.DOI = ZU.xpathText(references[i], './DOI');
item.ISBN = ZU.xpathText(references[i], './ISBN');
item.edition = ZU.xpathText(references[i], './Edition');
item.place = ZU.xpathText(references[i], './PlaceOfPublication');
item.numberOfVolumes = ZU.xpathText(references[i], './NumberOfVolumes');
addExtraLine(item, "PMID", ZU.xpathText(references[i], './PubMedID'));
addExtraLine(item, "Citavi-ID", ZU.xpathText(references[i], './SequenceNumber')); // added
addExtraLine(item, "Created", ZU.xpathText(references[i], './CreatedOn')); // added
addExtraLine(item, "Modified", ZU.xpathText(references[i], './ModifiedOn')); // added
addExtraLine(item, "BibTeXKey", ZU.xpathText(references[i], './BibTeXKey')); // added
item.pages = extractPages(ZU.xpathText(references[i], './PageRange'));
item.numPages = extractPages(ZU.xpathText(references[i], './PageCount'));
item.date = ZU.xpathText(references[i], './DateForSorting') ||
ZU.xpathText(references[i], './Date') ||
ZU.xpathText(references[i], './Year');
item.accessDate = ZU.xpathText(references[i], './AccessDate');
Another issue I'm seeing, even when I use the original translation file is that the attached pdf files are not getting imported. At first, I figured that this is due to the fact that the file paths on Mac don't match the ones in the Citavi database, so I edited the xml file to change
<AttachmentsFolderPath>L:\</AttachmentsFolderPath>
to
<AttachmentsFolderPath>/Users/christoph/Documents/Box Sync/Literature/</AttachmentsFolderPath>
but to no avail. What could be the reason for attachments not being imported (I used the setting to leave the files where they are and link them, not to import them)?
Oops. I edited the post above accordingly.
For the files, not item 4. here: https://www.zotero.org/support/kb/import-from-citavi
Oh, sorry about that. I had seen and followed that previously but somehow I forgot about it again.
My import using the modified Citavi 5 XML.js also seems to work now. I suspect that I unintentionally modified the file somewhere else, so I started anew with the original.
Now, the one big thing that is missing at this point are the relationships between items. Since Zotero also has this feature (related), it would make sense to import those as well. But I'm not sure how this can be accomplished.
I believe that in the Citavi XML file, these relationships are stored towards the end of the file as EntityLinks. They look like this:
<EntityLink id="aa00ace0-8d48-475b-8d52-4b8ba9ba8f1d">
<ModifiedBy>ch</ModifiedBy>
<ModifiedOn>2014-06-27T18:28:36</ModifiedOn>
<Indication>ReferenceLink</Indication>
<Notes>Note about this relationship</Notes>
<RelationType>0</RelationType>
<Source>645699e9-7877-40ad-8e83-91e8d50b8999:Reference</Source>
<SourceData>156</SourceData>
<SourceID>645699e9-7877-40ad-8e83-91e8d50b8999</SourceID>
<SourceType>Reference</SourceType>
<Target>feb5508f-727d-4d19-996e-147083cc98d7:Reference</Target>
<TargetID>feb5508f-727d-4d19-996e-147083cc98d7</TargetID>
<TargetType>Reference</TargetType>
</EntityLink>
The Notes field is only present if there actually is a note. (I'm not sure if zotero allows for comments on relationships and I can't check because it is currently blocked by the ongoing import, but it would be great if those notes could also be imported. But let's safe that for later.)
Examples of other values in the indication-field, are PdfKnowledgeItem and SourceAnnotLink. Not sure what those are, but for now I'll assume that it's the ReferenceLink-type LinkEntities we want.
So, in my mind, what the translator would have to do (for those entity links that are ReferenceLinks) is "merely" map the SourceID and TargetID onto the items in Zotero and create a "related"-record for those two items. Since the translator is already using reference IDs (which correspond to SourceID and TargetID), I'm optimistic that this is possible. Not sure, though, how to create a related item...
@dstillman could you confirm that? I'm not seeing relations preserved on export/import in any translator.
This is excellent news! How about the direction of the relation (which item is referring to which)? Is that also preserved?
Another challenge I encountered is that all my most important notes/annotations in Citavi are associated to one or more categories (representing for which project or paper or section of a paper they are relevant). Since Zotero does allow notes to have relations, one way of translating those relations to categories would be to create a standalone note for each category and associate all notes under that category to that note.
Another option would be to use tags, but I would probably prefer not to pollute the tags with those rather long category names.
On the other questions -- you can try to make that happen -- it's theoretically possible (though with the caveat of the broken relations import noted above) but it goes beyond what I can help with. Zotero is different from Citavi, and there's going to be some loss on transferring between different systems.
And if you can point me to some resources that might guide me when extending the code, that would be really great. To give an example of what I'm looking for: when I tried to understand what
ZU.xpathText
does, I couldn't really find a good answer (I'm sure it's out there somewhere and will eventually find it, but at this point I don't even know whether this is a generic javascript command or something specific to Zotero. So if there is some place I can start with these kinds of questions, let me know.all functions starting with Z and ZU (aliases for Zotero. and Zotero.Utilities) are Zotero specific.
WRT relations, I'm fairly certain that's a general problem on Zotero import, nothing to do with this specific translator.
So this is something that needs to be fixed in Zotero itself? Am I right in assuming that this wont happen in the near future?
This has also been reported in another context and he'd have to say how complex and what priority a fix is. If it's just a small bug, they'll likely fix it very quickly. If it's due to larger changes and a complex fix, it'll take time.
First thanks a lot for all people solving many of my problems here esp @adamsmith @dstillman @zuphilip and @haug . I ran into touble myself by evacuating my work related Citavi data to Zotero,
Citavi 6 offers the option to save a Projekct in Citavi 5 xml format, which interestingly enough is in xml directly (and woudn't open in Citavi 5 at least when tried.) Trying to import into zotero also gave an error which I reported under: 1468382517.
This Error can be avoided if one changes the Version info in the second line of the citavi xml export from 6.10.0.0 to 5.10.0.0. Obviously the Import checks for the version number and does not like the version 6.
If you copy the Atachment files to the folder containing the .xml file it will also import at least most of the attached files. If you have Zotfile active it will take some additional time for it to rename and copy the attachments (at least as far as I could see)
thanks once more I hope someone can need the workaround.