neo4j

Why is neo4j's insert speed so low in this example?

狂风中的少年 提交于 2019-12-11 06:49:34
问题 I wanted to test insert speed with the latest spring-data neo4j 4 . I modified the movies example to make things simple and comparable. Try running the test class: movies.spring.data.neo4j.repositories.PersonRepositoryTest here. It takes 5sec to add 400 nodes in this example. https://github.com/fodon/neo4j-spring-data-speed-demo This is a speed test with the older version of neo4j https://github.com/fodon/gs-accessing-data-neo4j-speed The hello.Application class is about 40x faster than

How to I configure my own GraphDatabaseService and GraphAwareRuntime in a spring unit test with boot 2.0 and Neo4j SDN5

喜欢而已 提交于 2019-12-11 06:41:15
问题 I'm writing some unit tests and want to use TimeTree along with Spring repositories, to auto attach event nodes to a time tree. Something like this issue, but I'm using boot 2.0 and SDN5. I think my main issue is I don't know how to set up the configuration so my repositories and my TimeTree use the same GraphDatabaseService. My @Confuration is like this: @Configuration public class SpringConfig { @Bean public SessionFactory sessionFactory() { // with domain entity base package(s) return new

Neo4j 3.2.3: dump command does not find database

匆匆过客 提交于 2019-12-11 06:39:40
问题 I am newbie on the field of graph databases and now I am trying to export my Neo4j 3.2.3 graph database by dump command from neo4j-admin tool on Windows 10, but command everytime failed because is not able to find my graph database. I do not know how to list names of databases running on my PC and check the name of my database. I expected that the name of database corresponds with the name of folder location of my database but it does not work. Could somebody help me? Neo4j GUI client with

Testing with GraphAware Timetree

五迷三道 提交于 2019-12-11 06:29:56
问题 I've been starting to use GraphAware timetree for neo4j, and so far its working out pretty well. Now I'm trying to work out how I can unit / integration test my code that uses neo4j timetree. I've put together some code as below... but still I'm getting the message: org.neo4j.ogm.exception.CypherException: Error executing Cypher "Neo.ClientError.Procedure.ProcedureNotFound"; Code: Neo.ClientError.Procedure.ProcedureNotFound; Description: There is no procedure with the name `ga.timetree.events

combining foreach and case to set/remove relation properties

为君一笑 提交于 2019-12-11 06:29:22
问题 I have two collections, one containing nodes, and another containing rels and nodes (see http://console.neo4j.org/?id=ijoqaa) What I try to achieve is to update the rel properties , depending on the whether a node in one collection is also present in the other. The code below illustrates this (hopefully), although it's not valid cypher. FOREACH (iterm in iterms| CASE WHEN NOT (iterm[1] IN iaterms) THEN REMOVE iterms[0].pos,iterms[0].neg SET iterm[0].explicit=1 END ) Question: what is the way

How to return all newest nodes from neo4j?

北慕城南 提交于 2019-12-11 06:25:41
问题 Is it possible to query neo4j for the newest nodes? In this case, the indexed property "timestamp" records time in milliseconds on every node. All of the cypher examples I have lfound concern graph-type queries- "start at node n and follow relationships. What is the general best approach for returning resultsets sorted on one field? Is this even possible in a graph database such as node4j? 回答1: In the embedded Java API it is possible to add sorting using Lucene constructs. http://docs.neo4j

How to pass Collection Parameters to Repository Queries for Neo4J

ぃ、小莉子 提交于 2019-12-11 06:18:55
问题 Using Spring Data for Neo4J I want to pass a collection as a parameter to a repository query: @Query("MATCH (product:Product) WHERE ANY(c IN product.categories WHERE c IN {categories}) RETURN product") Iterable<Product> findAllWithCategories(@Param("categories") List<String> categories); On the command line the corresponding query runs successfully and delivers the right results: MATCH (product:Product) WHERE ANY(c IN product.categories WHERE c IN ["Märklin","Fleischmann"]) RETURN product But

Loops in cypher

我的梦境 提交于 2019-12-11 06:11:15
问题 The following algorithm finds the page rank (note that this is a tweaked version of page rank algorithm): /* we have to go through all nodes */ MATCH (node:Page) WITH COLLECT(distinct node) AS pages UNWIND pages as dest /* let's find all source citations for a given node */ MATCH (source:Page)-[:NEXT]->(dest) WITH COLLECT(DISTINCT source) AS sources, dest AS dest UNWIND sources AS src /* we have to know how many relationships the source node has */ MATCH (src)-[r:NEXT]->(dest) WITH src, dest,

How can I change neo4j Id to UUID and get finder methods to work?

不打扰是莪最后的温柔 提交于 2019-12-11 05:51:21
问题 Neo4j needs an id field to work which is of type Long. This works well with Spring data neo4j. I would like to have another field of type UUID and have T findOne(T id) to work with my UUID not neo generated Ids. As I am using Spring Data Rest, I don't want to expose neo's id in the URL. http://localhost:8080/resource/{neoId} to http://localhost:8080/resource/{uuid} Any ideas if this is possible? UPDATED { name: "Root", resourceId: "00671e1a-4053-4a68-9c59-f870915e3257", _links: { self: { href

Creating constraint on multiple properties in neo4j

余生颓废 提交于 2019-12-11 05:47:00
问题 I'm new in Neo4j an I need some help. I'm trying to make constraint in multiple properties of nodes at once per two meanings: I need to specify as constraint many properties without typing again and again all over the properties with the command I need to define many properties as ONE- UNITY constraint like in SQL when 3 attributes is a primary key and not separably. How can I achieve it? 回答1: You are actually asking 2 questions. The APOC procedure apoc.schema.assert is helpful for