GraphSage: Found a relationship without the specified property

Hi, I am trying to run GraphSage with 2 specified node properties. I am loading the data via Native projection. Prior to this I have checked that no nodes are missing any properties and no relations are missing any values.

The graph creation cypher is:

UNWIND range(0,1) as i
WITH collect('embedding_' + toString(i)) as embeddings
CALL gds.graph.create('interactionGraph', 
    {grid: {
        label : 'grid',
        properties: embeddings}},
        orientation: 'UNDIRECTED',
        properties: {
            similarity: {
                property: 'similarity', 
                defaultValue: 0.0}}
YIELD graphName, nodeCount, relationshipCount
RETURN graphName, nodeCount, relationshipCount

GraphSage training also runs. The command is shown below
CALL gds.beta.graphSage.train(
    modelName: 'interactionGraphSageModel',
    featureProperties: ['embedding_0', 'embedding_1'],
    projectedFeatureDimension: 2,
    relationshipWeightProperty: 'similarity',
    aggregator: 'mean',
    activationFunction: 'sigmoid',
    sampleSizes: [25, 10],
    epochs: 1

Finally to obtain embeddings,

  {modelName: 'interactionGraphSageModel'}
YIELD nodeId, embedding
RETURN gds.util.asNode(nodeId).Node AS name, embedding

The above Cypher throws the error:
Failed to invoke procedure Caused by: java.lang.RuntimeException: Found a relationship without the specified property. Consider using defaultValue when loading the graph.

I had previously thought setting default value on the relationship properties would work, but it has not solved the issue.

Would appreciate it if anyone can help resolve this issue.

Which version of the GDS library are you using?
And do you have the code to create your example graph?

I am using GDS 1.6.1. Oddly, removing relationshipweightproperty during training allows the program to work successfully.

The fix will be available in 1.6.2, you can build GDS locally until then. Look at -> Cannot stream from graphSage model with relationshipWeights property · Issue #118 · neo4j/graph-data-science · GitHub

1 Like