Neo4j Browser Cypher Query Results Movement - neo4j

In Neo4J browswer, when you want to visualize some data, a nice interface is available for Cypher queries. The trouble is the nodes are continuously moving around, and usually 90% of them are off screen. Surprisingly I cant find much info on the purpose of this. is there a way to stop this annoying movement?

It's not possible 'easily' turn off shaking of the nodes in the Neo4j web console.

Related

Does RinSim natively support invisible, non-colliding agents on a PDP Roadmodel?

We are using the map of Leuven as a graph roadmodel. We aim to develop a system using exploration ants, as well as feasibility ants that roam around the map to propagate knowledge about the local environment. Exploration ants are sent out by vehicles and report back when they have found a favourable path to follow to pick up packages, while feasibility ants would be sent out by parcels and randomly roam around to notify vehicles of their existence.
Ideally, these ants are not visible on the map while roaming around and would not be bound by regular time constraints (faster movement than other vehicles).
Is there some kind of support for a delegate MAS system like this, and if not, what would be the best approach to implement it?
This question has been answered here.
As for your second question: Instead of adding ants in a RoadModel, you could view the ants as messages that contain some extra data (such as the path they they were sent along) and send them throughout the graph using a CommModel. This way, they are invisible and non-colliding.

Iterating throug nodes in Neo4j using py2neo

I am working on using Neo4j with py2neo for analyzing Twitter data. I'm a newbie in all of these, so the question might be pretty basic. But I could not find the answer in any of the documentations.
I have two csv files, one with 100 followers, the other with about 22000 tweets.
For the tweet I have informations like it is a reply to another tweet and the other users who have been mentioned in this tweet.
I want to add followers and tweets as nodes, then using the reply_to and the mentions_user field of the tweets to add connections between tweets (reply_to) and tweet and user (mentions).
Adding the nodes works well with batch. However, when I want to iterate through all Tweets using py2neo to add the relationships I get OutOfMemoryError: Java heap space.
I'm trying to iterate through the tweets like this:
for tweet in graph.find("Tweet")
My questions are now:
a) Is there another way in py2neo to iterate through (a lot of) nodes?
b) A little broader: I read in the py2neo documentation it is better to use cypher transactions than batch. Should I do that and could that also help for a)?
Thanks in advance for any help!
KMM
There are certainly ways to load bulk data effectively but this particular method (finding all items of a particular "type") is not one that takes advantage of the graph structure of the database and therefore won't scale well.
You can of course increase the Java heap size if this is a one-off and you may get away with it. But your best bet is probably to look into the LOAD CSV operation: http://neo4j.com/docs/stable/query-load-csv.html

Visualization of a highly linked graph with neo4j

I'm using Neo4j for a research project and am struggling with a small problem.
The underlying data is a highly linked graph and I'm not able to visualize it in a good manner. As you can see in the screenshot, the relationships are overlapping and I can always just click the top one for further information. I already tried two approaches: try to hide relationships in the visualized result (Neo4j Browser with Cypher queries) and I was looking for alternatives to neo4j's built in visualization.
So my desired approach would be to just hide relationships from the visualized result. But even queries such as MATCH (a)-[t]->(b) WHERE t.probability > 0.1 RETURN a,b,t return less nodes and still display all relationships between this few nodes.
Does anybody know how to hide different relationships in the result? Or if it is not possible with neo4j's built in solution an open source or at least free visualization tool recommendation would be highly appreciated.
Some info about my graph: it displays a transition map (A Bayesian Network) of 10 zones and the probabilities of moving from one zone to another. There are a couple of relationships between each node, representing different time intervals. So in example 'Moving from A to B in less than an hour has a probability of 42%'
Neo4j server does an extra query for relationships after it retrieved the nodes, I'm not aware of an easy way to prevent that.
You could use something that uses a different approach to visualization.
E.g. like my demo app here that uses alchemy.js for visualization:
http://jexp.github.io/cy2neo/
Zonic,
If you click on a node or relationship, you will get a pop-up that has an option to view the graph stylesheet. From the dialog that pops up, you can download the contents, then modify the relationships that you don't wish to see to make the lines and text white. Drag and drop the modified, downloaded .grass file back into the stylesheet dialog, and see if that helps.
You could also try the gephi application and see what that does for you. It's free, and it is focused on visualization.
Grace and peace,
Jim
maybe you would like to try external applications as stated in this answer:
neo4j, Sorry! Too many neighbours
Do you mean basic filtering of the relationships, like this...
MATCH (a:Person)-[t:IS_RELATED_TO]->(b:Person) WHERE t.probability > 0.1 RETURN a,b,t
You can hide the extra relationships by turning off auto-complete with the switch in the bottom-right corner. By default Neo4j also fetches and displays relationships between returned nodes, even if they were not part of your query. With auto-complete turned off, Neo4j will only displayed the relationships returned by the actual query.

