removing multiple spaces when importing from RIS file

When i import this file:

https://gist.github.com/hafnius/6003935

into zotero, it retains the 4 spaces after each linebreak from line 12-61 in the note about the contents of the book. This is regardless of the file ending in .ris or .txt

I see the Zotero importer has severel utility functions, among them is Zotero.Utilities.trimInternal(text). Is it not able to remove the internal spaces or is there something i could do short of trimming the file manually before importing ?
  • Trim internal can very much handle this, but we're reluctant to trim fields on import in generic translators - people may want them in the note for whatever reason (e.g. for a list or a pseudo-table).

    The four spaces shouldn't be there - in a well specified RIS file the note tags is not aligned.

    Where is this coming from? If this is a one time import, it seems trivially easy to handle this in the text file. Otherwise it wouldn't be hard to custom-modify the RIS translator.
  • The RIS file is from http://bibliotek.dk/ (it means library.dk) and is the common entrance for searching books from all libraries in Denmark. It is the one-stop site for library books in Denmark. I have checked with several books and the formating of the notes in the RIS file with the 4 leading spaces is consistent.

    If we could custom-modify the RIS translator for this site it would be great. I have seached the translators but there dont seem to be one for this site - instead it relies on embedded metadata but using that does not get the notes. If i can help in resolving this issue i would be happy to.
  • walk me through how to get to the RIS? Do I need to log in?
  • No need to log in for this. I have made a short screencast so you can see the steps. The book i was searching for is "basisbog i ergoterapi" if you want to copy my steps. You can get the site in english from the top menu of the site. Thank you for your time.

    https://vimeo.com/70377352
  • great thanks. I'll need a while to look at this, unfortunately doesn't look trivial, but might still be doable depending on the site structure.

    @aurimasv - if you're reading this. We could maybe clean up RIS for this specific scenario, i.e. something like \n\s{4} or so, what do you think?
  • Thank you. Before too much work is done on this i found out they are working on a new version of the site written in Drupal at http://bibliotek.dk/beta but i dont see that replacing the old site in the next year or so. Right now the functionality is the same as the old site with regards to getting the RIS file, but the RIS file contains less info and no notes.

    So maybe just leave this as is and i could start a dialog with them on making the new site easier too translate for Zotero and similar tools. Would that include RDFa, Microdata, CoinS or something else ?

    Do you know of a similar site written in Drupal that works well with Zotero that i could use as an example?
  • edited July 16, 2013
    The current catalog has COinS, which is usually the only easy solution, but has a number of limits - COinS isn't a terribly rich standard.
    The best way to make a catalog work with Zotero out of the box (i.e. without translator) is actually unAPI, which allows the catalog to serve rich data in its preferred format to Zotero
    (A full list of options is here: http://www.zotero.org/support/dev/exposing_metadata )
    The only library catalog that I'm currently aware of that's using that is at the University of Michigan, Ann Arbor.

    If that's not an option, just having a direct link from catalog entries to rich metadata - ideally MARC/MAB20, if that's not possible at least allow RIS export without going through a basket will allow us to write a translator easily. Unfortunately I'm not aware of any good Drupal sample sites, no.
  • Fixed handling of trailing/leading whitespace in notes/abstracts. Should be better at determining when to insert newlines too.

    Update your translators from Preferences... -> General -> Update Now

This is an old discussion that has not been active in a long time. Before commenting here, you should strongly consider starting a new discussion instead. If you think the content of this discussion is still relevant, you can link to it from your new discussion.

Sign In or Register to comment.