neo4j 图数据库中的元数据 [英] Metadata in neo4j graph database

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

问题描述

我知道 neo4j 以图形而非表格的形式存储数据.在 RDBMS 中,我们将拥有表的架构,但在 neo4j 中,我们将没有表.只定义了节点、关系和属性.那么neo4j 中是否有metadata 的概念.像数据库中是否存储了有关节点、关系的任何信息?如果是,它如何以及在元数据中存储什么?还有哪里可以找到图数据库中元数据相关的信息(位置)

I know that neo4j stores data structured in graphs rather than in tables. In RDBMS we will be having schemas of the tables but in neo4j we will not be having the tables. Only nodes, relations and properties are defined. So is there any concept of metadata in neo4j. Like is there any information stored about nodes, relationships in the database? If yes, how and what it stores in the metadata? Also where can we find the metadata related information in the graph database (location)

谢谢,

推荐答案

Neo4J 不会以您正在寻找的方式直接存储元数据.NeoProfiler 工具正是为此目的而编写的.你可以在 Neo4J 数据库上运行它,它会尽可能多地提取关于标签、索引、约束、属性、节点和关系的信息.这种工作方式与@ulkas 在另一个答案中建议的查询相去甚远,输出要好得多.

Neo4J doesn't directly store metadata in the way that you're looking for. The NeoProfiler tool was written precisely for this purpose. You can run it on a Neo4J database, and it will pull out as much information on labels, indexes, constraints, properties, nodes, and relationships as it can. The way that this works isn't too far off of the queries that @ulkas suggests in the other answer here, the output is just much better.

更广泛地说,在 RDBMS 中,您提取的模式信息会极大地限制数据库.那里的模式就像一组规则;除非符合该架构,否则您无法插入数据.在 Neo4J 中,因为它非常灵活,即使有一个架构,它也只是对那里内容的文档,它不会是对您可以放入的内容的一组约束.您可以随时插入没有任何内容的新数据与当前架构有关(除了您不能违反唯一性约束之类的东西).

More broadly, in an RDBMS the schema information you pull out substantially constrains the database. The schema there is like a set of rules; you can't insert data unless it conforms to that schema. In Neo4J, because it's so flexible, even if there was a schema it would just be documentation of what's there, it would not be a set of constraints on what you can put in. At any time, you can insert new data that has nothing to do with the present schema (except that you can't violate things like uniqueness constraints).

如果您想在 neo4j 中查看数据库的等效模式,请查看上面链接的 neoprofiler.一些人写过关于元图"的文章——也就是说,他们谈论将一个 neo4j 模式表示为一个图本身,例如一个节点指的是一个标签.来自那个标签节点"的关系然后传到其他类型的标签节点,指定节点之间可以存在什么样的关系.例如,标记为Employee"的节点可能经常与标记为Company"的节点具有works_for"关系.

If you want to see an equivalent schema for your database in neo4j, check out neoprofiler linked above. A few people out there have written about "metagraphs" - that is, they talk about representing a neo4j schema as a graph itself, where for example a node refers to a label. Relationships from that "label node" then go out to other kinds of label nodes, specifying what sorts of relationships can exist between nodes. For example, nodes labeled "Employee" may frequently have "works_for" relationships to nodes of label "Company".

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

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