00init.mql 773 B

123456789101112131415161718192021222324252627282930
  1. -- 15cypher 目录初始化:Cypher 图操作测试
  2. create class if not exists /test/aaa/test_graph (
  3. g_name varchar,
  4. g_type varchar,
  5. g_value int,
  6. indexes(g_name, g_type),
  7. keys(g_name)
  8. )
  9. ;
  10. create edge type if not exists /test/aaa/connect
  11. ;
  12. -- 插入图节点数据
  13. insert into /test/aaa/test_graph (g_name, g_type, g_value) values ('node_a', 'type_a', 10)
  14. ;
  15. insert into /test/aaa/test_graph (g_name, g_type, g_value) values ('node_b', 'type_a', 20)
  16. ;
  17. insert into /test/aaa/test_graph (g_name, g_type, g_value) values ('node_c', 'type_b', 30)
  18. ;
  19. insert into /test/aaa/test_graph (g_name, g_type, g_value) values ('node_d', 'type_b', 40)
  20. ;
  21. insert into /test/aaa/test_graph (g_name, g_type, g_value) values ('node_e', 'type_c', 50)
  22. ;