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

Neptune query examples to execute during this demo #5

Open
deejvince opened this issue Jan 29, 2019 · 1 comment
Open

Neptune query examples to execute during this demo #5

deejvince opened this issue Jan 29, 2019 · 1 comment

Comments

@deejvince
Copy link

Hi,
I'm looking for instructions on how to query Neptune using gremlin and display some things like "if you boughts this, you'd also want to look at that"
Can you share some examples that can be demoed using this application?

@triggan
Copy link
Contributor

triggan commented Jan 29, 2019

Hi Lior,

As of right now, the dataset that we used to boot strap the Neptune instance only has customers that have purchased a single item. In order to do the type of traversal and recommendation pattern that you suggest, the initial dataset would need to be expanded such that users have purchased more than one item. Then you could make recommendations based off of what other books people were purchasing from the view point of one particular book.

The current recommendation pattern shown in the app makes recommendations based off of a fabricated social network. We established friends between users and made recommendations based off of those 'friendOf' relationships.

Once the graph dataset were expanded and further transactions were added, you could use the following traversal to make recommendations based off of a single book:

g.V("2rb37qw5-d93b-11e8-9f8b-f2801f1b9fd1").as('a')        #Start with "Behind the Symbol"
    .in('purchased')        #Find all people that purchased the book
    .out('purchased')        #Find all books that those people purchased
    .where(neq('a'))       #Make sure you're not including the original book
    .valueMap(true).dedup()       #Output attributes of verticies returned and dedupe

This example shows a traversal for book recommendations for the book "Behind the Symbol" in the sample dataset. Like I mentioned, this will unfortunately return 0 results due to the current content of the initial dataset.

We're open to PRs for extending the existing dataset to make this more interesting.

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

2 participants