hugegraph-test/src/main/java/org/apache/hugegraph/core/IndexLabelCoreTest.java [1302:1330]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        super.initPropertyKeys();
        SchemaManager schema = graph().schema();
        schema.vertexLabel("author").properties("id", "name")
              .primaryKeys("id").create();
        schema.vertexLabel("book").properties("name")
              .primaryKeys("name").create();
        schema.edgeLabel("authored").singleTime()
              .link("author", "book")
              .properties("contribution")
              .create();

        Vertex james = graph().addVertex(T.label, "author", "id", 1,
                                         "name", "James Gosling");
        Vertex java1 = graph().addVertex(T.label, "book", "name", "java-1");

        schema.indexLabel("authoredByContri").onE("authored").secondary()
              .by("contribution").create();

        EdgeLabel authored = schema.getEdgeLabel("authored");

        Assert.assertEquals(1, authored.indexLabels().size());
        assertContainsIl(authored.indexLabels(), "authoredByContri");

        james.addEdge("authored", java1,"contribution", "test");
        graph().tx().commit();

        Edge edge = graph().traversal().E().hasLabel("authored")
                    .has("contribution", "test").next();
        Assert.assertNotNull(edge);
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



hugegraph-test/src/main/java/org/apache/hugegraph/core/IndexLabelCoreTest.java [1434:1462]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        super.initPropertyKeys();
        SchemaManager schema = graph().schema();
        schema.vertexLabel("author").properties("id", "name")
              .primaryKeys("id").create();
        schema.vertexLabel("book").properties("name")
              .primaryKeys("name").create();
        schema.edgeLabel("authored").singleTime()
              .link("author", "book")
              .properties("contribution")
              .create();

        Vertex james = graph().addVertex(T.label, "author", "id", 1,
                                         "name", "James Gosling");
        Vertex java1 = graph().addVertex(T.label, "book", "name", "java-1");

        schema.indexLabel("authoredByContri").onE("authored").secondary()
              .by("contribution").create();

        EdgeLabel authored = schema.getEdgeLabel("authored");

        Assert.assertEquals(1, authored.indexLabels().size());
        assertContainsIl(authored.indexLabels(), "authoredByContri");

        james.addEdge("authored", java1,"contribution", "test");
        graph().tx().commit();

        Edge edge = graph().traversal().E().hasLabel("authored")
                    .has("contribution", "test").next();
        Assert.assertNotNull(edge);
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



