How to retrieve and update metadata in zotero?

Hello everyone,

I'm a calibre library manager user moving into zotero for citations. Some books cannot retrieve metadata examples are the pdf that are not OCRs based on the error message and when I create a book item with a title, I cannot update its metadata at all. In calibre, I can select/highlight books, you click retrieve metadata and it fetches the data for you.

How to automatically retrieve and update metadata in zotero? I just don't want to enter each manually.

Is there any way we can have a calibre like metadata updater?

Thanks!
«1
  • To start, make sure you've read through Adding Items to Zotero.

    In Zotero, you almost never create items manually. You generally save them from the web using the Zotero Connector, and Zotero downloads the metadata and, when possible, the PDF automatically. Alternatively, if you add an OCRed PDF directly and it has a DOI or ISBN in the first few pages, Zotero can retrieve metadata for it, and it can also extract limited metadata for PDFs without identifiers. Finally, you can enter a DOI or ISBN into Add Item by Identifier in the Zotero toolbar to retrieve metadata that way.

    We're working on the ability to update existing items, but that's more for updating previously saved preprint items and not really related to adding items to Zotero initially.
  • Thank you dstillman! I understand now the process.

    I guess I'm using zotero wrong, I'm adding the pdf manually since its too easy and intuitive to just drag + drop a pdf into zotero.


    Is this a design decision or is there any plan on adding this feature ( adding books manually and then updating its metadata) in the future?
  • When you have a PDF already, you can certainly drag it in, and Zotero can often retrieve metadata for it. But that only works when the file is OCRed, and it works best when there's a DOI or ISBN that can be extracted, so we don't recommend that as the default approach to adding items.
    Is this a design decision or is there any plan on adding this feature ( adding books manually and then updating its metadata) in the future?
    This part I'm not entirely understanding. What information do you want to enter to create the item manually? Again, you can type or paste the ISBN into Add Item by Identifier to add it that way, or you can do a web search for the book and save it from there (your library catalog, WorldCat, Google Books, Amazon, etc.).
  • My question is based on how I used calibre to update the book metadata. I usually drag the PDF in calibre then fetch the metadata. there are times that calibre can't find the metadata but this is where you can add a Title or an identifier like ISBN and when you re-fetch the metadata, it will have a greater chance of finding the book.

    My understanding is that the process in Zotero is the opposite of calibre to have better metadata. As recommended I should add the metadata first before adding the PDF ebook.

    Will Zotero allow users to update the metadata like the way calibre does it?
  • My understanding is that the process in Zotero is the opposite of calibre to have better metadata. As recommended I should add the metadata first before adding the PDF ebook.
    It's what I say above. If you have the PDF already, you can try dragging it in. If Zotero is unable to retrieve metadata for it, you can paste the ISBN into Add Item by Identifier or do a web search for the title and save the item from the sorts of sites I mention above, and then drag the PDF onto the newly created item.

    Zotero will be gaining a metadata-updating feature, but this isn't really the intended use case. If you have an ISBN, there's already a feature for creating an item that way.
  • Thank you dstillman, I'm looking forward to the metadata-updating feature. I will use your recommendation for now.

  • For now, the fastest solution would be to go to the publisher website (e.g., using the CrossRef lookup button in the Locate menu [green arrow in upper right corner in Zotero]), import the item again, then merge the two items.

    Another option is to automatically look up the DOI using the DOI Manager plugin, then copy the DOI and use the Magic Wand tool to add an item using the DOI, then merge the two items.
  • Could an option to select multiple pdfs or links and update metadata for them all instead of individually? I have a large number of linked pdfs whose metadata was not pulled but that gets pulled when I manually right click them and say update metadata.
  • @emfortier: Not sure what you're referring to — this feature hasn't launched yet. But you'll be able to update metadata for multiple items at once, yes.
  • has update-metadata been implemented?
  • "Zotero will be gaining a metadata-updating feature" was from 2019, I am just wondering if this feature will be included soon in future updates? Thanks
  • Yes, it will.
  • I have developed a plugin which can update metadata for Zotero Items.
  • This feature is already implemented and will be available in the Zotero beta shortly after Zotero 6. If you're running a source build you can try it now.
  • exciting! any estimate on the timeline we can get the beta?
  • iseexuhs, where can one find your plugin? Also, will it work with latest Zotero 6+?
    dstillman, were can we find the Zotero beta that has this feature built in?
    Thank you,
  • @dstillman: Where can we find this version of Zotero beta that has this feature built-in?
  • @alfoil: It's not in the beta yet. We're still working on more immediate post-release issues.
  • Is it possible to have a choice of updating metadata according to the INSPIRE-HEP database, which is the standard database in our field?
  • Is there any progress for this feature?
  • I made up a simple plugin updating the metadata for publications in the INSPIRE database,

    https://github.com/fkguo/zotero-inspire

    by modifying the zotero-shortdoi and zotero-citationcounts plugins.
  • edited August 6, 2022
    Run the following code in the "Run Javascript Window" to retrieve and update metadata based on DOI. The Demo is available here (https://getquicker.net/sharedaction?code=78da8f40-e73a-46e8-da6b-08da76a0d1ac
    https://www.yuque.com/chentaotao-cf9fr/gthfy4/wrc8ef)

    var items = Zotero.getActiveZoteroPane().getSelectedItems();
    let item = items[0]
    let identifier =
    {
    itemType: "journalArticle",
    DOI: item.getField('DOI')
    };
    var translate = new Zotero.Translate.Search();
    translate.setIdentifier(identifier);
    let translators = await translate.getTranslators();
    translate.setTranslator(translators);
    let newItems = await translate.translate();
    let newItem = newItems[0];

    function update(field){
    if (newItem.getField(field)){
    item.setField(field,newItem.getField(field))
    }
    }
    item.setCreators(newItem.getCreators());

    // 可根据下述网址增减需要更新的Field.
    // https://www.zotero.org/support/dev/client_coding/javascript_api/search_fields

    let fields=["title","publicationTitle","journalAbbreviation","volume",
    "issue","date","pages","issue","ISSN","url","abstractNote"
    ]

    for (let field of fields){
    update(field);
    }

    newItem.deleted = true;
    item.saveTx();
    await newItem.saveTx();
    return ("成功!");
  • @cttsyauchina worked like a charm, thanks for the code!
  • @cttsyauchina thanks for the code! Seems to do its job
  • @dstillman It has been almost one year. Is the updating metadata feature available now?
  • @cttsyauchina When I run your code, it says "syntax error:unexpected token; identifier." How to fix it?
  • @hqgu are you using it for other item types than journal articles? The script expects journal articles.
  • @ingmar93 Thanks for your notes. It works.
  • I tweaked cttsyauchina's code for ISBN retrieval:

    var items = Zotero.getActiveZoteroPane().getSelectedItems();
    let item = items[0]
    let identifier =
    {
    itemType: "book",
    ISBN: item.getField('ISBN')
    };
    var translate = new Zotero.Translate.Search();
    translate.setIdentifier(identifier);
    let translators = await translate.getTranslators();
    translate.setTranslator(translators);
    let newItems = await translate.translate();
    let newItem = newItems[0];

    function update(field){
    if (newItem.getField(field)){
    item.setField(field,newItem.getField(field))
    }
    }
    item.setCreators(newItem.getCreators());

    // Update the book fields.
    let fields=["title", "publisher", "place", "edition", "date", "numPages", "url", "abstractNote"]

    for (let field of fields){
    update(field);
    }

    newItem.deleted = true;
    item.saveTx();
    await newItem.saveTx();
    return ("Success!");
Sign In or Register to comment.