Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: path expander 'minLevel' interaction with termination filter #364

Closed
InverseFalcon opened this issue Apr 3, 2017 · 2 comments
Closed
Assignees

Comments

@InverseFalcon
Copy link
Collaborator

There is an interaction between 'minLevel' and the termination filter that may violate expectations. The more general question I'm asking is "which label filters should be executing when evaluating a node below minLevel depth?

While it makes sense to execute on the whitelist and blacklist, the termination filter's side effect of pruning further traversal down a path still triggers when the node is below minLevel depth.

An example in the movies graph, when 'Clint Eastwood' and 'Gene Hackman' are labeled :Western.

MATCH (k:Person {name:'Keanu Reeves'})
CALL apoc.path.expandConfig(k, {relationshipFilter:'ACTED_IN|PRODUCED|DIRECTED', labelFilter:'/Western', uniqueness: 'NODE_GLOBAL', minLevel:3}) yield path 
RETURN path

The above query will not return any results, because the termination filter prunes further traversal when 'Gene Hackman' is reached (so Clint Eastwood can never be reached), even though 'Gene Hackman' is never returned as a result, due to minLevel:3.

Is this something we should consider correct behavior, or do we want to prevent termination filter pruning until we reach minLevel and are returning results?

Discussion encouraged.

@InverseFalcon InverseFalcon self-assigned this Apr 3, 2017
@InverseFalcon
Copy link
Collaborator Author

I've come to the conclusion that this is incorrect behavior. The use of the termination filter is to return interested paths up to nodes and pruning further traversal, so it seems to me that pruning traversal before we even reach minLevel is a bug.

@InverseFalcon InverseFalcon changed the title Possible bug: path expander 'minLevel' interaction with termination filter Bug: path expander 'minLevel' interaction with termination filter Apr 7, 2017
@InverseFalcon
Copy link
Collaborator Author

Fixed.

ncordon pushed a commit to ncordon/neo4j-apoc-procedures that referenced this issue Nov 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant