Neo4j(或任何其他图形数据库)建模 [英] Neo4j (or any other graph database) modeling

查看:77
本文介绍了Neo4j(或任何其他图形数据库)建模的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我开始使用图形数据库,在我们的团队中,我们已经开始为我们的软件建模图形.当我们尝试记录"模型以查看数据库的结构时,问题就来了.使用SQL数据库,您只需查看SQL模式.

I'm starting to work with graph databases, and in my team we've started modeling a graph for our software. The problem comes when we try to "document" the model, to see the structure of our database. With SQL databases you only have to look at the SQL schema.

我们已经花了一些时间阅读neo4j博客和文档,但是我们已经看到,显示图形工作原理的通常方法是使用显示一些示例数据的最小图形(随机示例:

We've spent some time reading neo4j blogs and documentation, but we've seen that the usual way to show how a graph works is with a minimal graph showing some sample data (Random samples: sample1, sample2, etc). That's great for educational purposes, but we'd love to be able to do it in a little more formal way. We'd like to set what kind of node can relate with another one, and with what kind of relationship, that kind of stuff.

使用Spring,您可以使用类包装图形,但是它非常特定于Java和OO模型,并且我们正在使用Erlang.我们正在寻找某种形式的语言(等效于SQL Schema),等效于E-R模型或类似的东西.

Using Spring you can wrap the graph with classes, but it's very specific to Java and OO model, and we're working with Erlang. We're looking for some kind of formal language (SQL Schema equivalent), or a E-R model equivalent, or something like that.

推荐答案

一种方法是将图形的元模型"(类型网络)也放入图形中,然后连接实例(节点)为其元模型类型.因此,您可以使用图形可视化来可视化元模型,同时使用元模型来实施其他约束(通过将约束信息存储在元模型中并在实际模型更新时使用该约束信息),并且还可以使用元模型的类型节点,以快速访问此类型的所有实例"节点.

One way to do this is to put the "meta-model" of your graph (a type network) in the graph as well and then connect the instances (nodes) to their meta-model-type. So you can visualize the meta-model using the graph visualization and at the same time use the meta-model to enforce additional constraints (by storing constraint information in the meta-model and using that when the actual model is updated) and also use the type-nodes of the meta-model to quickly access all "instance"-nodes of this type.

您要建模的域是什么?

这篇关于Neo4j(或任何其他图形数据库)建模的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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