A new project, gramps-connect, and more

I’ve been working on Gramps performance improvements for many years. Finally, I have found a solution that solves a few issues. First, let me tell you about gramps-object-query-language (or GOQL for short):

GOQL is a Python-like way of writing queries. It might be familiar to Gramps developers (with some tweaks), and might be very foreign to regular users. But it is very powerful for finding what you want in a succinct form. It uses Python syntax, but in some places it alters the Python semantics.

In a Person view context, you could enter gender == Person.MALE to find all of the males. This is also what you enter as a Gramps Python developer.

But you can also enter in the Family view context any(child for child in children if "Steve" in child.given_name) to find families with children named β€œSteve”.

But the best part: if the system can, it will execute the search in SQL. Superfast for even large trees. It automatically will create JOINS where needed, for example:

  • Family mother β†’ Person
  • Family father β†’ Person
  • Person birth β†’ Events

Recursively, through links from one object to another.

Ok, but how to use it? In Gramps 6.1 it is a new filter. You can enter these expressions, and instantly find the matching items (a filter for every view). To make the filter system easier to use, it has TAB completion, so you don’t need to remember all of the parts of each thing.

You can also turn these expressions into a Custom Filter, so you can use them throughout the rest of Gramps. (Advanced developers know that you can NOT run a SQL query when you have a proxy (like private or probably-alive) active. GOQL falls back to regular db access in that case. Slower, but still useful).

But wait, there’s more. The plan is to include GOQL in gramps-web-api so that any web app could take advantage of it. In fact, it supports paged-results (don’t get all 100k people, just the first page), and sorting with collation.

And the big endgame is a new implementation of Gramps, written from scratch, with two major goals:

  1. Fast access for large family trees β€” works on small ones too
  2. Real-time collaboration β€” users can work together on creating a family tree

This is currently a research experiment, testing out all of the components. Here is a screen shot:

I’ve made some decisions that are different from those made in gramps-web, including: use React for the frontend, TypeScript first, use SQL whenever possible, and exploiting Gramps 6 JSON data. But it also will support the same database API (SharedPostgreSQL) that the rest of the Gramps projects use.

Here is the github repo:

I’m also planning for this to function as a desktop app. It will be a long time before gramps-connect catches up with its siblings. But tell me where you’d like to see it go, and join in the development if you like. Ideas welcome in the issue tracker

4 Likes

I’m thinking of staying closer to the Gramps desktop layout, look, and feel:

Dark mode:

Light mode:

3 Likes

Do you like an adventure? Do you want to try an alpha version of a new version of using Gramps code and data? Do you want to help a future version of Gramps? Then this is for you!

ALPHA ALPHA ALPHA ALPHA ALPHA ALPHA ALPHA ALPHA

If you run Mac, Windows, or Linux, you can find instructions for trying gramps-connect here:

Hopefully, when you start it, you can log into a webpage with:

Username: admin, Password: admin

Try http://127.0.0.1:5050/#/person/GNUJQCL9MD64AM56OH to get to the home person.

Basic philosophy: each view is divided into three parts: the list (left-hand side), the related data (top right), and the links (bottom right). This is read-only for the moment, but 100% of the data should be represented.

I’d be interesting in hear:

  1. Does this work? If not what errors so you see in the console?
  2. If it does work for you, do you understand the logic and flow of the program?
  3. What would you like to see?
  4. What do you not like?

I appreciate any and all feedback.

If it works, try some of these queries:

1 Like

We have a question from one of our translators on Weblate asking how the string β€œPeople matching the <GOQL expression>” should be translated.

1 Like

Answered! For those those wondering, GOQL is an acronym for Gramps Object Query Language.

2 Likes

Yes on Win10/64.

I do.

Support for regular expressions is critical for me. Without that don’t count on me …:wink:

The widths of the columns appear to be reset to a default value each time a view is displayed.

Summary: great work Doug! I’d really like to test it with my 85k database that forces me to stay on Gramps 5.1.6 on BSDDB since all Gramps 6 versions with SQL databases are way too slow with the existing frontend code base.

1 Like

Thank you for taking the time to test this; the fact that it works at all is a huge step in the development!

To say thank you, I will address the items you mention ASAP. I’ll add upload next so that you can try your big tree. The speed of gramps-connect is made possible by the 6.0 JSON changes, so perhaps that will finally pay off for you.

Beta testers get first dibs on feature requests :grinning_face:

2 Likes

Maybe a basic requirement.md file or CONFIG information?
I know that it could fail under my configuration! Anyway, just for the traceback and return:

