example Tinkerpop

options
	always_reload = true

schema tp = tinkerpop

constraints tpc = tinkerpop

command c1 = spawn_bitsy #note: can only have one running bitsy at a time

command c2 = exec_tinkerpop {
"g.V().drop()"
"g.addV('root').property('data',9).as('root').
  addV('node').property('data',5).as('b').
  addV('node').property('data',2).as('c').
  addV('node').property('data',11).as('d').
  addV('node').property('data',15).as('e').
  addV('node').property('data',10).as('f').
  addV('node').property('data',1).as('g').
  addV('node').property('data',8).as('h').
  addV('node').property('data',22).as('i').
  addV('node').property('data',16).as('j').
  addE('left').property('data',16).from('root').to('b').
  addE('left').from('b').to('c').
  addE('right').from('root').to('d').
  addE('right').from('d').to('e').
  addE('right').from('e').to('i').
  addE('left').from('i').to('j').
  addE('left').from('d').to('f').
  addE('right').from('b').to('h').
  addE('left').from('c').to('g')"
}

instance g = import_tinkerpop_all

#########################
# Export


schema SJava = literal : rdf {
	entities
		Employee
		Department
	foreign_keys
		manager   : Employee -> Employee
		worksIn   : Employee -> Department
		secretary : Department -> Employee
	path_equations
		Employee.manager.worksIn = Employee.worksIn
  		Department.secretary.worksIn = Department
  		Employee.manager.manager = Employee.manager
  	attributes
  		first last age : Employee -> Dom
     	name 		: Department -> Dom
}

instance IJava = literal : SJava {
	generators
		a b c : Employee
		m s : Department
	equations
		first(a) = Al
		first(b) = Bob  last(b) = Bo
		first(c) = Carl
		name(m)  = Math name(s) = CS
		age(a) = age(c)
		manager(a) = b manager(b) = b manager(c) = c
		worksIn(a) = m worksIn(b) = m worksIn(c) = s
		secretary(s) = c secretary(m) = b
		secretary(worksIn(a)) = manager(a)
		worksIn(a) = worksIn(manager(a))
		age(a) = "2"
		age(manager(a)) = "1"
}

command c3 = exec_tinkerpop {
"g.V().drop()"
}

command c4 = export_tinkerpop_instance IJava

instance h = import_tinkerpop_all {
	options 
		tinkerpop_graph_name = g #without this option, CQL will re-use g, not knowing c4 mutated bitsy
}
Keywords:

instance_literal
schema_literal
exec_tinkerpop
spawn_bitsy
import_tinkerpop_all
tinkerpop
export_tinkerop_instance
tinkerpop

Options:

tinkerpop_graph_name



instance IJava

Department
IDnamesecretary
0Math3
1CS4
Employee
IDagefirstlastmanagerworksIn
22Al?030
31BobBo30
42Carl?141


instance g

Edge
IDidlabelinout
0122df77f-eea5-40f9-bf9e-9a491b1ea896right2822
1e382bd52-c641-403a-8af4-a6295384fb06right2123
2f39966ad-678c-48dc-8819-9132d15962b0right2728
3f9f17221-d50f-4e1a-aba2-68d9891c559aleft2523
4059dabee-4d6a-4eb4-a7c9-6ec554e52cbeleft2927
54c3a9baa-a838-4277-9f3a-b76871e26b04left2422
6857e1528-fcf9-4051-8e91-007fe1ca7c06left2320
7e96bc240-8a22-4511-8fc0-12f7affa627bright2220
8234d4e4b-28c3-4e5f-9e2f-8d6b9f3320f2left2625
HasEdgeProperty
IDkeyvalueedge
9data166
HasVertexProperty
IDkeyvaluevertex
10data920
11data821
12data1122
13data523
14data1024
15data225
16data126
17data2227
18data1528
19data1629
Vertex
IDidlabel
20f83257c0-7e64-4405-9f26-94f8e2b6d66broot
21506186ca-93bd-4527-8d25-50e16cb061a5node
22ccb7be92-30eb-4ae5-80bd-3c4a050473d9node
23bf7dd5bc-f521-4474-9dba-fe78d2c14d35node
24ca0b3583-aa47-4584-aeb4-d220384359denode
25ecea1cd2-c9dd-4c77-b021-ad905d125d12node
26ebc6d084-bea3-45cd-81dd-b0e86f2d37a7node
27290602dd-12d5-4fd4-8362-c201e53fcc42node
28fd3da6c4-18b3-4557-8f75-ea321cce0058node
29391fd93c-9501-43a8-997b-d591dad0476dnode


