11create.mql 887 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  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. create (a) -[:connect]-> (b)
  18. /**
  19. **/
  20. ;
  21. match (a:test_graph), (b:test_graph) where a.g_name='node_c' and b.g_name='node_d'
  22. create (a) -[:connect]-> (b)
  23. /**
  24. **/
  25. ;
  26. match (a:test_graph), (b:test_graph) where a.g_name='node_a' and b.g_name='node_c'
  27. create (a) -[:connect]-> (b)
  28. /**
  29. **/
  30. ;
  31. match (a:test_graph) -[:connect]-> (b:test_graph) return a, b
  32. /**
  33. output()
  34. **/
  35. ;