Genealogy Graphic Database

can someone point me to using a graphic database for genealogy? I would like to learn neo4j, and I use python, so I was looking to generate a db genealogy graph for myself to find out the db graph. I was looking for examples to emulate and study (any db plot, any language), but was surprised how little I found.

Note. I mean a db graph that has a different structure than relational db. See http://en.m.wikipedia.org/wiki/Graph_database .

I am looking for an example of a genealogy scheme.

+4
source share
2 answers

If you want to learn how to make graphdb, you do not need to use any software. Pencil, paper and brain will do. What you need to keep in mind in order to come up with a design:

  • What is a graph: vertex and edges
  • What is typical of datastructure graphdb: the top and edges are associated with a python-like dict.
  • What information should be in the schedule to solve the problem that I have at hand. A list of all the requests you want to make against the schedule.

In the diagram below, you will see a graph that may be the basis of your design.

naked graph that can be used to do genealogy queries

You should imagine that each node has a name, date of birth, etc ... and a unique identifier.

He represents two unrelated families, one with two children on the left, one with three children on the right.

With the above chart, you can calculate:

  • Who is the parent of X?
  • What is the paternal part of the largest family called?

And others, since there are only two families with parents and children, no impressive parents or impressive children could understand that in fact you could also calculate the following query:

  • Who are people who have X as an ancestor who are still alive?

Now, if you want to go and experiment with Python, you have several options, starting with a simpler setup:

Pure Python:

  • Create a vertex class and an Edge class that inherits a dict.
  • Create a genealogy graph with Python code from real data or else.
  • Query Experiment.

Python and BerkleyDB

  • disclaimer: this is my project
  • The same as a pure version of Python, except that the graph is stored in the database. The API is similar to python neo4j bindings.

These are other solutions, but without additional context about the target application (for example, on the Internet or on the desktop) I cannot list them. This is neo4j website information that might be helpful.

However, neo4j might be the best solution, but Rexster for a network application or Blueprints for others is required if you want to easily switch between multiple databases to find the best database in terms of performance for your user. The only reason to use the neo4j server directly is to use the cypher query language .

If I had to create a webapp genealogy and build a business, I would use the software that I created, namely:

Those are not ready for production as is. But this is what I will do.

+1
source

If you want to use a fast database without a server (and without a JVM) . I suggest you try the new Sparksee (formally Dex) python binding. However, the raw API is not migrated. Performance, however, is an order of magnitude faster.

The second option is to use Bulbs , which runs on top of Neo4j via the REST api, and also supports any Rexsters server. The query language is Gremlin (Cypher also works). The good point is that you can switch to another backend if it better suits your needs.

As for your DB schema, you have at least 1 node and 1 edge:

1 node: MAN (name, birth, death), which are indexed fields.

1 directional limited edge from PERSON to a person named CHILD_OF or PARENT_OF.

You can add more edges between nodes, such as: SIBLINGS, MARRIED_TO, etc.

0
source

Source: https://habr.com/ru/post/1436795/


All Articles