11create.mql 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. -- ============================================================
  2. -- Cypher 创建图和关系测试
  3. -- ============================================================
  4. match (n:/test/aaa/test_graph) return n.g_name, n.g_type, n.g_value
  5. /**
  6. onerror(continue,'unsupport single node')
  7. output()
  8. **/
  9. ;
  10. match (a:test_graph) where a.g_type='type_a' return a.g_name, a.g_type, a.g_value
  11. /**
  12. onerror(continue,'expected [ \t\r\n\f]')
  13. output()
  14. **/
  15. ;
  16. match (a:test_graph), (b:test_graph) where a.g_name='node_a' and b.g_name='node_b'
  17. /**
  18. onerror(continue,'unsupport single node')
  19. **/
  20. ;
  21. create (a) -[:connect]-> (b)
  22. /**
  23. onerror(continue,"After 'create (a) '")
  24. **/
  25. ;
  26. match (a:test_graph), (b:test_graph) where a.g_name='node_c' and b.g_name='node_d'
  27. /**
  28. onerror(continue,'unsupport single node')
  29. **/
  30. ;
  31. create (a) -[:connect]-> (b)
  32. /**
  33. onerror(continue,"After 'create (a) '")
  34. **/
  35. ;
  36. match (a:test_graph), (b:test_graph) where a.g_name='node_a' and b.g_name='node_c'
  37. /**
  38. onerror(continue,'unsupport single node')
  39. **/
  40. ;
  41. create (a) -[:connect]-> (b)
  42. /**
  43. onerror(continue,"After 'create (a) '")
  44. **/
  45. ;
  46. match (a:test_graph) -[:connect]-> (b:test_graph) return a, b
  47. /**
  48. output()
  49. **/
  50. ;