I'm confused. I am trying to do what seems like a fairly simple join operation but it is not working as I expect. I have two graphs, pGraph and cGraph. Each is built by reading entries from a CSV file and the id values used are generated from one of the attributes. pGraph includes p vertices which are fully fleshed out with attributes and the cGraph includes c vertices which are similarly defined. In pGraph there are edges defined between p vertices and c vertices, using consistent id values. However, since the attributes for the c vertices are only available in cGraph, I want to join the two graphs together so that the attributes for the c vertices (from cGraph) and the attributes for the p vertices (from pGraph) are defined in the result of the join (xGraph).
Here's the code that I thought would accomplish this:
val xGraph = pGraph.joinVertices(cGraph.vertices){ (x,y,z) => z}
Eventually, by debugging, I discovered that the map function was never being invoked at all. That's to say there were apparently no matching vertices in pGraph and cGraph. I had assumed that there would be a match if the id values were the same. But that appears not to be true. If the match is based on both components of the Vertex (id and attributes) then of course there will be no match because in one case the attribute is null and in the other case it is the proper value.
The examples that I've found for join operations are all trivial in the sense that the this and input vertices are the same, rather than being from different graphs.
Any suggestions?