./gramps-connect-demo
[PYI-22611:ERROR] Failed to load Python shared library 
'/../gramps-connect-demo-linux/_internal/libpython3.12.so.1.0':
 /lib/x86_64-linux-gnu/libm.so.6: version `GLIBC_2.38' not found
 (required by /../gramps-connect-demo-linux/_internal/libpython3.12.so.1.0)
[..]
$ ldd (Ubuntu GLIBC 2.27-3ubuntu1.6) 2.27

Sure, might run on Docker.
eg., AI returns:

docker run -it --rm -v $(pwd):/app ubuntu:24.04 bash -c 
"apt update && apt install -y 
./gramps-connect-demo-linux 
&& ./gramps-connect-demo"

sorry, in french

Solution ComplexitΓ© Risque Recommandation
Mettre Γ  jour l’OS :star::star: Faible :white_check_mark: Oui
Utiliser Docker :star::star::star: Aucun :white_check_mark: Si mise Γ  jour impossible
Forcer l’installation de GLIBC :star::star::star::star: Γ‰levΓ© :cross_mark: Non

Thanks for testing. This was just a one-off, all-in-one quick test. Ironically, it probably works better on Mac and Windows than Linux. In any event, I’ll have a docker-based system ready shortly.

1 Like

I’ve added:

  • persistent column sizing
  • regex support

The regex is a subset of Python regex, and can work in Python, SQLite, and PostgreSQL.

Some examples can be found here: gramps-object-query-language/README-query-language.md at main Β· dsblank/gramps-object-query-language Β· GitHub

I’ll try to get a demo site up soon, and update the demo-test.

1 Like

You’re making an offer I can’t refuse Don Vito :wink:

The demo is read-only of course, but to you plan to include write capabilities down the road?

1 Like

Well, I may end up with a horse head in my bed, but I will do my best :smile:

I’ll make a real ROADMAP soon, but briefly:

  1. Read-only version that can display and search all data, using SQL where possible
  2. Allow near real-time updates, and tools for collaborators to effectively work together
  3. Add import
  4. Add export and reports
  5. Add the rest (maps, timeline, history, graphs, etc)
  6. Add edit ability

@Urchello (and others) what is a convenient form for you to get your family tree in:

  • GEDCOM
  • Gramps XML
  • Any format that Gramps 5 supports
  • Any format that Gramps 6 supports
  • Other
0 voters

I am wondering because if I need to spend time making some of the importers faster.

1 Like

Could you keep a Read Only mode?

I would like the ability to let a visiting relative sit down to explore with Gramps without having to monitor that they don’t mangle the tree.

Yes, and in fact we will use all of the roles and permissions in gramps-web-api. It defines seven role levels and a permission system layered on top of them, all in gramps_webapi/auth/const.py.

Roles (integer levels, higher = more access):

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”
β”‚       Role       β”‚ Value β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€
β”‚ ROLE_ADMIN       β”‚ 5     β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€
β”‚ ROLE_OWNER       β”‚ 4     β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€
β”‚ ROLE_EDITOR      β”‚ 3     β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€
β”‚ ROLE_CONTRIBUTOR β”‚ 2     β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€
β”‚ ROLE_MEMBER      β”‚ 1     β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€
β”‚ ROLE_GUEST       β”‚ 0     β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€
β”‚ ROLE_DISABLED    β”‚ -1    β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€
β”‚ ROLE_UNCONFIRMED β”‚ -2    β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”˜

ROLE_DISABLED/ROLE_UNCONFIRMED are sentinel states for unauthorized accounts, not part of the permission ladder.

Permissions accumulate up the ladder β€” each role inherits everything from the role below and adds more:

  • Guest β€” EditOwnUser only
  • Member β€” adds ViewPrivate
  • Contributor β€” adds AddObject
  • Editor β€” adds EditObject, DeleteObject, EditNameGroup, EditCustomFilter
  • Owner β€” adds user management (AddUser, DeleteUser, EditOtherUser, EditUserRole, ViewOtherUser), ImportFile, TriggerReindex, EditTree, RepairTree, UpgradeSchema, EditTreeMinRoleAI, BatchDeleteObjects
  • Admin β€” adds multi-tree/site-wide powers: cross-tree user management (AddOtherTreeUser, ViewOtherTreeUser, EditOtherTreeUser, EditOtherTreeUserRole, DeleteOtherTreeUser, EditUserTree), MakeAdmin, ViewSettings, EditSettings, ViewOtherTree, EditOtherTree, EditTreeQuota, AddTree, DisableTree

One special case: PERM_USE_CHAT isn’t baked into the static ladder. It’s granted dynamically in get_permissions() (gramps_webapi/auth/init.py:420) β€” a tree has a configurable min_role_ai threshold, and any user whose role meets or exceeds it gets chat access for that tree.

1 Like

I’m not sure if my preferences for importers should be your guideline since I live in a 100 % Gramps universe. Consequently the only import I currently care about is the Gramps XML import but at the end of the road I envision a solution where I can directly update the database tables in the background without caring about the import stuff.

Ok, I guess that was the horse head stuff :wink:

1 Like

Updates on gramps-connect, version 0.2.0 beta. Faster, some editing, reports, exports, imports, maps, timeline, and more!

Regex now included. I added this to the gramps-object-query-language as well, so you can also use them via the gramps desktop addon GOQLFilter, but can’t be used until Gramps 6.1 is released as it requires additional packages.

Good news; bad news on the 85k database front. I tried to import a 100k person Gramps XML (into any of the gramps products) and I had to kill it after 20 hours! However, after some work, I got that down to 12 minutes in gramps-web-api! We’ll get that enhancement included either in gramps, or gramps-web, and gramps-connect. See discussion here:

Want to try out the new stand-alone version of gramps-connect (Windows, MacOS, or Ubuntu latest)? Download it here:

For those of you that want to try gramps-connect out on a server, checkout the docker image:

This might work very well on a RaspberryPi as it has a small size. And it should work well on any server.

I’ll post details about some of the design decisions that make gramps-connect different from gramps-web this weekend.

2 Likes

A post was split to a new topic: Understanding servers on localhost

I downloaded the gramps-connect-demo-macos.zip and tried to run it on my Intel based iMac. Unfortunately I got this error message: bad CPU type in executable: ./gramps-connect-demo

Would it be possible to make a gramps-connect-demo-macos-intel.zip version?

1 Like