Automatic vs. Manual Tag Export as RIS Files

When exporting my collection as an RIS file to run keyword analysis in a separate visualisation software e.g., VOS Viewer or NVivo, it returns a total of 419 tags (these are presumably automatically assigned through the import mechanism in Zotero).

However, when running the following .js query, it shows 447 unique keywords:

var items = ZoteroPane.getSelectedItems();
var tagCounts = new Map();
for (let item of items) {
let tags = item.getTags();
for (let { tag } of tags) {
if (!tagCounts.has(tag)) {
tagCounts.set(tag, 1);
}
else {
let num = tagCounts.get(tag);
tagCounts.set(tag, num + 1);
}
}
}
var str = "";
for (let [tag, num] of [...tagCounts.entries()].sort()) {
str += tag + "\t" + num + "\n";
}


What explains the difference? The 447 include a few more keywords that are relevant whereas the RIS file reduces, but on the basis of what? Is it not counting MANUAL keywords that I've put in, ( think that might be the culprit).

Please advise and thanks! Needing to know which method is more appropriate so I can conduct appropritate analyses.
  • RIS export doesn't distinguish between manual and automatic tags, so that really shouldn't be it. One thing that comes to mind is that RIS wouldn't exports top level ('standalone') notes and files, so any tags on those wouldn't be in the export. Similarly, RIS export wouldn't include tags on attached files or notes (I'm not 100% sure if the above code would, but I think it might).
  • I see. That seems plausible. That being said, the sample of 447 from .js is richer in content. How might I convert that into a readable RIS file so I can conduct my cluster analysis (in the same way a direct RIS export from ZOTERO collection is done?)
  • You just want them to be part of the total of keywords, doesn't matter what they belong to?

    Run the same code but with
    str += "KW - tag + "\n";

    and then just add the list to whichever RIS entry with a text editor. Or you could dedupe it first wrt to the ones already in the RIS.
  • Ran the .js with the above command but received: SyntaxError: invalid escape sequence

    ... :(
  • var items = ZoteroPane.getSelectedItems();
    var tagCounts = new Map();
    for (let item of items) {
    let tags = item.getTags();
    for (let { tag } of tags) {
    if (!tagCounts.has(tag)) {
    tagCounts.set(tag, 1);
    }
    else {
    let num = tagCounts.get(tag);
    tagCounts.set(tag, num + 1);
    }
    }
    }
    var str = "";
    for (let [tag, num] of [...tagCounts.entries()].sort()) {
    str += "KW - tag + "\n";
    }
  • sorry, wrote that quickly, I assumed you new what the JS was doing and didn't read closely. It's

    str += "KW - " + tag + "\n";
  • Got it. Query worked. Now I have the updated list but I need to update the RIS file. I'm reading the RIS file with the smaller sample in a text editor (notepad), but not sure how to include the updated list into the text editor without dupes. I used the find function in excel to isolate all (KW - ) in the original RIS files, then copied into the alternative list and tried deduping from there but the sample doubled and it doesn't recognise dupes....
  • Oh Wait -- the original .js had an extra (space) in between KW and -, making it unrecognisable in the find function. how tedious! I think I've got it sorted now, but I deduped in Excel, not the original RIS file. how do I transfer this new KW list into an RIS file so I can re-analyse?
  • edited May 21, 2024
    The actual question is -- I have all my keywords consolidated into one column but I want to dedupe according to case sensitivites and entire cell contents (in other words, KW - wellbeing , KW - wellbeing DEDUPE but NOT KW - wellbeing, KW - Wellbeing

    This is because I need to dedupe exact case contents but still have near-duplicates so I can further code - consolidate and then run F tests.

    I ran an excel formula to remove case sensitive dupes. All good. Last problem is getting this new file into an RIS mode so I can re-analyse then I'm good. Thoughts?
Sign In or Register to comment.