11create.mql 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. -- ============================================================
  2. -- Cypher 创建图和关系测试
  3. -- ============================================================
  4. -- 1. match 节点 (已知服务端单节点cypher nil pointer bug)
  5. match (n:/test/aaa/test_graph) return n.g_name, n.g_type, n.g_value
  6. /**
  7. onerror(continue)
  8. output()
  9. **/
  10. ;
  11. -- 2. match 特定类型节点 (已知服务端单节点cypher nil pointer bug)
  12. match (a:test_graph) where a.g_type='type_a' return a.g_name, a.g_type, a.g_value
  13. /**
  14. onerror(continue)
  15. output()
  16. **/
  17. ;
  18. -- 3. 创建关系(connect edge)(已知服务端单节点cypher nil pointer bug)
  19. match (a:test_graph), (b:test_graph) where a.g_name='node_a' and b.g_name='node_b'
  20. create (a) -[:connect]-> (b)
  21. /**
  22. onerror(continue)
  23. **/
  24. ;
  25. -- 4. 创建更多关系 (已知服务端单节点cypher nil pointer bug)
  26. match (a:test_graph), (b:test_graph) where a.g_name='node_c' and b.g_name='node_d'
  27. create (a) -[:connect]-> (b)
  28. /**
  29. onerror(continue)
  30. **/
  31. ;
  32. match (a:test_graph), (b:test_graph) where a.g_name='node_a' and b.g_name='node_c'
  33. create (a) -[:connect]-> (b)
  34. /**
  35. onerror(continue)
  36. **/
  37. ;
  38. -- 5. 查询关系
  39. match (a:test_graph) -[:connect]-> (b:test_graph) return a, b
  40. /**
  41. output()
  42. **/
  43. ;