instance h

Edge
IDidlabelinout
04f3365ab-6cc0-4f5c-b785-40376f358ec5manager2020
1b06d3178-9e26-4192-8fe5-0c05039a0293worksIn1917
26ee65a6e-8772-48f7-920e-ebbf691973ddsecretary2021
31f40c7b5-8fb9-4c84-9637-58a0a85a793cworksIn2120
470c07f1a-f9d8-4b4f-81c5-fb3fc75d8c10worksIn1918
5ed48f060-4524-41a5-9b9b-eb744506c6dasecretary1719
6ffb19776-4749-46c9-b704-9c7fedd4e533manager1717
76c757717-b97f-45dc-b6eb-8754afd41ed7manager1718
HasEdgeProperty
IDkeyvalueedge
HasVertexProperty
IDkeyvaluevertex
8lastBo17
9firstBob17
10age117
11firstAl18
12age218
13nameMath19
14firstCarl20
15age220
16nameCS21
Vertex
IDidlabel
174335a87b-1a74-4fc3-9648-610cfeef0ac2Employee
18dc690d8b-895c-49f2-8422-f36cae5f3eedEmployee
19a0161a69-4e72-495d-a01e-571a7fb18830Department
205e84041b-beb6-44fd-bfb5-748cf5dae4d1Employee
2166af2523-cada-4eb6-b93d-e0795371c0aeDepartment


command c1

Bitsy Tinkerpop-Gremlin-Groovy Server spawned: GremlinServer localhost:8182


command c2

Exec g.V().drop():
Java class: GraphTraversal
Exec g.addV('root').property('data',9).as('root').
  addV('node').property('data',5).as('b').
  addV('node').property('data',2).as('c').
  addV('node').property('data',11).as('d').
  addV('node').property('data',15).as('e').
  addV('node').property('data',10).as('f').
  addV('node').property('data',1).as('g').
  addV('node').property('data',8).as('h').
  addV('node').property('data',22).as('i').
  addV('node').property('data',16).as('j').
  addE('left').property('data',16).from('root').to('b').
  addE('left').from('b').to('c').
  addE('right').from('root').to('d').
  addE('right').from('d').to('e').
  addE('right').from('e').to('i').
  addE('left').from('i').to('j').
  addE('left').from('d').to('f').
  addE('right').from('b').to('h').
  addE('left').from('c').to('g'):
Java class: GraphTraversal
e[234d4e4b-28c3-4e5f-9e2f-8d6b9f3320f2][ecea1cd2-c9dd-4c77-b021-ad905d125d12-left->ebc6d084-bea3-45cd-81dd-b0e86f2d37a7]  [ class org.apache.tinkerpop.gremlin.structure.util.reference.ReferenceEdge]


command c3

Exec g.V().drop():
Java class: GraphTraversal


command c4

g.addV('Employee').property('first','Carl').property('age','2').as('0').addV('Employee').property('first','Bob').property('last','Bo').property('age','1').as('1').addV('Employee').property('first','Al').property('age','2').as('2').addV('Department').property('name','CS').as('3').addV('Department').property('name','Math').as('4').addE('manager').from('0').to('0').addE('worksIn').from('0').to('3').addE('manager').from('1').to('1').addE('worksIn').from('1').to('4').addE('manager').from('2').to('1').addE('worksIn').from('2').to('4').addE('secretary').from('3').to('0').addE('secretary').from('4').to('1')Exec g.addV('Employee').property('first','Carl').property('age','2').as('0').addV('Employee').property('first','Bob').property('last','Bo').property('age','1').as('1').addV('Employee').property('first','Al').property('age','2').as('2').addV('Department').property('name','CS').as('3').addV('Department').property('name','Math').as('4').addE('manager').from('0').to('0').addE('worksIn').from('0').to('3').addE('manager').from('1').to('1').addE('worksIn').from('1').to('4').addE('manager').from('2').to('1').addE('worksIn').from('2').to('4').addE('secretary').from('3').to('0').addE('secretary').from('4').to('1'):
Java class: GraphTraversal
e[ed48f060-4524-41a5-9b9b-eb744506c6da][a0161a69-4e72-495d-a01e-571a7fb18830-secretary->4335a87b-1a74-4fc3-9648-610cfeef0ac2]  [ class org.apache.tinkerpop.gremlin.structure.util.reference.ReferenceEdge]