Best way to very quickly match a needle against a large haystack

Think of an employee management system application, now add a biometric machine to it. Users can swipe their finger to clock in and out of the system as they enter and exit the building.
So far my application currently can successfully enroll fingerprint templates retrieved from my biometric machine and have it saved into the database in a blob/varchar field.
I have over 3000 registered users in this local database of mine on a local mac app that I created. Now I am implementing the matching algorithm, and wondering whether I should:
load all 3000 fingerprint templates from the local database - the haystack - into an NSMutableArray with one database call that would be done at application startup and then match the user's fingerprint template - needle - against the haystack for each user that enters or exits the building;
Make multiple SQL calls returning one element of the haystack at a time, compare it with the needle, and if they dont match, return another element from the haystack until they match. Or,
Grab portions of the haystack (say a 100 fingerprint templates at a time) and load that into an NSMutableArray and then match the needle against that haystack subset.
Which is best for a lightning fast approach?
The fingerprint SDK I am using atm, is meant to be lightning fast in terms of the fingerprint verification itself, but I need to handle the database side of things and managing the haystack and needle myself and would ideally like that to be fast too.
I am currently using SQLite, if I need adopt Cocoa Core Data to fulfil a better approach to what I wish to accomplish, then I am all ears and can adopt the system to provide a better user experience in terms of speed
Here's an example of what one fingerprint template data looks like in a base 64 encoded string format.
3000 records seems like a tiny haystack. How big is a template? I'd almost certainly just load it all up into memory if you need to do complicated comparisons provided the templates aren't outrageously large.
The various approaches don't sound difficult to implement. Which way are you doing it now, and what's the performance bottleneck? Start by implementing simply, and then see if there's a problem. Often there isn't, and you spend a lot of time making things complicated for nothing.
3800 base 64 chars is only 2500 bytes...
just test it, try strnstr (null chars will stop it from searching), I bet you can search that hundreds of times a second.
be sure to search decoded otherwise because of alignment your needle could look like lots of different things.

Leaderboard style query in GORM for a Groovy/Grails app

I have a Grails app in production where we will be implementing a leaderboard. Let's say that the users are playing rock-paper-scissors and the leaderboard is tallying wins, losses and ties. That's fine, no problem. But now our user base has become large enough that a person would have to scroll and scroll and scroll to find where they are in the list. What we'd like to do is show the top 10 or so in the leader board (this is being displayed on an iPhone btw) and then the user's name with their rank against everyone else like this:
Andrew
Bruce
Charlie
Doug
...
3,194 YOU
I know this can be achieved by doing a query for the complete list and then calculating the position but that seems expensive to perform every time. One alternative I thought about was just running that query from a quartz job and saving everyone's current position in the leaderboard so it's easily accessible. I'm not in love with that either because then it's not going to be a real time answer.
I think what I'm looking for is a GORM way to almost do an indexOf for a single record among its peers based on the query criteria.

Resources