neo4j

Cypher Search Query Fuzzy query

左心房为你撑大大i 提交于 2019-12-12 03:08:13
问题 I want to use cypher to search, I have four movie enerties, forrest, sky, sky1, sky2 I want search sky I want it returns sky, sky1, sky2 My cypher is @Query("MATCH (movie:Movie) WHERE movie.title =~ '.*{0}.*' RETURN movie") or @Query("MATCH (movie:Movie) WHERE movie.title =~ '(?i).*{0}.*' RETURN movie") Neither of those works well: it return forrest, sky,sky1, sky2 no matter what I search (forrest or sky). What is wrong? controller @RequestMapping(value = "/movies", method = RequestMethod.GET

neo4j java node dynamic properties

纵然是瞬间 提交于 2019-12-12 03:06:49
问题 I am trying to create nodes of a specific type with properties which can be dynamic . For Example : I can create a Person node with name,age,address properties. But these need not be the only properties when I create another Person node. This node can have name,age,address and an additional property salary. Using spring data or query DSL needs me to create Java POJO class Person with fixed number of instance variables name,age and address . @NodeEntity public class Person { @GraphId private

Import large Data in Neo4j without knowing the node id

╄→尐↘猪︶ㄣ 提交于 2019-12-12 03:03:27
问题 I have a problem in witch is the best way to insert some data in neo4j db. I have a file with a lot of movies info, each movie has a different id like "tt0202025". I also have a file with the actors info and each one has an id like "mm2183122" I have another file witch describes in which movie an actor is part of. mm2183122|tt0202025,tt0204548 I have found some things for csv like insertion but i am not able to create the relations file between the nodes before because of the data size. Do i

neo4j: shortest paths constrained by node and rel properties

﹥>﹥吖頭↗ 提交于 2019-12-12 03:02:12
问题 From the tutorial: MATCH p=shortestPath( (keanu:Person)-[:KNOWS*]-(kevin:Person) ) WHERE keanu.name="Keanu Reeves" and kevin.name = "Kevin Bacon" RETURN length(p) Imagine each Person node has an age property and an occupation. Every KNOWS edge has a length of acquaintance property. What Cypher query would return a shortest path with, for instance, age > 40 years not (occupation = ACTOR) lengthOfAcquaintance > 10 years In molecular biology interaction data, we wish to make yet more complex

Neo4j - read and save data

人走茶凉 提交于 2019-12-12 02:55:27
问题 I've got problem with Neo4j. First of all, I've got pieace of code: GraphDatabaseService graphDb = new EmbeddedGraphDatabase("neo4j-store"); // creating some nodes, relationships and commiting transactions but I can't find that datas in: http://localhost.pl:7474/webadmin ... why? And on the other hand. When I create some data via webadmin I can't read it from my java application. Why? 回答1: The web console pulls from where the neo4j is installed/run from. So it's usually {neo4j.home}\data

SDN4 custom query pagination alternative for Page contents

送分小仙女□ 提交于 2019-12-12 02:51:53
问题 Currently Pagination isn't supported in SDN4 (Ref: Paging and sorting in Spring Data Neo4j 4) It's possible to specify the SKIP and LIMIT clauses ourselves to retrieve parts of the results, however for our system we also need the getTotalPages(), isFirst() and isLast() values from the Page returned when performing a custom paging query. Is there an alternative way for us to retrieve these values using SDN4 / OGM? Alternatively, are there any recommendations / references to code that can be

How to fixedly assure neo4j will return a Long value for attribute

别说谁变了你拦得住时间么 提交于 2019-12-12 02:49:31
问题 i did some experiments with neo4j 2.3 version and direct calls on transactional endpoint http://localhost:7474/db/data/transaction/commit and create the node with long attribute curl -X POST -H "Content-Type: application/json" -d '{ "statements" : [ { "statement" : "MERGE (c:`foo` {id:{_queryId}}) ON CREATE SET c.`created`={created} RETURN c", "parameters" : { "created" : 1111111111111111111 }}] }' "http://localhost:7474/db/data/transaction/commit" While reading this data on client side (Java

Cypher -Tally report on the depth of each relationship type stemming from parent node

岁酱吖の 提交于 2019-12-12 02:48:05
问题 I am trying to create tally report on the depth of each relationship type stemming from parent node but I running into issues with the following error: "Type mismatch: r already defined with conflicting type Relationship (expected Collection<Relationship>) Here is the output I am attempting to achieve: [ { reltype : "123A_RelationshipTitleOne", depthcount : 5 }, { reltype : "123A_RelationshipTitleTwo", depthcount : 9 }, { reltype : "123A_RelationshipTitleThree", depthcount : 42 } ] Here is my

Having `Neo.ClientError.Statement.InvalidType` in Neo4j

喜夏-厌秋 提交于 2019-12-12 02:47:24
问题 While running the following query in Neo4j USING PERIODIC COMMIT LOAD CSV WITH HEADERS FROM 'file:///home/peppa/database/ap/aC.csv' AS line CREATE (:Aporte {Organization: line[1] ,ruc: line[2] , year: line[4] ,date: line[6] ,process: line[7] ,LastName: line[8] ,LastNameM: line [9] ,Name: line[10] ,DocType: line[11] ,DocNum: line[12] ,TypeAp: line[13] ,Nature: line[14]}) I get the following error: Expected 10 to be a java.lang.String, but it was a java.lang.Long Don't know if the file is bad

Organize alternative names (nicknames, aliases) in neo4j

一世执手 提交于 2019-12-12 02:46:19
问题 Say you have some nodes in your model that may go by multiple alternative names, but all the names refer to the same object. For example, you may want to be able to query the "World" node by using name "World" in one context, whereas in different context you want to find the same node quickly also by the name "Global". Is it optimal to organize this information in the form of string array property aliases like this? : 回答1: If you add World to your aliases you can use the legacy node_auto