Questions tagged [cypher]

Cypher is a graph query language for Neo4j and AgensGraph. For ciphers as in encryption, see cipher.

1
vote
0answers
2 views

Spring Data Neo4j - findById method throws an invalid query exception after upgrading to Spring Boot 2

I have been working on a micro-service created using Spring Boot with Neo4j as the database. The two relevant entities within it Product and AccessoryRelation are thus: @NodeEntity @QueryEntity ...
0
votes
1answer
13 views

Neo4j/Cypher: Extracting the last item of a StringArray (This what neo4j called it)

Lets say I have a node with a property, Event, that is assigned a StringArray. I am trying to extract '6013' and '6005' that were assigned from a collection when the node was created ( see below for ...
0
votes
2answers
33 views

Neo 4j - How to count the number of times two relationships appear in the same nodes

Suppose I have 3 nodes A, B and C, and two relationships r1 and r2, how can I count the number of times that the two relationships occur on the same nodes? For example: A-[r1]-B A-[r2]-B A-[r1]-C B-[...
0
votes
0answers
28 views

Neo4J LOAD CSV Memory issue

I've read many blogs/SO questions about the problem with eager queries in neo4j for LOAD CSV - but I'm still getting a hung db with eventual memory issues. Here is my query USING PERIODIC COMMIT ...
0
votes
1answer
16 views

How could I use a WHERE in an EXISTS() in Cypher

I am trying to find all path in a graph between two nodes, with the condition that any node in this path must be connected to another node with a label TIMESWITCH and valid endDate and startDate. The ...
0
votes
0answers
9 views

Neo4j GraphClient Ignore JSON

I'm trying to do a batch unwind in C# using the graphclient but it keeps adding the properties using the JsonProperty value when I don't want it to. Is it possible to disable the Json so it adds into ...
0
votes
2answers
17 views

Creating path of nodes

If I should have an array, and I want to MERGE all the element in the array into a path of nodes so that when given the relationship name, the nodes will be created if they do not already exist and ...
0
votes
1answer
15 views

CYPHER get edges between nodes

I currently have a graph with containing routes that have Id's and need to find all routes between A and E. I don't need to do a shortest path as all the routes have Id's. I currently run multiple ...
0
votes
1answer
28 views

Cypher/Neo4j: Convert any to string (due to application of REVERSE)

I would like to reduce a list into a string to adhere to a specific output format which requires a pipe ( '|' ) between the elements. I do it as follows: WITH ["three", "two", "one"] AS a RETURN ...
-1
votes
0answers
39 views

why neo4j use cypher rather than gremlin

As far as I know, neo4j use gremlin (tinkerpop) for querying before they develop cypher. And now they use cypher totally. Any advantages cypher has but gremlin does not? I know the tinkerpop ...
0
votes
1answer
19 views

Adding a new node to database, how to automatically update rule-based links

Please excuse the simplicity of the question perhaps - I am a newbie! I have a few thousand nodes and a few tens of relationships, but the relationship are largely based on a series of rules and ...
0
votes
1answer
28 views

Neo4j/Cypher: Passing properties through WITH

I am posting a new question because this is a separate but related issue to this question: Neo4j: Link Different Nodes to the one node The below query is returning the correct number of nodes. ...
0
votes
1answer
28 views

Relation not in use Neo4j?

I tried to delete a node with its relations but I get this error Relationship[332147,used=false,source=-1,target=-1,type=-1,sCount=1,sNext=-1,tCount=1,tNext=-1,prop=-1,secondaryUnitId=-1, sFirst, ...
0
votes
1answer
15 views

Can I use ANSI SQL for graph data in AgensGraph?

I know AgensGraph supports ANSI SQL and Cypher language both. If so, can I use ANSI SQL for graph data? and the opposite too. What I want to know is, should I choose and use the language for each ...
0
votes
2answers
48 views

Efficiently assigning UUIDs to connected components in Neo4j

I have partitioned my graph into ~400,000 connected components using the algo.unionFind function from the Neo4j Graph Algorithms library. Each node n within the same connected component has the same ...
0
votes
2answers
80 views

Cypher query for pair of nodes that are related to at least 2 other nodes?

I have a problem where I need to find a count of nodes where a pair of same node type are both connected to. so (a1)--(b) (a2)--(b) (a1)--(c) (a2)--(c) The result I want to have is: a1, a2, 2 [the ...
0
votes
1answer
38 views

neo4j - Improving a Cypher query

I have a performance critical application which has to match multiple nodes to another node based on regex matching. My current query is as follows: MATCH (person: Person {name: 'Mark'}) WITH person ...
0
votes
0answers
41 views

Shortests weighted path with Neo4j.rb and Ruby On Rails

I am trying to calculate the shortest weighted path between two nodes. Here's my User class: class User include Neo4j::ActiveNode property :name, type: String has_many :both, :friends, ...
-1
votes
1answer
27 views

Neo4j Cypher query to return subgraph and limited node properties

I have basically the same question as this one, but it's not really answered there and in my case I also want relationships among the nodes. I want to match a set of nodes and relationships, but I ...
0
votes
2answers
46 views

Neo4j: Link Different Nodes to the one node

Let's say you have the following 4 nodes: Set 1: (act: "Event Log", timestamp: 3461000) (act: "Uptime Report", timestamp: 3461000) Set 2: (act: "Event Log", timestamp: 149100) (act: "Uptime Report", ...
0
votes
1answer
30 views

Cypher (Neo4j) - Find all relationships as long as one relationship from node satisfies a condition regardless of search path?

Excuse the bad title, I'm a beginner with Cypher and Graph databases in general. I'm not sure if the title fully captures what I am trying to ask, please let me know if you have any better titles! I ...
-1
votes
0answers
20 views

Cypher or Apoc Query for Getting list of Nodes Connected Through Intermediate Nodes with Weights

graph-example In this graph I need Cypher or APOC query which returns the list of products which are related to the main product PROD-A (the big circle) through transactions (the small circles). ...
0
votes
1answer
45 views

update relationship between two nodes if one exists, or create a new relationship if one does not already exist NEO4j

I want to write a query that; updates a relationship between two nodes if one already exists, or if a relationsihp doesnt exist create one between the two nodes. In reality this is to allow one ...
2
votes
1answer
18 views

Neo4J - Cypher Query using Predicate function not fetching desired output

I am new to Neo4j and Cypher and trying to pull all Cities that do not have even a single hospital offering Oncology Treatment I've written below query using ALL() function however it is even ...
0
votes
1answer
23 views

Find checked/unchecked Exceptions with jQAssistant

I'm trying to use jqassistant to find any checked exceptions used in my project. Is there any way to differentiate between checked/unchecked exceptions with jqa?
1
vote
1answer
39 views

efficient querying of array property in neo4j

I've wanting to query for nodes that have a specific value in a string array property. For instance my nodes might have 2 properties, name (a string) and aliases (a string array). I have created an ...
0
votes
1answer
40 views

How to make GROUP BY in a cypher query?

I want to translate a SQL query to cypher. Please, is there any solution to make GROUP BY in cypher? SELECT dt.d_year, item.i_brand_id brand_id, item.i_brand ...
1
vote
1answer
25 views

Generate disjoint star-like subgraphs based on equalities

Consider this toy example: MERGE (:Obj {desc:'A',id:1}) MERGE (:Obj {desc:'A',id:2}) MERGE (:Obj {desc:'A',id:3}) MERGE (:Obj {desc:'A',id:4}) MERGE (:Obj {desc:'B',id:5}) MERGE (:Obj {desc:'B',id:6})...
-1
votes
1answer
33 views

NEO4J - Best practices to store 40 millions of text nodes

I've been using Neo4j for some weeks and I think it's awesome. I'm building an NLP application, and basically, I'm using Neo4j for storing the dependency graph generated by a semantic parser, ...
0
votes
1answer
25 views

Neo4j loop thru nodes to improve query performance

I'm working on a project on Neo4j. I have about 1 million nodes and 4 million relationships. When I try to perform a query, it takes like 15 seconds to give me the result. I also have set indexes on ...
0
votes
1answer
20 views

How to create nodes with variable labels in cypher?

I am using JSON APOC plugin to create nodes from a JSON with lists in it, and I am trying to create nodes whose label is listed as an element in the list: { "pdf":[ { "docID": ...
-1
votes
1answer
36 views

Wrong result when query has more filters

MATCH (prs:Issue)-[:REPORTED_BY]-(custs) MATCH (prs)-[:CLOSED_ON]-(cls:IssueClosedDate) MATCH (prs)-[:REPORTED_BY]->(custNode:Customer) MATCH (prs)-[:APP_FUN_CAT]-(afc:AppFunCat) MATCH (prs)-[:...
1
vote
0answers
22 views

neo4j apoc.trigger.add with property update

I am trying to implement trigger on neo4j to execute when single property gets changed CALL apoc.trigger.add('setUpdated-reference',' UNWIND apoc.trigger.propertiesByKey({assignedNodeProperties}, "...
0
votes
1answer
16 views

Cypher query returns no results

I have the query which finds the shortest path between 2 nodes. These nodes are labeled as devices but they are also connected to Apps nodes. So I have 2 app_ids and I would like by these ids find all ...
1
vote
0answers
28 views

Model source informations to maximize query performance

I am wondering about the best way (in terms of performance) to model data sources in Neo4j. Consider the following scenario: We are joining different datasets about the music domain in one graph. The ...
0
votes
1answer
30 views

Weight in Relationship Property Neo4j

I want to add weight in relationship property. Weight are counted from this code: MATCH (n1)-[r1:NEXT]->(n2) DELETE r1 RETURN n1, n2, apoc.create.vRelationship(n1, 'WEIGHT', {weight:count(r1)}, n2)...
0
votes
2answers
78 views

Filter Relationships in Neo4j Using Start/End Dates

I have a graph model - (p:Person)-[r:LINK {startDate: timestamp, endDate: timestamp}]->(c:Company) A person can be linked to multiple companies at the same time and a company can have multiple ...
-1
votes
1answer
44 views

Use py2neo to return nodes from Cypher query

I am trying to do a basic retrieval of a node from my Neo4j database using py2neo and a cypher call, but I can't find any examples of working code for py2neo v4.1 and the documentation has no real ...
0
votes
1answer
41 views

How to create relationships among similar/parallel paths in neo4j?

I'm looking for a way to batch create relationships among similar/parallel paths in neo4j. A sample graph may look like this: As you can see, the pink node(the one in the center) :WRAPS 3 yellow ...
-1
votes
1answer
22 views

Why does this Cypher return an array of arrays for the `data` key?

Query curl -X POST \ http://my-neo4j.example.com:7474/db/data/cypher \ -H 'Accept: application/json; charset=UTF-8' \ -H 'Cache-Control: no-cache' \ -H 'Content-Type: application/json' \ -H ...
0
votes
1answer
25 views

Counting the number of relationships foreach Trip

I have a graph database composed with this pattern : (start)-[:Trip]->(end) I want to return the number of trips between the start and the end node and that on each different Trip((start)-[r]->(...
0
votes
1answer
26 views

Neo4j browser and some databse queries

what is the difference between remote and a local graph in neo4j browser. I have searched an answer for this question but didn't get any so please help me . thanks is advance.
0
votes
1answer
27 views

Neo4j http Cypher query illegal character '{'

I am attempting to query Neo4j using a cypher query in http. I'm using Fiddler to write and send the request. Here is an example of a very simple query I've attempted. POST http://localhost:7474/db/...
0
votes
1answer
35 views

Neo4j Cypher pattern: fail-fast on multi-part pattern

I have a multi-part cypher pattern, where the first part is really fast and the subsequent parts are really slow: MATCH (m:EntityX {indexed_property: 1234})-[]->(a0), (a0:EntityY)-[]-(a1:Entity:Y),...
0
votes
0answers
23 views

Find hierarchical path between 2 nodes Neo4j

I have a node with Device label and there are such fields like - device_id, column1, column2, column3. I want to find a connection between node1 and node2 with known device_ids. These nodes are not ...
0
votes
1answer
22 views

Recursive query by multiple relations Neo4j

I want to perform a recursive query with some kind of intersection. I have a node with Device label and there are such fields like - device_id, column1, column2, column3 I need to find all the records ...
0
votes
1answer
24 views

Cypher - Multiple mapping when loadiing CSV files

I'm a beginner with Cypher language (Neo4J) and I have try to find an answer to my problem without success. I have loaded successfully nodes for Year(year), Month(month) and Day(day) with Has_Month ...
0
votes
1answer
30 views

Neo4j - Cypher - images gallery system with parents and child

I'm new to Neo4j with a mysql background, I'm trying to convert an old mysql image gallery system to a Neo4j graph database, the schema that I came with is represented in the graph below : _ There ...
0
votes
1answer
19 views

Cypher does not use NodeIndexSeek without hint

I add relationships with an UNWIND query (neo4j 3.4.7, 30 GB heap, 30 GB page cache): UNWIND { rels } AS rel MATCH (a:Locus), (b:Snp) WHERE a.chr = rel.start_chr AND a.start = rel.start_start AND a....
2
votes
2answers
36 views

How to check if an index exist in neo4j cypher

I am trying to find a way to check if a certain index exists in cypher schema indexes. I can find all the indexes by using call db.indexes() . but how can I check for a specific index?