srcGraphId = srcGraphMetadata.getId();
dstGraphId = dstGraphMetadata.getId();
jobId = jobMetadata.getId();
srcGraph = metaGraph.getGraph(srcGraphMetadata.getId());
DendriteGraphTx srcTx;
srcTx = srcGraph.newTransaction();
try {
srcTx.makeKey("name")
.dataType(String.class)
.indexed("search", Vertex.class, Parameter.of(Mapping.MAPPING_PREFIX, Mapping.STRING))
.make();
srcTx.makeKey("age")
.dataType(Integer.class)
.indexed("search", Vertex.class)
.make();
srcTx.makeLabel("friends").make();
srcTx.makeLabel("enemies").make();
} finally {
srcTx.commit();
}
// Create a trivial graph.
srcTx = srcGraph.newTransaction();
try {
Vertex srcAVertex = srcTx.addVertex(null);
srcAVertex.setProperty("name", "A");
srcAVertex.setProperty("age", 42);
Vertex srcBVertex = srcTx.addVertex(null);
srcBVertex.setProperty("name", "B");
srcBVertex.setProperty("age", 50);
Vertex srcCVertex = srcTx.addVertex(null);
srcCVertex.setProperty("name", "C");
srcCVertex.setProperty("age", 36);
Vertex srcDVertex = srcTx.addVertex(null);
srcDVertex.setProperty("name", "D");
srcDVertex.setProperty("age", 10);
srcTx.addEdge(null, srcAVertex, srcBVertex, "friends");
srcTx.addEdge(null, srcBVertex, srcCVertex, "enemies");
srcTx.addEdge(null, srcCVertex, srcDVertex, "friends");
} finally {
srcTx.commit();
}
}