Ver Fonte

cypher return

wecisecode há 1 semana atrás
pai
commit
4755dc111d

+ 6 - 0
odbctest/mql/basic/01clear/1_delete_all_test_data.mql

@@ -443,6 +443,12 @@ onerror(continue,`not exist`,`not find`,`not found`)
 **/
 ;
 
+delete from /test/cypher1 with version
+/**
+onerror(continue,`not exist`,`not find`,`not found`)
+**/
+;
+
 delete from /test/cypher2 with version
 /**
 onerror(continue,`not exist`,`not find`,`not found`)

+ 4 - 2
odbctest/mql/basic/01clear/2_drop_all_test_class.mql

@@ -67,8 +67,6 @@ drop class if exists /test/buckettsdb64 ;
 
 drop class if exists /test/cypher
 ;
-drop class if exists /test/cypher3
-;
 drop class if exists /test/cypher9
 ;
 drop class if exists /test/cypher8
@@ -81,8 +79,12 @@ drop class if exists /test/cypher6
 ;
 drop class if exists /test/cypher4
 ;
+drop class if exists /test/cypher3
+;
 drop class if exists /test/cypher2
 ;
+drop class if exists /test/cypher1
+;
 drop class if exists /test/interface ;
 
 drop class if exists /test/malert_status_memdb ;

+ 176 - 0
odbctest/mql/basic/17_cypher_return/10class.mql

@@ -0,0 +1,176 @@
+
+create edge type if not exists connect "connect"
+;
+
+create class if not exists /test() with namespace="test"
+;
+
+delete from /test/cypher with version
+/**
+onerror(continue)
+noerrinfo()
+**/
+;
+
+delete from /test/cypher1 with version
+/**
+onerror(continue)
+noerrinfo()
+**/
+;
+
+delete from /test/cypher2 with version
+/**
+onerror(continue)
+noerrinfo()
+**/
+;
+
+delete from /test/cypher3 with version
+/**
+onerror(continue)
+noerrinfo()
+**/
+;
+
+delete from /test/cypher4 with version
+/**
+onerror(continue)
+noerrinfo()
+**/
+;
+
+delete from /test/cypher5 with version
+/**
+onerror(continue)
+noerrinfo()
+**/
+;
+
+delete from /test/cypher6 with version
+/**
+onerror(continue)
+noerrinfo()
+**/
+;
+
+delete from /test/cypher7 with version
+/**
+onerror(continue)
+noerrinfo()
+**/
+;
+
+delete from /test/cypher8 with version
+/**
+onerror(continue)
+noerrinfo()
+**/
+;
+
+delete from /test/cypher9 with version
+/**
+onerror(continue)
+noerrinfo()
+**/
+;
+
+drop class if exists /test/cypher
+;
+
+drop class if exists /test/cypher9
+;
+
+drop class if exists /test/cypher8
+;
+
+drop class if exists /test/cypher7
+;
+
+drop class if exists /test/cypher5
+;
+
+drop class if exists /test/cypher6
+;
+
+drop class if exists /test/cypher4
+;
+
+drop class if exists /test/cypher3
+;
+
+drop class if exists /test/cypher2
+;
+
+drop class if exists /test/cypher1
+;
+
+/**
+sleep(1s)
+**/
+;
+
+create edge type if not exists test.connect
+;
+
+create class if not exists /test/cypher1 (
+		name		varchar,		
+		keys(name)
+	)with key=manu and nickname='cypher1'
+;
+
+create class if not exists /test/cypher2 (
+
+		name		varchar,		
+		keys(name)
+	)with key=manu and nickname='cypher2'
+;
+
+create class if not exists /test/cypher3 (
+
+		name		varchar,		
+		keys(name)
+	)with key=manu and nickname='cypher3'
+;
+
+create class if not exists /test/cypher4 (
+
+		name		varchar,		
+		keys(name)
+	)with key=manu and nickname='cypher4'
+;
+
+create class if not exists /test/cypher5 (
+
+		name		varchar,		
+		keys(name)
+	)with key=manu and nickname='cypher5'
+;
+
+create class if not exists /test/cypher6 (
+
+		name		varchar,		
+		keys(name)
+	)with key=manu and nickname='cypher6'
+;
+
+create class if not exists /test/cypher7 (
+
+		name		varchar,		
+		keys(name)
+	)with key=manu and nickname='cypher7'
+;
+
+create class if not exists /test/cypher8 (
+
+		name		varchar,		
+		keys(name)
+	)with key=manu and nickname='cypher8'
+;
+
+create class if not exists /test/cypher9 (
+
+		name		varchar,		
+		keys(name)
+	)with key=manu and nickname='cypher9'
+;

+ 12 - 0
odbctest/mql/basic/17_cypher_return/11data.mql

@@ -0,0 +1,12 @@
+
+/**
+scope(file)
+loop(9)
+**/
+;
+
+insert into /test/cypher{%d,mqli} (id, name) values ("cypher{%d,mqli}:e{%d,mqli}{%d,filei}", "e{%d,mqli}{%d,filei}" )
+/**
+loop(9)
+**/
+;

+ 33 - 0
odbctest/mql/basic/17_cypher_return/12data.mql

@@ -0,0 +1,33 @@
+
+create ("cypher1:e11")-[:connect]->("cypher2:e21")
+;
+create ("cypher1:e11")-[:connect]->("cypher3:e31")
+;
+create ("cypher2:e21")-[:connect]->("cypher3:e31")
+;
+
+create ("cypher1:e11")-[:connect]->("cypher2:e22")
+;
+create ("cypher1:e11")-[:connect]->("cypher3:e32")
+;
+create ("cypher2:e22")-[:connect]->("cypher3:e32")
+;
+
+match (a:"cypher1:*")-[:connect]->(b:"cypher2:*"),
+(a:"cypher1:*")-[:connect]->(c:"cypher3:*"),
+(b:"cypher2:*")-[:connect]->(c:"cypher3:*")
+/**
+output()
+match("graph.nodes.len",5,"graph.edges.len",6)
+**/
+;
+
+match (a:"cypher1:*")-[:connect]->(b:"cypher2:*"),
+(a:"cypher1:*")-[:connect]->(c:"cypher3:*"),
+(b:"cypher2:*")-[:connect]->(c:"cypher3:*")
+return a.name, b.name, c.name
+/**
+output()
+count(2)
+**/
+;

+ 19 - 3
odbctest/mql/basic/17cypher/10class.mql

@@ -12,6 +12,13 @@ noerrinfo()
 **/
 ;
 
+delete from /test/cypher1 with version
+/**
+onerror(continue)
+noerrinfo()
+**/
+;
+
 delete from /test/cypher2 with version
 /**
 onerror(continue)
@@ -71,9 +78,6 @@ noerrinfo()
 drop class if exists /test/cypher
 ;
 
-drop class if exists /test/cypher3
-;
-
 drop class if exists /test/cypher9
 ;
 
@@ -92,9 +96,15 @@ drop class if exists /test/cypher6
 drop class if exists /test/cypher4
 ;
 
+drop class if exists /test/cypher3
+;
+
 drop class if exists /test/cypher2
 ;
 
+drop class if exists /test/cypher1
+;
+
 /**
 sleep(1s)
 **/
@@ -109,6 +119,12 @@ create class if not exists /test/cypher (
 	)with key=manu and nickname='cypher'
 ;
 
+create class if not exists /test/cypher1 (
+		name		varchar,		
+		keys(name)
+	)with key=manu and nickname='cypher1'
+;
+
 create class if not exists /test/cypher2 (
 
 		name		varchar,