eschnett / zotero-citationcounts

Zotero plugin for auto-fetching citation counts from various sources
Mozilla Public License 2.0
781 stars 35 forks source link

Not pulling Citaiton Counts at all (Semantic Scholar) or for books (CrossRef) #20

Open LReinoso1 opened 2 years ago

LReinoso1 commented 2 years ago

I installed the add-on to track citation counts for articles in order to prioritize. I noticed that the add-on doesn't pull citation counts even for works that have such citation counts (e.g. Michael Saward's The Representative Claim). Likewise, the add-on seems not to collect book citations for CrossRef. The add-on pulls CrossRef citations for the article "The Representative Claim", but not the book by the same title -- despite CrossRef recording citations for the book.

eschnett commented 2 years ago

Is there an error message? Does it say that it found 0 citations, or is there any other pop-up message? Does it work when you manually trigger updating the citation counts by right-clicking on the publication?

LReinoso1 commented 2 years ago

In both cases, it just says that it found 0 citations. More specifically "Semantic Scholar/CrossRef citation counts updated for 0 items."

Manual triggering doesn't help.

LReinoso1 commented 2 years ago

I am wondering if there is any follow-up. Thank you!

eschnett commented 2 years ago

I have no idea what is causing this problem. I will have to debug what is going wrong – I can't promise a particular timeline.

LReinoso1 commented 2 years ago

Thank you!

craigl-res commented 2 years ago

I'm getting the same issue with each citation source. Happy to beta test a fix if you find one. Edit: I'm using Zotero 6.0.5 and Windows 11

craigl-res commented 2 years ago

An update: the plugin appears to work fine (and well) for Zotero records with a DOI entry, and returns the '0 item' message for records without a DOI entry. I haven't tested every record I have but that appears to be a pattern so far.

LReinoso1 commented 2 years ago

Thanks! Is that for both Semantic Scholar and CrossRef? I am pulling articles on CrossRef, but the plugin pulls no Semantic Scholar citations

LReinoso1 commented 2 years ago

Also, I just checked: if I have a DOI for a book, it still does not pull CrossRef citation counts

craigl-res commented 2 years ago

I tested on one article and it can pull the CrossRef citations too, if a valid DOI is present.

RakhDamir commented 2 years ago

I have encountered the same problem. For some references from ArXiv, I do not get any information about the number of citations. It does not show even 0 citations. When I try to trigger the update manually it shows that " ... citation counts were updated for 0 items".

LReinoso1 commented 2 years ago

CrossRef works for articles, not for books (even if I have DOI in "extra" field). Semantic Scholar doesn't work for anything.

glocalglocal commented 2 years ago

the add-on seems not to collect book citations for CrossRef

CrossRef only deals with journals, not books. AFAIK, this addon doesn't support counts for books at all unfortunately.

Leonpagliacci commented 2 years ago

the same problem arose with the pop-up message "Semantic Scholar/CrossRef citation counts updated for 0 items." when I first installed this plug-in.

adrien-perello commented 2 years ago

I agree, I think it is most likely is because books and book chapters do not have a "DOI" field.

In In zoterocitationcounts.js there is:

async function getSemanticScholarCount(item, idtype) {
    let doi = null;
    if (idtype == 'doi') {
        doi = item.getField('DOI');
    } else if (idtype == 'arxiv') {
        const arxiv = item.getField('url'); // check URL for arXiv id
        const patt = /(?:arxiv.org[/]abs[/]|arXiv:)([a-z.-]+[/]\d+|\d+[.]\d+)/i;
        const m = patt.exec(arxiv);
        if (!m) {
            // No arxiv id found
            return -1;
        }
        doi = m[1];
    } else {
        // Internal error
        return -1;
    }
    if (!doi) {
        // There is no DOI / arXiv id; skip item
        return -1;
    }

With a bit of regex, we can get the DOI from either the "URL" field or the "extra" (as it is often added there). Which is what @eschnett does, but It seems to me that he assumes that if there is no DOI, then the only reason could be because it is not printed yet, and then he checks for arxiv. But in my case for example the DOI reference is present in the "URL" field (as well as the "extra" field since it is added automatically with the "Save to Zotero" browser plugin).