assertEquals("person", vl.name()); assertTrue(mgmt.containsGraphIndex("timeIndex")); JanusGraphIndex graphIndex = mgmt.getGraphIndex("timeIndex"); mgmt.changeName(graphIndex, "byTime"); assertFalse(mgmt.containsVertexLabel("people")); assertTrue(mgmt.containsGraphIndex("byTime")); assertFalse(mgmt.containsGraphIndex("timeIndex"));
assertTrue(mgmt.containsGraphIndex("prop1")); assertFalse(mgmt.containsGraphIndex("prop3")); assertEquals(2, Iterables.size(mgmt.getGraphIndexes(Edge.class))); assertEquals(2, Iterables.size(mgmt.getGraphIndexes(JanusGraphVertexProperty.class))); assertTrue(mgmt.containsGraphIndex("prop1")); assertFalse(mgmt.containsGraphIndex("prop3")); assertEquals(2, Iterables.size(mgmt.getGraphIndexes(Edge.class))); assertEquals(2, Iterables.size(mgmt.getGraphIndexes(JanusGraphVertexProperty.class)));
assertTrue(mgmt.containsGraphIndex("index1")); assertFalse(mgmt.containsGraphIndex("index")); assertCount(3, mgmt.getGraphIndexes(Vertex.class)); assertNull(mgmt.getGraphIndex("indexx")); assertTrue(mgmt.containsGraphIndex("index1")); assertFalse(mgmt.containsGraphIndex("index")); assertCount(3, mgmt.getGraphIndexes(Vertex.class)); assertNull(mgmt.getGraphIndex("indexx"));
protected void createSchema(JanusGraph graph) { JanusGraphManagement mgmt = graph.openManagement(); if (!mgmt.containsGraphIndex(COMPOSITE_INDEX_NAME)) { final PropertyKey customId = mgmt.makePropertyKey(PROP_CUSTOM_ID_KEY).dataType(String.class).make(); JanusGraphManagement.IndexBuilder customIdIndexBuilder = mgmt.buildIndex(COMPOSITE_INDEX_NAME, Vertex.class).addKey(customId); customIdIndexBuilder.buildCompositeIndex(); mgmt.makeVertexLabel(VERTEX_LABEL_LEVEL_1).make(); mgmt.commit(); } }