Family Tree API

Norway174
Norway174
@norway174
10 months ago
3 posts
Hey.

I'm trying to create a full tree view with all the members. And am looking into external ways of generating such tree views. Since Genosis seems to be limited to only 4 generations in the chart view.

However, I'm unable to locate the member relations data.

I'm trying to create an API that outputs the whole family tree in this type of format: https://github.com/AlexanderWillner/kingraph/blob/master/examples/simpsons.yaml

I'm able to find the profiles. As seen in the screenshot. And print that to the API I'm making. But I'm unable to get the profile relationships, such as spouses, siblings, and children.

Right now, I'm trying to create the API with the template builder, and using Javascript.
Using this method, I'm limited to only being able to display the tree as a form of widget or template.

I've also looked into creating a PHP API, with making queries to the database. But I'm even more lost by the data structure on the database.
And I don't even know how to approach that problem.

Any pointers on this would be greatly appreciated. Thank you!
updated by @norway174: 24 Oct 2021 07:42:55AM
michael
@michael
10 months ago
7,496 posts
The most control you will get is by building a module. Jamroom is VERY module centric, even the core is a module of itself.

Once you have a module created it will serve as the base for all the adjustments you want to make and will allow you to tap into the system on various levels.

Probably what you're seeing with relation to the database being confusing is that each module gets its own 'datastore' which is a special KEY => VALUE type database structure. This is access from php via the jrCore_db_get_item() function and the jrCore_db_search_items() function. and in the templates via the {jrCore_list ..... } template function.

The value of a datastore comes from its ability to add extra "columns" without having to change the database structure.

For example, the jrAudio modules purpose is to allow the user to upload audio files, it uses a datastore. Then the jrTags module comes along and adds the ability for the user to tag audio files. The jrAudio module does not need to know or care whether the jrTags module exists or not. The jrTags module can write its tags to the jrAudio modules datastore so when anyone requests an item from the audio datastore the tags come back with it.

This allows modules to stay independent of each other. You can have regular SQL tables too.

With your own module you could setup its own view to create the output you need on a url that suits you, so maybe call your module xxFullTree and have a view of view_xxFullTree_everything() which would then be viewable at:
http://YOUR-SITE.COM/fulltree/everything

Then it would just be a matter of figuring out what it is you want and in what order inside the view_xxFullTree_everything() function.

If you like I can get that module setup with the file system structure enough to turn it on and have a play with it?

--edit--
Here is the beginning of a module. Upload it to your server then activate it by going to ACP -> MODULES -> CUSTOM -> FULL TREE -> INFO

If you dont see it run an integrity check first.
zip
xxFullTree.zip  •  1KB


updated by @michael: 18 Jul 2021 07:31:16PM
michael
@michael
10 months ago
7,496 posts
Another idea is that in the ACP there is an export feature that allows you to export the entire site to a GEDCOM file. You might look to see if a converter already exist to convert from .ged to .yaml
Norway174
Norway174
@norway174
10 months ago
3 posts
Thank you for the detailed response, and the help thus far.

I did look into using the GEDCOM export functionality. However, that seems to be a manual process to export it each time.

I'm using this software for a slightly different purpose than for my own family free. And new members are added regularly, by other people.

So this tree should be able to be updated with the latest information available once someone requests the API or web-page.

It's public site, available here: https://ohm.misneden.com

Basically, it's the messy complicated family tree of a Rimworld playtrough.
The software so far has been amazingly flexible to handle all of these strange use cases. :D (Mainly the dates.)

Only thing missing in the big picture. The full tree.

I'll add your module, and have a play around with it. And see if I can make it pump out what I need. Thank you!
michael
@michael
10 months ago
7,496 posts
If you could export your .ged file and a .yaml example file I can try to duplicate your setup, that would make helping easier.

compress them to a .zip and upload them here, or if they are more private, then send them to support at jamroom dot net with a link to this thread.
Norway174
Norway174
@norway174
10 months ago
3 posts
Sorry. Seems like I won't be needed anymore. The server I was hosting this page on just bricked itself somehow. So the database got lost. (I got a backup of the website files. But I didn't back up the database.)

So I'm unfortunately going to abandon this project. Unless I can somehow magically fix my server.
But likely, I'll just have to perform a full reset / reinstall.
And I really don't wanna fill in all of those details again. ¯\_(ツ)_/¯

So for anyone else stumbling over this thread looking for the same thing in the future; good luck to you!

And thank you a lot for your help, @michael. This is definitely a super interesting software, that I'll be keeping my eye on if I ever need something like this again. :P
And sorry it took so long to get back you. Just been a little hectic, and this project took a backseat. Till I discovered the server was broken today.
michael
@michael
10 months ago
7,496 posts
That sucks, I was interested to see what you were going to build.

Time to change hosting companies if they don't provide backups.

Thanks for trying Jamroom.

Tags