PropertiesConfiguration conf = ConfigurationUtil.loadPropertiesConfig("conf/test.properties");graph = JanusGraphFactory.open(conf);GraphTraversalSource g = graph.traversal();JanusGraphManagement m = graph.openManagement();VertexLabel l = m.makeVertexLabel("L").make();PropertyKey p = m.makePropertyKey("p").dataType(Integer.class).make();PropertyKey q = m.makePropertyKey("q").dataType(Integer.class).make();m.buildIndex("someName", Vertex.class).addKey(p).addKey(q).indexOnly(l).buildMixedIndex("jgex");m.commit();g.addV("L").property("p", 1).next();g.tx().commit();System.out.println(g.V().hasLabel("L").has("q").count().next());System.out.println(g.V().hasLabel("L").has("q", not(eq(2))).count().next());
© 2023 Groups.io