neo4j

Returning two aggregates in a single Cypher query?

℡╲_俬逩灬. 提交于 2019-12-07 15:58:56
问题 I've been struggling some with Cypher in regards to taking the SUM of two values and finding the difference. I have these two queries, which find the total sent and the total received of a node: START addr = node(5) MATCH addr <- [:owns] - owner - [to:transfers] -> receiver RETURN SUM(to.value) AS Total_Sent START addr = node(5) MATCH addr <- [:owns] - owner <- [from:transfers] - sender RETURN SUM(from.value) AS Total_Received Basically my question is - how do I combine these two separate

Neo4j 2.1.2 incremental backup fails but full backup succeeds

元气小坏坏 提交于 2019-12-07 15:36:08
问题 We recently upgraded our database from 2.0.1 to 2.1.2 (Enterprise) using the explicit upgrade procedure. When trying to take a backup post-upgrade, full backups succeed, but incremental backups fail. When running this command the first time, it succeeds: ~/neo4j-enterprise-2.1.2/bin/neo4j-backup -from single://127.0.0.1 -to /mnt/backups/neo4j-test-backup Running it a second time gives the following error: Performing backup from '127.0.0.1' 00:18:44.907 [main] INFO o.n.k

How to import dbpedia into neo4j? [closed]

怎甘沉沦 提交于 2019-12-07 15:12:28
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 5 months ago . I need to import dbpedia into neo4j. I download the dbpedia from here: http://wiki.dbpedia.org/Downloads37 Any idea? 回答1: I am currently doing the same thing. I found that the biggest problem for this is the indexing so the best solution is to write a java program that extracts

@Query shortestPath return type in Spring Data Neo4j

此生再无相见时 提交于 2019-12-07 14:42:08
问题 What's the return Type of the following query and how do I use it? I tried several things like Path , Iterable<Path> , and others but I always hit some sort of exceptions. It seems to be a LinkedHashMap but are there any other handier object types that I can use? @Query( "START u1=node:User(key= {0}), u2=node:User(key = {1}) " + "MATCH p = shortestPath(u1-[*]-u2) " + "RETURN p") public ??? findShortestPath(String u1, String u2); Am I missing any dependencies? This is the only one that I'm

neo4j - Relationship between three nodes

旧巷老猫 提交于 2019-12-07 13:51:04
问题 I'm totally new to Neo4j and I'm testing it in these days. One issue I have with it is how to correctly implement a relationship which involves 3 different nodes using Spring Data . Suppose, for example, that I have 3 @NodeEntity s: User , Tag and TaggableObject . As you can argue, a User can add a Tag to a TaggableObject ; I model this operation with a @RelationshipEntity TaggingOperation . However, I can't find a simple way to glue the 3 entities inside the relationship. I mean, the obvious

How to improve performance for massive MERGE insert?

别说谁变了你拦得住时间么 提交于 2019-12-07 13:30:52
问题 I'm trying to insert data from my SQL db into Neo4J. I have a CSV file where every row generates 4-5 entities and some relations between them. Entities might be duplicate between rows and I want to force uniqueness. What I currently do is: create constraints for each label to force uniqueness. iterate the CSV: start transaction create merge statements for the entities create merge statements for the relations commit transaction I got bad results. Then I tried to commit the transaction every X

LocalDateTime is not converted to String but to Json object

懵懂的女人 提交于 2019-12-07 13:22:42
问题 I want to serialize a creation date of type java.time.LocalDateTime as String, when calling a spring-data-rest service. The field of the entity is annotated with DateTimeFormat(iso=ISO.DATE_TIME). I also registered a LocalData to String Converter in the Spring Configuration class. @Override @Bean protected ConversionService neo4jConversionService() throws Exception { ConversionService conversionService = super.neo4jConversionService(); ConverterRegistry registry = (ConverterRegistry)

Neo4j Cypher: Finding the largest disconnected subgraph fast

时光毁灭记忆、已成空白 提交于 2019-12-07 12:58:07
问题 I have a graph with one million nodes. There are many disconnected subgraphs within it. I would like to know what is the largest disconnected subgraph. For instance this in this graph example we got three disconnected subgraph, so for this case the output will be 7. I tried this but it is taking a long time, match p = ()-[*]-() return MAX(length(p)) as l order by l desc limit 1 回答1: Your query will only ever return the longest path between two separate nodes, not the size of the largest

Using Jena reasoner on Neo4J db

不打扰是莪最后的温柔 提交于 2019-12-07 12:50:11
问题 it's my first time writing here but i'm really struck with a problem: is it possible to use the Jena reasoner on a No-SQL database, like Neo4J, already filled with data? I've a Neo4J's graph rappresenting a bunch of triples and I would like to use the Jena API and the Jena reasoner on them. I thought about using the SDB/TDB component of Jena but I don't get how to actually load the data into my model since the SDB component seems to work with just SQL databases and the go throught the whole

Creating unique node and relationship NEO4J over huge dataset

柔情痞子 提交于 2019-12-07 12:41:57
问题 My question is very similar to this one: How to create unique nodes and relationships by csv file imported in neo4j? I have a textfile with around 2.5 million lines that has two columns, each one being node ids: 1234 345 1234 568 345 984 ... ... Each line represents a relationship (so 2.5 million relationships): first_column nodeid-> FOLLOWS -> second_column nodeid. There are around 80,000 unique nodes in this file. Based on the link above, I did: USING PERIODIC COMMIT 1000 LOAD CSV FROM