import com.datastax.dse.graph.api.DseGraph; import com.datastax.dse.graph.api.DseGraphFrame; import com.datastax.driver.dse.auth.DsePlainTextAuthProvider; import com.datastax.oss.driver.api.core.CqlSession; DseGraph dseGraph = DseGraph.builder() .configLoader(DseGraph.remoteConnectionBuilder("localhost")) .build(); DseGraphFrame dseGraphFrame = dseGraph.newGraphFrame(); Vertex person1 = dseGraphFrame.addVertex("person").property("name", "Alice").property("age", 25); Vertex person2 = dseGraphFrame.addVertex("person").property("name", "Bob").property("age", 30); Edge knows = dseGraphFrame.addEdge(person1, person2, "knows"); dseGraphFrame.addVertexLabelProperty("person", "name"); dseGraphFrame.addVertexLabelProperty("person", "age"); ResultSet results = dseGraphFrame.executeGraph("g.V().has('person', 'name', 'Alice')");


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