neo4j

Neo4j Recommendation Cypher Query Optimization

一世执手 提交于 2019-12-10 22:35:39
问题 I am using Neo4j community edition embedded in java application for recommendation purpose. I made a custom function which contains a complex logic of comparing two entities, namely product and users. Both entities are present as nodes in graph and has more than 20 properties each for comparison purpose. For eg. I am calling this function in following format: match (e:User {user_id:"some-id"}) with e match (f:Product {product_id:"some-id"}) with e,f return e,f,findComparisonValue(e,f) as pref

Can't query properties with colon

与世无争的帅哥 提交于 2019-12-10 22:13:33
问题 I am new to neo4j, so my question may sound stupid to you but anyway. I have OSM data set imported to neo4j graph db. So curretnly I am trying to query different stuff from db, like: MATCH (a) WHERE has(a.addr:street) RETURN a.addr:street and it fails with an sysntax error: Type mismatch: expected Node but was Boolean, Number, String or Collection<Any> (line 1, column 23) "MATCH (a) WHERE has(a.addr:street) RETURN a.addr:street" ^ Which is strange, as the nodes has a lot of properties with

Execute multiple CREATE UNIQUE in one cypher query through Rest API

人盡茶涼 提交于 2019-12-10 22:04:11
问题 Using Neo4j version 1.8.1, I'm trying to make use of the "cypher" REST entry point to insert many relationship (the query must insert the relationship, and only if necessary the destination node). I found this possibility through http://christophewillemsen.com/streemz/8/importing-initial-data-with-the-neo4j-rest-api blog post. It works well if I create only one relationship but it fails as soon as I try several. The JSON used to make the call for one relationship which is working : {"query":

Creating geohash relationships in neo4j

喜欢而已 提交于 2019-12-10 21:52:56
问题 I've csv files that contains latitude/longitude fields, what i want is to convert this latitude/longitude into a geohash and then make a relationship between different location nodes based on their geohash values. how to do that ? 回答1: Neo4j has a spatial plugin, that creates a R-Tree for your geo-data. So instead of creating a geohash, you can directly use this plugin. Moreover, the last version of Neo4j has introduced some new types for properties, and one of them is the point . Take a look

Index creation error when starting embedded Neo4j HA Slave

烂漫一生 提交于 2019-12-10 21:31:41
问题 I am trying to create a cluster of Java applications running the embedded Neo4J HA server but I am getting an error when starting any slave servers Caused by: org.springframework.dao.InvalidDataAccessResourceUsageException: Error executing statement CREATE INDEX ON :`DeviceNode`(`deviceType`); nested exception is org.springframework.dao.InvalidDataAccessResourceUsageException: Error executing statement CREATE INDEX ON :`DeviceNode`(`deviceType`); nested exception is org.neo4j.cypher

How to search with cypher 2.0 case insensitive?

不问归期 提交于 2019-12-10 21:29:06
问题 How to search with cypher 2.0 / Neo4j 2.1.7 case insensitive on a indexed field? regex does not use index WHERE a.X =~ ('(?i)' + b.Y) ... using lower() does not use index WHERE lower(a.X) = lower(b.Y) ... adding a extra field with lower case property value for indexing is ugly Not using the index will result in more them 2 mio DB Hits. 回答1: For fulltext search using legacy indexes with Neo4j 2.x which is also case-insensitive check my blog post: http://jexp.de/blog/2014/03/full-text-indexing

How to query neo4j graph with jQuery

寵の児 提交于 2019-12-10 21:27:15
问题 [earlier version has been updated as I try things] I do know some javascript and I have a working neo4j db I can query with cypher in a console. Also, this curl works: curl -X POST http:// localhost:7474/db/data/cypher --data @test.json -H accept:application/json -H content-type:application/json -H X-Stream:true But I want to get results with jQuery $ajax call -- really, any way I can get the JSON result in javascript, doesn't have to be jQuery This function produces the message: 500

How to manually manage Neo4j locks in Spring managed transaction

好久不见. 提交于 2019-12-10 21:24:41
问题 First of all I will explain why I would like to manually set write locks. I use Neo4j database in my web service application based on Spring Data Neo4j. Transactions are managed by Spring, I just use @Transactional annotation. However, I have problem with specific use case which leads to database inconsistency. I have a method that is transactional and its aim is to make such nodes/relation in database: (p:Person)-[:USES]->(s:SIM_Card{phoneNumber:"xxx"}) Its algorithm is as follows: -check if

“No property found for type” combining repositories spring-data-neo4j

霸气de小男生 提交于 2019-12-10 21:17:23
问题 I'm using spring-data-neo4j and I'm trying to combine repositories to be able to use custom ones. I think I've followed correctly the nomenclature conventions specified in 20.8.7 Creating repositories and other SO questions like this. Anyway, I'm doing something wrong because I'm getting this exception message Invocation of init method failed; nested exception is org.springframework.data.mapping.PropertyReferenceException: No property someCriteria found for type User! User entity @NodeEntity

cypher 2.0 query using label does not return any nodes [closed]

微笑、不失礼 提交于 2019-12-10 21:13:39
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 5 years ago . In the neo4j browser, when I click on * under 'Node Lables' returns nodes of all label types, and when I click on any node, I could see the label name appearing at the top. However, the following cypher query is not working. MATCH (n:`Home`) RETURN n LIMIT 25 MATCH (n:Home) RETURN n LIMIT 25 I have turned on the