DSE图数据库“是”关系表示在groovy

时间:2017-08-13 00:53:56

标签: groovy graph-databases datastax-enterprise-graph

enter image description here

我很难理解这张图。 我明白了

  

Org and Persons是顶点,'有供应商','有客户'和'有员工'是边缘,但我无法理解 “isMerchant”的含义 在附图中

名称非常直观,Org属于商家类型,

但是我如何在Groovy中表示相同的内容?

对于边缘

这样的事情
 schema.edgeLabel('Has Vendor').connection('Org',
 'Person').ifNotExists().create()

1 个答案:

答案 0 :(得分:1)

What is the link for this diagram? Based on the proximity of Merchant to Org and the colors used to denote some "meaning", it appears as if Merchant may be a Property of Org. If that's the case, then simply creating a property for Merchant and adding it to the Org vertex will provide the desired results.

If Merchant is a separate Vertex, then creating an "Is Merchant" edge like what you've described will provide the desired results.

Gremlin's DDL is used to create schema for DSE Graph - http://docs.datastax.com/en/dse/5.1/dse-dev/datastax_enterprise/graph/using/createSchemaStudio.html