assertFalse(tx.containsVertexLabel("person")); assertFalse(tx.containsVertexLabel("person")); assertFalse(tx.containsRelationType("value")); assertNull(tx.getPropertyKey("value")); PropertyKey value = tx.getOrCreatePropertyKey("value"); assertNotNull(value); assertTrue(tx.containsRelationType("value")); TitanVertex v = tx.addVertex("person"); assertTrue(tx.containsVertexLabel("person")); assertEquals("person", v.label()); assertFalse(tx.containsRelationType("knows")); Edge e = v.addEdge("knows", v); assertTrue(tx.containsRelationType("knows")); assertNotNull(tx.getEdgeLabel(e.label())); assertTrue(tx.containsRelationType("value")); assertTrue(tx.containsVertexLabel("person")); assertTrue(tx.containsRelationType("knows")); v = getV(tx, v);
assertTrue(tx.containsRelationType("knows")); assertTrue(tx.containsRelationType("weight")); EdgeLabel knows = tx.getEdgeLabel("knows"); PropertyKey weight = tx.getPropertyKey("weight");
tx = graph.buildTransaction().groupName(metricsPrefix).start(); assertTrue(tx.containsRelationType("name")); assertTrue(tx.containsRelationType("knows")); assertTrue(tx.containsVertexLabel("person")); PropertyKey name = tx.getPropertyKey("name");
assertFalse(tx.containsRelationType("value")); assertNull(tx.getPropertyKey("value")); PropertyKey value = tx.getOrCreatePropertyKey("value"); assertNotNull(value); assertTrue(tx.containsRelationType("value")); TitanVertex v = tx.addVertexWithLabel("person"); assertTrue(tx.containsVertexLabel("person")); assertEquals("person",v.getLabel()); assertFalse(tx.containsRelationType("knows")); Edge e = v.addEdge("knows",v); assertTrue(tx.containsRelationType("knows")); assertNotNull(tx.getEdgeLabel(e.getLabel())); assertTrue(tx.containsRelationType("value")); assertTrue(tx.containsVertexLabel("person")); assertTrue(tx.containsRelationType("knows")); v = tx.getVertex(v.getLongId());
assertTrue(tx.containsRelationType("knows")); assertTrue(tx.containsRelationType("weight")); EdgeLabel knows = tx.getEdgeLabel("knows"); PropertyKey weight = tx.getPropertyKey("weight");
tx = graph.buildTransaction().setGroupName(metricsPrefix).start(); assertTrue(tx.containsRelationType("name")); assertTrue(tx.containsRelationType("knows")); assertTrue(tx.containsVertexLabel("person")); PropertyKey name = tx.getPropertyKey("name");