家谱图数据库 [英] graph database for genealogy

查看:787
本文介绍了家谱图数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人可能指我使用图谱数据库的家谱吗?我想学习neo4j和我使用python所以我正在寻找一个家谱图db为自己学习图db。我搜索的例子来模拟和学习(任何图形db,任何语言),但惊讶我发现了多少。

注意我的意思是图db有不同的结构比关系数据库。请参见的一些信息,这是有帮助的。



也就是说,最好的解决方案可能涉及neo4j,但 Rexster for如果您想轻松在多个数据库之间切换,则需要联网应用程序或蓝图最好的数据库在性能方面为您的usecase。直接使用neo4j服务器的唯一原因是能够使用密码查询语言



如果我不得不创建一个家谱webapp并构建一个业务,我会使用我已经建立的软件,即: / p>



这些文件尚未准备就绪。但这是我会做的。


could someone point me to a working use of a graph database for genealogy? I would like to learn neo4j and I use python so I was looking to make a genealogy graph db for myself to learn graph db's. I searched for examples to emulate and learn from (any graph db, any language) but was surprised how little I found.

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

I'm looking for an example schema for genealogy.

解决方案

If you want to learn to do graphdb, you don't need to use any software. Pencil, paper and brain will do. The things you need to have in mind to come up with a design are:

  • What is a graph: vertex & edges
  • What is specific about the graphdb datastructure: vertex & edges are associated with a python-like dict.
  • What informations needs to be in the graphdb to solve the problem I have at hand. List all the queries you want to be able to do against the graph.

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

You have to imagine that every node has a name, date of birth, etc... and a unique identifier.

It represents two disconnected families, at left one with two children, at right one with three children.

With the above graph you could compute:

  • Who is the parent of X?
  • What is name of the father part of the biggest family?

And others, since there is only two family with only parent & child, no grand parents or grand childs represented you might not be able to understand that actually you could also compute the following query:

  • Who are the people that have X as ancestor that are still alive?

Now if you want to go and experiment with Python you have several choices starting with the easier setup:

Pure python:

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

Python and BerkleyDB

  • disclaimer: this is a project of mine
  • Same as the pure Python version, except the graph is saved in a database. The API is similar the neo4j python bindings.

They are other solutions, but without more context about the target application (e.g. web or desktop) I can not list them all. They are some informations on neo4j website which can be helpful.

That said, the best solution might involve neo4j, but Rexster for a networked application or Blueprints for others are required if you want to easly switch between several database to find the best database in terms of performance for your usecase. The only reason to use directly a neo4j server is to be able to use cypher query language.

If I had to create a genealogy webapp and build a business out of it I would use softwares that I've built, namely:

Those are not ready for production as-is. But that's what I would do.

这篇关于家谱图数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