-- ============================================================ -- Cypher 创建图和关系测试 -- ============================================================ -- 1. match 节点 (已知服务端单节点cypher nil pointer bug) match (n:/test/aaa/test_graph) return n.g_name, n.g_type, n.g_value /** onerror(continue) output() **/ ; -- 2. match 特定类型节点 (已知服务端单节点cypher nil pointer bug) match (a:test_graph) where a.g_type='type_a' return a.g_name, a.g_type, a.g_value /** onerror(continue) output() **/ ; -- 3. 创建关系(connect edge)(已知服务端单节点cypher nil pointer bug) match (a:test_graph), (b:test_graph) where a.g_name='node_a' and b.g_name='node_b' create (a) -[:connect]-> (b) /** onerror(continue) **/ ; -- 4. 创建更多关系 (已知服务端单节点cypher nil pointer bug) match (a:test_graph), (b:test_graph) where a.g_name='node_c' and b.g_name='node_d' create (a) -[:connect]-> (b) /** onerror(continue) **/ ; match (a:test_graph), (b:test_graph) where a.g_name='node_a' and b.g_name='node_c' create (a) -[:connect]-> (b) /** onerror(continue) **/ ; -- 5. 查询关系 match (a:test_graph) -[:connect]-> (b:test_graph) return a, b /** output() **/ ;