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

Make aql query more robust #280

Merged
merged 4 commits into from
Jun 26, 2021
Merged

Make aql query more robust #280

merged 4 commits into from
Jun 26, 2021

Conversation

gotdairyya
Copy link
Contributor

@gotdairyya gotdairyya commented Jun 25, 2021

Closes issue #278

To Do:

  • * for nodes + edges
  • edge filtering
  • AND/OR functionality on edges
  • remove unnecessary arguments
  • make query not case sensitive

@gotdairyya gotdairyya requested a review from JackWilb June 25, 2021 20:24
@gotdairyya
Copy link
Contributor Author

Moved the AND/OR functionality to issue #282

@gotdairyya gotdairyya marked this pull request as ready for review June 25, 2021 20:24
Copy link
Member

@JackWilb JackWilb left a comment

Choose a reason for hiding this comment

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

I see one small change you can make to simplify things even more with the query

In general, I think we should offer more query operators for both nodes and edges. I can see use cases for >, <, !=, etc. Is that something you're considering?

I verified:

  • * for nodes + edges
  • edge filtering
  • remove unnecessary arguments
  • make query not case sensitive

I can't run a query that queries the network for edge.value == 15 with no nodes. I'm not sure if that's a query we should allow, or not, though. (looks like this is covered by #283)

Comment on lines +155 to 161
for (let i = 0; i < selectedHops.value; i += 1) {
if (i === 0 && edgeVariableValue.value[i] !== '') {
pathQueryText += ` FILTER p.edges[${i}].${edgeVariable.value[i]} == '${edgeVariableValue.value[i]}'`;
} else if (edgeVariableValue.value[i] !== '') {
pathQueryText += ` AND p.edges[${i}].${edgeVariable.value[i]} == '${edgeVariableValue.value[i]}'`;
}
}
Copy link
Member

Choose a reason for hiding this comment

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

Why don't these have query operators?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Because edge selection will always be precise for the marclab... But now I'm not sure if it makes sense in other use cases

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I see one small change you can make to simplify things even more with the query

In general, I think we should offer more query operators for both nodes and edges. I can see use cases for >, <, !=, etc. Is that something you're considering?

I verified:

  • * for nodes + edges
  • edge filtering
  • remove unnecessary arguments
  • make query not case sensitive

I can't run a query that queries the network for edge.value == 15 with no nodes. I'm not sure if that's a query we should allow, or not, though. (looks like this is covered by #283)

Yes so currently the first node needs to be selected in order to run a query successfully.
I've also created an issue to address numerical queries #284 , which I think we agreed on slack will be a later functionality

Co-authored-by: Jack Wilburn <jackwilburn@tutanota.com>
@gotdairyya gotdairyya requested a review from JackWilb June 25, 2021 23:28
@gotdairyya gotdairyya merged commit a1af336 into master Jun 26, 2021
@gotdairyya gotdairyya deleted the aql-fix branch June 26, 2021 05:02
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