@Test public void createSchema() throws ConfigurationException { final TinkerGraphApp app = new TinkerGraphApp(CONF_FILE); final GraphTraversalSource g = app.openGraph(); app.createSchema(); final TinkerGraph tinkerGraph = (TinkerGraph) g.getGraph(); final Set<String> vertexIndexes = tinkerGraph.getIndexedKeys(TinkerVertex.class); assertEquals(1, vertexIndexes.size()); assertEquals("name", vertexIndexes.toArray()[0]); final Set<String> edgeIndexes = tinkerGraph.getIndexedKeys(TinkerEdge.class); assertTrue(edgeIndexes.isEmpty()); }
@Override public void createSchema() { LOGGER.info("creating schema"); final TinkerGraph tinkerGraph = (TinkerGraph) graph; if (!tinkerGraph.getIndexedKeys(Vertex.class).iterator().hasNext()) { tinkerGraph.createIndex("name", Vertex.class); } }
TinkerGraphApp extends GraphApp { @Override public void createSchema() { LOGGER.info("creating schema"); final TinkerGraph tinkerGraph = (TinkerGraph) graph; if (!tinkerGraph.getIndexedKeys(Vertex.class).iterator().hasNext()) { tinkerGraph.createIndex("name", Vertex.class); } } }
TinkerGraphApp extends GraphApp { @Override public void createSchema() { LOGGER.info("creating schema"); final TinkerGraph tinkerGraph = (TinkerGraph) graph; if (!tinkerGraph.getIndexedKeys(Vertex.class).iterator().hasNext()) { tinkerGraph.createIndex("name", Vertex.class); } } TinkerGraphApp(final String fileName); }
TinkerGraphApp extends GraphApp { @Override public void createSchema() { LOGGER.info("creating schema"); final TinkerGraph tinkerGraph = (TinkerGraph) graph; if (!tinkerGraph.getIndexedKeys(Vertex.class).iterator().hasNext()) { tinkerGraph.createIndex("name", Vertex.class); } } TinkerGraphApp(final String fileName); @Override void createSchema(); static void main(String[] args); }
TinkerGraphApp extends GraphApp { @Override public void createSchema() { LOGGER.info("creating schema"); final TinkerGraph tinkerGraph = (TinkerGraph) graph; if (!tinkerGraph.getIndexedKeys(Vertex.class).iterator().hasNext()) { tinkerGraph.createIndex("name", Vertex.class); } } TinkerGraphApp(final String fileName); @Override void createSchema(); static void main(String[] args);  }