Tag Archives: social network

Getting and Creating Likes with Neo4j

In the last blog post, we created the Schema of our application and that was pretty dry stuff. It doesn’t get much better yet, so feel free to go do something more useful with your time, but before you go let me ask you a question. Did you ever have someone you really liked, I’m talking about the kind of person you thought about constantly, who made your heart skip a beat. The kind of person you knew was “the one“. But…

Continue reading

Tagged , , , , , , , ,

Graphs and Pyramids

Question: Do you want to get Rich?
I’ll answer for you: “Yes!”

Follow along with this blog series and if it doesn’t make you rich, you can go back to your youtube videos, you can go back to watching Tiger King on Netflix, you can go back to your crappy life. Let’s continue.

Question: Are you poor? dumb? ugly? do you make bad decisions?
I’ll answer for you: “Yes!”.

If you were not poor, you would be on a yacht in Ibiza and not reading my blog. If you were not dumb you would be doing whatever it is smart people do, I wouldn’t know but I’m pretty sure it’s not reading my blog. If you were not ugly you would be in Paris or Milan murdering the runway instead of reading my blog. If you didn’t make bad decisions you wouldn’t have decided to read my blog which just made you feel sad about your life. See where I’m going with this?

Continue reading

Tagged , , , , , , , , , ,

Updating your Neo4j 3.x Unmanaged Extensions to 4.x

Neo4j 4.0 has been out for a few months now, but since the whole world is on lock down, it didn’t get a chance to make a grand entrance at Graph Connect 2020. It comes loaded with some great new features but I’m not here to tell you about all that. There are plenty of better places for it. Instead I’m going to tell you about an old feature that got a bit of an update. Unmanaged Extensions. Yup, those things have been with us since dinosaurs roamed the earth and they are still in Neo4j 4.0. Why you ask? Because they let you turn Neo4j into an HTTP API style service making it super easy to integrate into your existing infrastructure. It’s still one of my favorite ways to build Neo4j applications because once you have the documentation of the API locked down, you can crank out the endpoints quickly and the service is done before you know it.

Continue reading

Tagged , , , , , , , , , ,

Finding Motifs in Cypher for Fun and Profit

If you are friends with Jessie, and Jessie is friends with Amy, there is a good chance you’ll eventually become friends with Amy too. In terms of a graph, this would be like a graph with three nodes and two relationships eventually building a third relationship to form a clique. This simple concept is one of the basis for recommendation engines. There are fancy terms for it, like “triadic closure” but basically it just means we are making triangles. But what about Amy’s friend Delilah? Is there a good chance now that you are friends with Amy that you’ll become friends with her? What about Jessie and Delilah? Can we extend the pattern to four nodes or five nodes and go beyond our simple triangle? Continue reading

Tagged , , , , , , , , , , ,

Network Routing in Neo4j

People use Neo4j to manage enterprise architectures all the time. If you haven’t seen this presentation from Thomas Lawrence from Amadeus, then you owe it to yourself to watch it. But what about lower level networks? Can we use Neo4j to model routing in a physical network? Of course we can, and today I’ll show you how.

Continue reading

Tagged , , , , , , , , , , , ,

Finding your neighbors using Neo4j

In Mr. Rogers’ Neighborhood, the question “Won’t you be my neighbor?” is an invitation for somebody to be close to you. In graphs, it’s an invitation to traverse. The closest neighbors of a node are those reachable by a single relationship hop, but we can also consider nodes two, three or more hops away our neighbors as well. How can we find them in Neo4j? Using the “star”:
Continue reading

Tagged , , , , , , , , , ,

Building a Dating site with Neo4j – Part Eleven

Up to this point, our users can send and receive messages, but we don’t have a way to show them all of their conversations, only one conversation at a time and they have to guess who messaged them before they can see those. Not very useful, what we need is a directory of all the conversations our user is part of. Let’s go ahead and add this feature to tie things together.
Continue reading

Tagged , , , , , , , , ,

Building a Dating site with Neo4j – Part Eight

Up to this point we have a timeline of posts from people we want to date, but no way to interact with those people. The first step begins today as we will allow users to High Five and Low Five posts. Recall that once a user has high fived your post, you will be able to message them for up to 5 days when the high five expires. If you do not wish to message them, that’s fine, their high five gives you an additional high five to give to someone else in the hopes they message you. Remember that all users get 5 “free” High Fives a day, if they want more they have to earn them. You can get a High Five on a post that is older than 5 days, it still counts. This is needed to create the opportunity to bring back a user who hasn’t been to the dating site in a while with a High Five to an old Post. Otherwise after 5 days of inactivity, those users would be practically deleted.
Continue reading

Tagged , , , , , , , , ,

Building a Dating site with Neo4j – Part Six

Without posts, we can’t have High Fives and that defeats the purpose of our dating site, so it’s time to let our users post things. We want to allow two types of posts, text posts and image posts. Today we’re going to focus on text posts and getting them working and we’ll deal with images in another post. The first thing we want to do is prevent users from posting bad things. So we’re going to create a PostValidator to deal with the user input:
Continue reading

Tagged , , , , , , , ,

Building a Dating site with Neo4j – Part One

You might have already heard that Facebook is getting into the Dating business. Other dating sites have been using graphs in the past and we’ve looked at finding love using the graph before. It has been a while though, so let’s return to the topic making use of the new Date and Geospatial capabilities of Neo4j 3.4. I have to warn you though that I’ve been with Helene for almost 15 years and missed out on all this dating site fun, what I do know I blame Colin for it and some pointers from the comments section of this blog post.
Continue reading

Tagged , , , , , , , , , ,