import com.datastax.dse.graph.api.DseGraph; import com.datastax.dse.graph.api.DseGraph.g; import com.datastax.dse.graph.internal.DseGraphSession; public class DseGraphExample { public static void main(String[] args) { DseGraph graph = DseGraph.open("localhost"); DseGraphSession session = graph.newGraphSession(); session.executeGraph("schema.propertyKey('name').Text().create()"); session.executeGraph("g.addV('person').property('name', 'John')"); List<Vertex> results = session.executeGraph("g.V().hasLabel('person').has('name', 'John').toList()"); for (Vertex vertex : results) { System.out.println(vertex); } session.close(); graph.close(); } }


上一篇:
下一篇:
切换中文