Skip to content

Add edge type filtering to DJORNL queries#27

Merged
jayrbolton merged 2 commits intodevelopfrom
edge_type_filtering
Sep 2, 2020
Merged

Add edge type filtering to DJORNL queries#27
jayrbolton merged 2 commits intodevelopfrom
edge_type_filtering

Conversation

@ialarmedalien
Copy link
Copy Markdown
Collaborator

  • I updated the README.md docs to reflect this change.
  • This is not a breaking API change OR

@ialarmedalien ialarmedalien self-assigned this Sep 2, 2020
FOR v, e, p IN 0..@distance ANY n djornl_edge
OPTIONS {bfs: true, uniqueVertices: "global"}
RETURN DISTINCT node._id
FILTER length(@edge_types) == 0 || p.edges[*].edge_type ALL IN @edge_types
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the edge_types filter is empty, treat it as if all edge types are allowed.

$schema: "http://json-schema.org/draft-07/schema#"
name: edge_types_filter
title: Edge Types
description: Edge types to filter on
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

type: array?

Comment thread spec/stored_queries/djornl/djornl_fetch_clusters.yaml Outdated
LET edges = (
FOR edge IN djornl_edge
FILTER edge._from IN node_ids AND edge._to IN node_ids
AND (edge.edge_type IN @edge_types || length(@edge_types) == 0)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same comment above about short circuiting

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed globally

@jayrbolton jayrbolton merged commit 4e2fcdb into develop Sep 2, 2020
@jayrbolton jayrbolton deleted the edge_type_filtering branch September 2, 2020 18:06
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

Successfully merging this pull request may close these issues.

2 participants