cancel
Showing results for 
Search instead for 
Did you mean: 

Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.

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}},
    {CONNECTED:{
        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(
  'interactionGraph',
  {
    modelName: 'interactionGraphSageModel',
    featureProperties: ['embedding_0', 'embedding_1'],
    projectedFeatureDimension: 2,
    relationshipWeightProperty: 'similarity',
    aggregator: 'mean',
    activationFunction: 'sigmoid',
    sampleSizes: [25, 10],
    epochs: 1
  }
) 

Finally to obtain embeddings,

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

The above Cypher throws the error:
Failed to invoke procedure gds.beta.graphSage.stream: 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.

3 REPLIES 3

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.