neo4j

Cypher FOREACH MERGE not hitting the index

眉间皱痕 提交于 2020-01-05 09:32:03
问题 I've got a following parametrized Cypher query: MERGE (p:Person {pid: {personId}}) ON CREATE SET p.value=rand() MERGE (c:Page {url: {pageUrl}}) ON CREATE SET c.value=rand() MERGE p-[:REL]->c FOREACH (tagValue IN {tags} | MERGE (t:Tag {value:tagValue}) MERGE c-[:hasTag]->t) This is very slow, the profiling shows: EmptyResult | +UpdateGraph(0) | +Eager(0) | +UpdateGraph(1) | +Eager(1) | +UpdateGraph(2) +----------------+------+--------+------------------------------+----------------------------

Spring data using Neo4j and MongoDB

霸气de小男生 提交于 2020-01-05 08:21:33
问题 I am just about to go crazy,I just spent many hours to try work with spring-data for Neo4J ,working with spring-data for MongoDB was a walk in the park compared to that. My goals: 1) Working with spring-data to manage two data-stores Mongo,Neo4j. (correct me if I am wrong but there is no spring-data cross data store support for these two, which mean I will use different domain entities for each store) 2) Working with Neo4J embedded graph. 3) Will have the ability to monitor the graph with

Neo4J Gem - Saving undeclared relationships

倖福魔咒の 提交于 2020-01-05 07:23:10
问题 I am trying to create a realtionship between two nodes as described here https://github.com/neo4jrb/neo4j/wiki/Neo4j-v3-Declared-Relationships from_node.create_rel("FRIENDS", to_node) I am getting an undefined method for create_rel What am I doing wrong? I am trying to create a Q+A system inside another model. So both Questions and Answers are treated as models right now. I'm getting a undefined method create_rel' for # event.rb has_many :out, :event_questions event_question.rb has_one :in,

Neo4j Javascript Driver Server keeps Expiring Session

牧云@^-^@ 提交于 2020-01-05 07:20:10
问题 I've tried the following in node 7.3.0, 7.3.1 and 8.0.1: import * as v1 from 'neo4j-driver'; const neo4j = v1.v1; const auth = neo4j.auth.basic( 'neo4j', 'password' ); console.log( 'auth.basic returned: ' + JSON.stringify( auth )); const driver = neo4j.driver( 'bolt://localhost', auth ); const session = driver.session(); const query = ` CREATE (string:TEST:Type {name: 'String'}) CREATE (int:TEST:Type {name: 'Int'}) CREATE (id:TEST:Type {name: 'ID'}) CREATE (query:TEST:Type {name: 'Query'})

Unable to set nested parameters through the neo4j browser with version 3.2.2

拥有回忆 提交于 2020-01-05 07:17:09
问题 I've opened the neo4j browser and tried to run the following query: :params {"uidLeft": "asdf1", "uidRight": "asdf2", "type": "KNOWS", props:{uid:"rel1"}} And I get the following error: Could not parse input. Usage: :param "x": 2 . SyntaxError: Expected ",", "}" or key but "{" found. Are nested properties supposed to be supported? Here's a screenshot: 回答1: Try removing the outer parenthesis, that shouldn't be needed: :params "uidLeft": "asdf1", "uidRight": "asdf2", "type": "KNOWS", props:{uid

Using Neo4J Traversal API to perform traversal on Neo4J running on other machine

你。 提交于 2020-01-05 06:59:11
问题 After reading through Traversal API, I liked the idea the concept of BranchSelector , Expander and Uniqueness . It is something like describing how traversal should be made. In other words, I felt it like giving declarative description of traversal to be performed. The fluent API is well suited for this purpose. However it seems that it can only be used to target neo4j whose database can be accessed through file system, that is we need to specify graph.db folder path. This essentially means

How to modeling this relation in spring data neo4j?

时光怂恿深爱的人放手 提交于 2020-01-05 06:32:32
问题 Given I have two entity: Person and Company , and there are multiple relationships between them: Person - Company: The person can be the employee of the company The person can be the shareholder of the company The person can be the legal person of the company Company - Company: The company can be the legal of the company The company can be the shareholder of the company So how to modeling this in spring data neo4j? What I tried is make 3 relationship types: EMPLOY, INVEST, LEGAL, each

How to modeling this relation in spring data neo4j?

允我心安 提交于 2020-01-05 06:32:28
问题 Given I have two entity: Person and Company , and there are multiple relationships between them: Person - Company: The person can be the employee of the company The person can be the shareholder of the company The person can be the legal person of the company Company - Company: The company can be the legal of the company The company can be the shareholder of the company So how to modeling this in spring data neo4j? What I tried is make 3 relationship types: EMPLOY, INVEST, LEGAL, each

Clone nodes and relationships with Cypher

大城市里の小女人 提交于 2020-01-05 05:50:08
问题 Is it possible to clone arbitrary nodes and relationships in a single Cypher neo4j 2.0 query? 'Arbitrary' reads 'without specifying their labels and relationship types'. Something like: MATCH (node1:NodeType)-[e]->(n) CREATE (clone: labels(n)) set clone=n set clone.prop=1 CREATE (node1)-[e1:type(e)]->(clone) set e1=e set e1.prop=2 is not valid in Cypher, so one cannot simply get labels from one node or relationship and assign them to another, because labels are compiled into the query

How to get spring neo4j cypher custom query to populate an array of child relationships

做~自己de王妃 提交于 2020-01-05 05:39:06
问题 Built-in queries to Spring Data Neo4j (SDN) return objects populated with depth 1 by default. This means that "children" (related nodes) of an object returned by a query are populated. That's good - there are actual objects on the end of references from objects returned by these queries. Custom queries are depth 0 by default. This is a hassle. In this answer, it is described how to get springboot neo4j to populate a related element to the target of a custom query - to achieve an extra one