Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
08-31-2020 07:59 AM
Hi,
We are using Graph Data Science library, and we got this error message:
neo4j.exceptions.ClientError: Failed to invoke procedure
gds.alpha.kShortestPaths.stream: Caused by: java.lang.IllegalArgumentException: Failed to load a relationship because its target-node with id 1523 is not part of the node query or projection. To ignore the relationship, set the configuration parameter
relationshipValidation to false.
My question is what we need to do to ignore the relationship validation, where we need to put the relationshipValidation parameter.
Thanks,
09-04-2020 10:39 AM
09-04-2020 11:07 AM
Can you share the query you used to call shortest path? My guess is that either the start or end node you specified is not in the graph you supplied to the algorithm.
Ultimately, both the start
and end
node must be contained within the subgraph specified by the nodeProjection
and relationshipProjection
. For example:
MATCH (start:Loc {name: 'A'}), (end:Loc {name: 'F'})
CALL gds.alpha.shortestPath.stream({
nodeProjection: 'Loc',
relationshipProjection: {
ROAD: {
type: 'ROAD',
properties: 'cost',
orientation: 'UNDIRECTED'
}
},
startNode: start,
endNode: end,
relationshipWeightProperty: 'cost'
})
YIELD nodeId, cost
RETURN gds.util.asNode(nodeId).name AS name, cost
For a longer explanation, I'd look to the docs: https://neo4j.com/docs/graph-data-science/current/alpha-algorithms/shortest-path/#algorithms-shortes...
09-13-2020 12:58 AM
Thanks for the answer Alicia.
I'm simply looking to set the "relationshipValidation" parameter to false.
My question is - where should this parameter be added? I couldn't find a documentation for this anywhere and I'd really appreciate your help.
Thanks.
10-07-2020 08:05 AM
Were you able to find the way to include relationshipValidation parameter in the
CALL gds.graph.create.cypher
query?
10-07-2020 11:32 PM
In the source code, there is only single instance of "relashipshipvalidation", which is in the exception file; making it hard to figure where the parameter has to be put while creating a GDS graph using CYPHER projection. @alicia.frame, could you help us figure out?
11-11-2020 01:00 PM
Hello @dan3,
I figured out the way around this issue. You can add validateRelationships:false to your code. See using the example below.
MATCH (start:Loc {name: 'A'}), (end:Loc {name: 'F'})
CALL gds.alpha.shortestPath.stream({
nodeProjection: 'Loc',
relationshipProjection: {
ROAD: {
type: 'ROAD',
properties: 'cost',
orientation: 'UNDIRECTED'
}
},
startNode: start,
endNode: end,
relationshipWeightProperty: 'cost',
validateRelationships:false
})
YIELD nodeId, cost
RETURN gds.util.asNode(nodeId).name AS name, cost
11-11-2020 01:03 PM
All the sessions of the conference are now available online