lucastheis / django-publications

A Django app for managing scientific publications.
MIT License
103 stars 56 forks source link

bulk bibtex import #15

Closed haluk closed 7 years ago

haluk commented 9 years ago

Is there any way to import multiple entries rather than one by one as in Import BibTex?

lucastheis commented 9 years ago

The "Import BibTex" feature already supports multiple BibTex entries. If it's not working for you, can you post the BibTex entries you are trying to import?

haluk commented 9 years ago

When I paste the content of citations.bib, "Import BibTex" gives me this error: "Make sure that the keys title, author and year are present." screen shot 2014-12-29 at 5 00 44 am

haluk commented 9 years ago

Oh, I did something wrong. It's working. Sorry.

lucastheis commented 9 years ago

What was the mistake? Anything where a better error message would have helped?

haluk commented 9 years ago

I'm not sure but I think there should be an empty line between bibtex entries.

lucastheis commented 9 years ago

Hmn, that shouldn't be necessary. I will check that, thanks.

haluk commented 9 years ago

I tried, it's not necessary. I realized that one of the entries had non UTF-8 character somehow. Most probably it was the problem.

lucastheis commented 9 years ago

Could you send me the BibTex entry that caused the problem as a text file? Or simply dump it in the comment field as plain text?

haluk commented 9 years ago

It doesn't allow me to attach the file other than "PNG, GIF, or JPG". But here is the content.

@article{nalbantoglu2014metagenomic,
  title={Metagenomic analysis of the microbial community in kefir grains},
  author={Nalbantoglu, Ufuk and Cakar, Atilla and Dogan, Haluk and Abaci, Neslihan and Ustek, Duran and Sayood, Khalid and Can, Handan},
  journal={Food microbiology},
  volume={41},
  pages={42--51},
  year={2014},
  publisher={Elsevier}
}

@article{dogan2014whole,
  title={Whole Genome Sequence of a Turkish Individual},
  author={Dogan, Haluk and Can, Handan and Otu, Hasan H},
  journal={PloS one},
  volume={9},
  number={1},
  pages={e85233},
  year={2014},
  publisher={Public Library of Science}
}

@article{isci2014bayesian,
  title={Bayesian network prior: network analysis of biological data using external knowledge},
  author={Isci, Senol and Dogan, Haluk and Ozturk, Cengizhan and Otu, Hasan H},
  journal={Bioinformatics},
  volume={30},
  number={6},
  pages={860--867},
  year={2014},
  publisher={Oxford Univ Press}
}

@incollection{dougan2014objective,
  title={Objective Functions},
  author={Do{\u{g}}an, Haluk and Otu, Hasan H},
  booktitle={Multiple Sequence Alignment Methods},
  pages={45--58},
  year={2014},
  publisher={Springer}
}

The last entry has "{\u{g}}" character in the authors. The original character should be lower case "ğ" (Upper case "Ğ").

lucastheis commented 9 years ago

Thanks. That's a bug that I will need to fix.

alvarouc commented 8 years ago

Any update on this? I am getting the same error

lucastheis commented 8 years ago

The current development version shouldn't throw an error when it encounters characters like "{\u{g}}" (although it might still not interpret it 100% correctly). Can you tell me which version you are using and post the bibtex entry that's causing the problem?

lucastheis commented 8 years ago

Christian Glodt's fork uses the bibtexparser library instead of my bibtex parser. Maybe this works better for you: https://github.com/christianglodt/django-publications Although it's planned, it will take me a while to completely replace the bibtex parser.