如何为节点集之间的关系建模 [英] How to model relationships between sets of nodes

查看:77
本文介绍了如何为节点集之间的关系建模的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在研究对高等课程和其他此类实体(MATH101,BIOL360,BSc等)进行建模的方法,而我们正在研究的选项之一是图形数据库.除了理论上,我对图数据库不熟悉.

I am currently looking at modelling tertiary courses and other such entities (MATH101, BIOL360, BSc etc.), and one of the options we're looking at is graph databases. I am not familiar with graph databases, other than in theory.

我要建模的一件事是要求,例如"MATH201需要学生先前完成MATH101".那似乎很简单-我可以在两者之间创建一个顶点.其他则更为复杂:计算机科学学士学位要求科学论文200分或以上达到40分".

One of the things I am trying to model is requirements, for example "MATH201 requires the student previously completed MATH101". That one seems easy - I can create a vertex between the two. Others are more complicated: "Bachelor of Computer Science requires 40 points at 200 level or higher in science papers".

我想在这里做的是命名一组集合, a XY路径,并且应该完全做其他事情吗?

What I'd like to do here is name a bunch of sets, a la Neo4J Labels, then create a relationship from one of the nodes to the set of nodes described in the labels, but I can't see a way to do this. Is this something that's possible in graph databasing engines, or am I basically running down an XY path, and should be doing something else entirely?

我标记Neo4J是因为我倾向于Neo4J,因为据我所知,它是最广为人知/使用的图dbms,但是我也愿意接受其他数据库中的解决方案(实际上,如果在全新的SQL Server产品中,这可能是理想的选择,因为其他基础结构都在上面.

I've tagged Neo4J because I'm leaning towards it as (from what I can tell) it's the most widely known/used graph dbms, but I'm open to solutions in other databases too (in fact, if it's possible in the very new SQL Server offering, that would probably be ideal as other infrastructure is on that).

推荐答案

首先,我认为您可以在"MATH201"和"MATH101"之间建立:REQUIREMENT关系.

Well, in the fist case, I think you can make a :REQUIREMENT relationship between "MATH201" and "MATH101".

在第二种情况下,您可以在计算机科学学士"节点和一个中间节点之间建立:REQUIREMENT关系,以对所有科学论文进行分组,如下图所示.另外,您可以将一些额外的属性放在与课程所要求的类型之间的关系中:

In the second case you can make a :REQUIREMENT relationship between "Bachelor of Computer Science" node and an intermediate node to group all science papers, as in the image below. Also, you can put some extra properties in the relationship to what type of requirement the course has:

这篇关于如何为节点集之间的关系建模的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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