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

(feature request) Browser: query assistant #3876

Closed
mindrones opened this issue Jan 27, 2015 · 6 comments
Closed

(feature request) Browser: query assistant #3876

mindrones opened this issue Jan 27, 2015 · 6 comments

Comments

@mindrones
Copy link

When writing clauses in the browser "shell" I'd like be able to autocomplete clauses pressing TAB:

  • type MA
  • press TAB
  • completes to MATCH

Possibly keeping the current capitalization (ma + TAB => match, MA + TAB => MATCH)

@mindrones
Copy link
Author

Given nodes with property type on them, another use case would be:

  • type match (n) set n.ty
  • press TAB
  • completes to match (n) set n.type

In case we have multiple properties starting with ty, pressing TAB multiple times would alternate among possible properties names and the original string (ty):

  • type match (n) set n.ty
  • press TAB
  • update to match (n) set n.type
  • press TAB
  • update to match (n) set n.typos
  • press TAB
  • back to match (n) set n.ty

@oskarhane
Copy link
Member

Yes, we definitely want to have autocompletion for the browser.
We're having discussions on how to implement it and appreciate all input.

@mindrones
Copy link
Author

Another nice feature would be to autocomplete labels and relationship types.

In the examples, the DB has node labels ANDROID/ANIMAL/PERSON and relationship types OWNS/LIKES/LOVES.

Node labels

We constraint the choice partially writing the label:

  • type match (n:A
  • press TAB
  • completes to match (n:ANDROID
  • press TAB
  • completes to match (n:ANIMAL
  • press TAB
  • back to match (n:A

or we can let the shell to suggest labels automatically:

  • type match (n:
  • press TAB
  • completes to match (n:ANDROID
  • press TAB
  • completes to match (n:ANIMAL
  • press TAB
  • completes to match (n:PERSON
  • press TAB
  • completes to match (n:ANDROID
  • go on circular...
  • ...until we add the : to get match (n:PERSON:
  • press TAB
  • completes to match (n:PERSON:ANDROID
  • press TAB
  • completes to match (n:PERSON:ANIMAL
  • press TAB

Relationship types

Constraint the choice partially writing the label:

  • type match (n)-[r:L
  • press TAB
  • completes to match (n)-[r:LIKES
  • press TAB
  • completes to match (n)-[r:LOVES
  • press TAB
  • back to match (n)-[r:L

Automatic:

  • type match (n)-[r:
  • press TAB
  • completes to match (n)-[r:LIKES
  • press TAB
  • completes to match (n)-[r:LOVES
  • press TAB
  • completes to match (n)-[r:OWNS
  • press TAB
  • completes to match (n)-[r:LIKES
  • go on circular...

@mindrones
Copy link
Author

Another useful feature would be to assist the user building the query suggesting what can be put next.
If we use TAB to complete words, I'd use two fast TAB (like a double click) or maybe arrows (^ + /?) to tell the shell we wanna see what's next.

In the examples:

  • the DB has node labels ANDROID/ANIMAL/PERSON and relationship types OWNS/LIKES/LOVES; PERSON nodes have properties name/surname
  • I use | to indicate the position of the cursor (not a pipe).

Nodes

  • type match (n``|
  • press ^ +
  • completes to match (n:``|
  • press ^ +
  • completes to match (n {``|
  • press ^ +
  • completes to match (n)``|
  • press ^ +
  • back to match (n:``|
  • press TAB
  • completes to match (n:ANDROID``|
  • press TAB
  • completes to match (n:ANIMAL``|
  • press ^ +
  • completes to match (n:ANIMAL:``|
  • press ^ +
  • completes to match (n:ANIMAL {``|
  • press ^ +
  • completes to match (n:ANIMAL)``|

If we change our mind we should be able to use the same pattern.

  • we have match (n:ANIMAL``|
  • press ^ +
  • we get match (n:ANIMAL:``|
  • press ^ +
  • we get match (n:ANIMAL {``|
  • press ^ +
  • we get match (n:ANIMAL:``|
  • press ^ +
  • we get match (n:ANIMAL``|

Relationships

  • we have match (n)-[r``|
  • press ^ +
  • we get match (n)-[r:``|
  • press ^ +
  • we get match (n)-[r*``|
  • press ^ +
  • we get match (n)-[r]``|
  • press ^ +
  • we get match (n)-[r*``|

Contexts

In some cases we might have bifurcations.
For example if we press choose a forward-suggestion shortcut while are at match (n:PERSON {, should we get match (n:PERSON) or match (n:PERSON {name:'? I'd use ^ + to say we want to enter the current 'context':

  • we have match (n:PERSON``|
  • press ^ +
  • we get match (n:PERSON:``|
  • press ^ +
  • we get match (n:PERSON {``|
  • press ^ +
  • we get match (n:PERSON {name:``|
  • press TAB
  • we get match (n:PERSON {surname:``|
  • type to have match (n:PERSON {surname:'smith'``|
  • press ^ +
  • we get match (n:PERSON {surname:'smith', name:``| (which we aren't interested in)
  • press ^ +
  • we get match (n:PERSON {surname:'smith'})``|

@mindrones mindrones changed the title (feature request) Browser: command auto-completion with TAB (feature request) Browser: query auto-completion Feb 16, 2015
@mindrones
Copy link
Author

Another useful feature would be to show if labels/types/properties we're typing exist.

In the examples, the DB has node labels ANDROID/ANIMAL/PERSON and relationship types OWNS/LIKES/LOVES; PERSON nodes have properties name/surname

Labels and relationship type

  • type match (a:ANDROID)-[r:DREAMS]-(s:SHEEP)
  • the strings DREAMS and SHEEP get a red background-color to indicate they don't exist in the DB

Properties

  • type match (p:PERSON {ram: '8Gb'})
  • the string ram gets a red background-color to indicate that in the current DB there aren't nodes labeled PERSON with a property named ram

@mindrones mindrones changed the title (feature request) Browser: query auto-completion (feature request) Browser: query assistant Feb 16, 2015
@oskarhane
Copy link
Member

This issue was moved to neo4j/neo4j-browser#135

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants