neo4j

Neo4j…how to get a visual representation of my data?

可紊 提交于 2019-12-08 07:59:41
问题 I have loaded an embedded instance of Neo4j with some data, and would like to know how I can now view this graph. I saw an intro video here: http://video.neo4j.org/m9FD/how-to-get-started-with-neo4j-119/. Here the guy opened an instance in his web browser via Heroku and was able not only see the data in the graph, but also enter new data and search for both nodes and relationships . How do I see the data I have entered into the graph-database? graphDb = new GraphDatabaseFactory()

How does neo4j perform in time and space complexity for given type of nodes, relationships and queries?

眉间皱痕 提交于 2019-12-08 07:37:45
问题 Consider I'm going to have following things in my graph: 100 Million nodes, More than 1 Billion connections/relationships Node properties: around 10 properties, mix of int, doubles, strings, HashMaps etc. Relationship properties: around 10 double values and 2-3 string (with avg 50 chars) values Now, Suppose I want to update all node and relationship property values, by querying neighbors on each node once. i.e. say as, step1: search a node, say X, with given Id, step2: get it's neighbours,

How to convert neo4j return types to python types

女生的网名这么多〃 提交于 2019-12-08 07:26:30
问题 I am using py2neo and I would like to extract the information from query returns so that I can do stuff with it in python. For example, I have a DB containing three "Person" nodes: for num in graph.cypher.execute("MATCH (p:Person) RETURN count(*)"): print num outputs: >> count(*) 3 Sorry for shitty formatting, it looks essentially the same as a mysql output. However, I would like to use the number 3 for computations, but it has type py2neo.cypher.core.Record . How can I convert this to a

Getting NotInTransactionException while querying neo4j index

↘锁芯ラ 提交于 2019-12-08 07:16:34
问题 I am currently using neo4j 1.8.1 . I am getting NotInTransactionException , when I am querying the neo4j index to get some nodes. Following is a simple query , which i am executing on neo4j if (graphDb.index().existsForNodes("NODEINDEX")) { IndexHits<Node> hits = graphDb.index().forNodes(NODEINDEX).query(query); } The following is stacktrace for the exception. "message" : "Error fetching transaction for current thread", "exception" : "NotInTransactionException", "stacktrace" : [ "org.neo4j

Neo4j .NET Client - Getting a Path from a Node to its Root

余生长醉 提交于 2019-12-08 06:35:52
问题 I'm experimenting with Neo4j for the first time. I've played a bit with the console (Cypher queries) and now I'm trying to use the .NET client to build a DAL for a .NET application. For now, my data model is very simple: I have nodes with a label "Folder". These nodes may have a "HAS_SUB_FOLDER" relationship with other folder nodes. I've successfully done some queries such as MATCH (n:Folder) OPTIONAL MATCH n<-[r:HAS_SUB_FOLDER]-parent WITH n, count(parent) AS parents WHERE parents = 0 RETURN

direct neighbor relationships cypher query performance

可紊 提交于 2019-12-08 06:17:19
问题 This question is similar to these two: 16283441, 15456345. UPDATE : here's a database dump. In a db of 190K nodes and 727K relationships (and 128MB of database disk usage), I'd like to run the following query: START start_node=node(<id>) MATCH (start_node)-[r:COOCCURS_WITH]-(partner), (partner)-[s:COOCCURS_WITH]-(another_partner)-[:COOCCURS_WITH]-(start_node) RETURN COUNT(DISTINCT s) as num_partner_partner_links; In this db 90% of the nodes have 0 relationships, and the remaining 10% have

Spring Data Neo4j 4 - How to implement Composite Attribute at Class?

五迷三道 提交于 2019-12-08 06:09:07
问题 I am looking for Composite Attribute example but can not find it everywhere. I have simple class : @NodeEntity public class MyClass{ @GraphId Long id; Double diameter; //Property diameter should be from composite attribute (inDiameter and outDiameter) } MyClass have property diameter, it should be value from inDiameter or outDiameter (can use both as value with some condition) And I have the other class like this: @NodeEntity public class MyClass2{ @GraphId Long id; String name; //Property

Loading data to neo4j from XML using py2neo

爷,独闯天下 提交于 2019-12-08 06:05:38
问题 Im trying to load data to neo4j db from xml file using py2neo this python script works fine but its too slow since Im adding the nodes first then the relationships with two exceptions handlers. besides that the XML file size is around 200MB. Im wondering if there is faster way to perform this task? XML file: <Persons> <person> <id>XA123</id> <first_name>Adam</first_name> <last_name>John</last_name> <phone>01-12322222</phone> </person> <person> <id>XA7777</id> <first_name>Anna</first_name>

neo4j - how do I model node schema less?

筅森魡賤 提交于 2019-12-08 05:52:46
问题 I read some where that noe4j or other nosql database is schemaless. so what is the schemaless? I would like to know more about it with use case. 回答1: You don't need to define a schema like you would have to do e.g. in mysq with a table. Instead, you can add properties and their value to each individual node (entry), as you like. E.g: if you look at the address book in an android phone a person entry can have a multitude of properties - phone numbers, addresses, names. Some people have a lot

find distinct paths in neo4j database

廉价感情. 提交于 2019-12-08 05:30:18
问题 I have a graph in which nodes of type "User" can be connected (or not) to other "User" nodes using "SIMILAR" relationship. I want to find all the sub-graphs (interconnected "User" nodes) ordered by the number of their nodes. Example: Imagine I have these nodes (relationship is always of type "SIMILAR") A -> B, A -> C, D -> B, E -> F, Z I'd like to get : [A,B,C,D]; [E,F]; [Z]; Using Cypher or traversals. 回答1: In cypher it will be expensive. Something like this query: MATCH m WITH collect(m) as