Issue: Groups not visible in the vertical left bar even if correctly visibile in the groups field in each record

Hi all,

I’ve been using JabRef just now with macos 15.6. I’ve a big library from Zotero exported in BibTex format using the Zotero Extension BetterBibTex Export so as to have additional metadata such as my former Zotero Collections which are exported as groups = {…},

JabRef groups are very important for me because I’ve made extensive use of Collections and Sub-Collections in Zotero instead of using Tags. So it is essential for me to have them well visible even in Jabref.

Now I’ve noticed an issue with the JabRef interface. If I want to see all the list of Groups in the vertical left bar under All Entries I must select Open Library (my .bib file exported from Zotero). Instead if I use Import library everything is imported, groups names are visible in the right field of the record BUT they are not visible in the vertical left bar.

This is a problem if I wanted to import a new file in the same Library: I’d have to use the Import function buyt in this case the Groups connetced to the records in the new file would not be visible! So I cannot extend the library imported from Zotero by adding a new collection of records.

Why the user interface behaves so differently as relates to the left bar if I use Import library instead of Open Library? Is there a way to fix this issue?

I would be very grateful if you could help me with this problem.

This might possibly be a case of Improve linking between groups assigned to entries and JabRef's internal group system · Issue #8836 · JabRef/jabref · GitHub . It’s been a while since I personally have looked into this issue, but it seems to be related to listener issues. Please check, if opening/adding a different library and switching between the two will update something the groups in the GUI. Maybe, restarting JabRef after the import/opening might be a fix? Please repost your findings.

Also, what version of JabRef are you using right now? You can find this information under `Help > About JabRef`

(internal comment) I filed Groups not visible in the vertical left bar even if correctly visibile in the groups field in each record · Issue #13684 · JabRef/jabref · GitHub to track the issue.

The idea of JabRef is to have .bib as “native” file format. Think of it as .docx or .xlsx if that helps.

In Excel: If you open a spreadsheet, it behaves different than if you import data.

Open is located in the “File” menu in Excel:

Whereas “Import” is located at “Data”

Maybe, we should move “Import” and “Export” to the “Library” menu.


Maybe this analogy helps?

Hi, thank you for your support. I did all you suggested but nothing changed. As to version of JabRef I’m using these are the data I copied form the About JabRef Window:

JabRef 5.15–2024-07-10–1eb3493
Mac OS X 15.6 aarch64
Java 21.0.2
JavaFX 22.0.1+7

No, sorry. The analogy with Excel is not at all helpful. When Groups are very relevant for you because this is the only tool you used to organize your vast Zotero library of nearly 30,000 records, it is essential to have them imported in another database, as in this case of JabRef. Above all if, as it is my case, I examined different alternatives and I choose the only one which combines free availability with the ability of exporting Zotero Collection names to the new database. Obviously importing Zotero Collections names in the appropriate JabRef field called Groups names is not enough to use them. You also want Groups names to be displayed in the UI for browsing. If you discover that if you want all that you don’t have to use Import Library but Open Library in order to see all your Groups listed as Subgroups and Sub-subgroups in the UI, then you’ll stick to Open Library and you will avoid Import Library. But this is not what you expect to be a reasonable behavior. If I want to see my Groups list correctly displayed in the vertical left bar I should recreate all of them manually, which is absurd given the fact that JabRef has the Groups name in each record. So why I cannot instruct JabRef to display this information in the UI IF i choose Import Library? If the issue is not solved that would mean that Importing Library has a significative drawback.

That’s right. The groups field assigns entries to groups but does not create the groups for display in the panel. I could be wrong, but I think this has been fixed and now works as you would expect in the development version of JabRef.

Now, let’s talk about a workaround that is not too difficult or slow and does not require a specific version of JabRef.

Explanation

The groups that JabRef creates or that you create in the UI are defined in a comment at the end of the .bib file, like this.

@Comment{jabref-meta: grouping:
0 AllEntriesGroup:;
1 StaticGroup:Temp\;2\;1\;\;\;\;;
2 StaticGroup:SubgroupA\;2\;1\;\;\;\;;
2 StaticGroup:SubgroupB\;2\;1\;\;\;\;;
}

In this case, the Temp group has been defined, so it will appear in the panel, and if you have an entry that contains groups = {Temp}, the entry will appear in the group. In contrast, if you have an entry that contains groups = {Temp}, but the group has not been defined as 1 StaticGroup:Temp\;2\;1\;\;\;\;; then entry will be associated with the Temp group, but the group will not appear in the panel.

This should be seamless, but since it isn’t working automatically you can give JabRef a little manual assistance to make the groups show up in the UI.

If I understand correctly, the groups appear in the panel when you open the file, which means that the file must contain group definitions. For whatever reason, this does not happen when you import files. However, you can copy and paste group definitions between files, so if you open the files individually and each one contains group definitions, you can merge the definitions into one file. After that, the groups and entries associated with them will appear in the UI.

Here is an example.

@Comment{jabref-meta: grouping:
0 AllEntriesGroup:;
1 StaticGroup:Temp\;2\;1\;\;\;\;;
2 StaticGroup:SubgroupA\;2\;1\;\;\;\;;
2 StaticGroup:SubgroupB\;2\;1\;\;\;\;;
1 StaticGroup:NewGroup\;2\;1\;\;\;\;;
1 StaticGroup:AnotherNewGroup\;2\;1\;\;\;\;;
}

Option 1

  1. Open and save each .bib file with JabRef.
  2. Open the files with a text editor to confirm that the files have group definitions at the end.
  3. Create a choose a library to be the main library.
  4. Copy entries and definitions from the secondary libraries, and paste them into the main library, above the existing definitions.
  5. Merge the definitions into a single `@Comment {jabref-meta: grouping } statement.
@Article{Someone2023,
  author       = {Example, Author},
  date         = {2023-05},
  journaltitle = {J JabRef},
  title        = {Last entry in the main/existing library},
}

***********************************************
Past entire contents of the next library here, 
where it will be easy to delete any duplicated
@Comment lines and merge the group definitions.
***********************************************

@Comment{jabref-meta: databaseType:biblatex;}

@Comment{jabref-meta: fileDirectory:/path/to/attachments;}

@Comment{jabref-meta: fileDirectory-host:/other/path/to/attachments;}

@Comment{jabref-meta: grouping:
0 AllEntriesGroup:;
1 StaticGroup:Temp\;2\;1\;\;\;\;;
2 StaticGroup:SubgroupA\;2\;1\;\;\;\;;
2 StaticGroup:SubgroupB\;2\;1\;\;\;\;;
}

Option 2

  1. Import entries into JabRef
  2. Confirm that the entries have groups but the groups don’t appear in the UI.
  3. Open the .bib file in a text editor that supports regular expressions.
  4. Use a regex search to find and copy all the group names in your library
  5. Remove duplicates, then convert the group names to definitions like the examples above.
  6. Confirm that the groups and entries appear in the UI

Here is a regex pattern that will match each group name individually in a JabRef .bib file (if you use a comma, with or without trailing space as the delimiter). If you use another delimiter, replace the commas with your delimiter.

(?<=(,|{)\s{0,1})\S+?(?=,|})(?<=^ groups ?=.*)

@Pierfranco May I ask if you tried the lastest development build? A group of students of a university is trying to repduce. They posted me following screenshot:

This seems to recreate the tree as you wished @Pierfranco

Just a double check: You do know “View” and then “Groups” with more information at https://docs.jabref.org/finding-sorting-and-cleaning-entries/groups#groups-interface-and-first-steps.