private static void setLabelSystem() { IndexDefinition indexDefinition; try (Transaction tx = graphDb.beginTx()) { Schema schema = graphDb.schema(); indexDefinition = schema.indexFor(DynamicLabel.label("Nome")).on("name").create(); tx.success(); } try (Transaction tx = graphDb.beginTx()) { Schema schema = graphDb.schema(); schema.awaitIndexOnline(indexDefinition, 10, TimeUnit.SECONDS); } }