Questions tagged [cypher-3.1]

50 questions
3
votes
1 answer

how to match 2 nodes by relationship in Neo4j?

Given a list of (let say 4) MicroRNA and a list of relationships (pictar, rna22,…), returns the list of target TargetGenes common to all MicroRNA in all relationships. I am trying to do by this way but it does not work... MATCH…
Giorgi
  • 31
  • 4
2
votes
2 answers

WHERE condition in neo4j | Filtering by relationship property

How does the where condition in neo4j works ? I have simple data set with following relationship => Client -[CONTAINS {created:"yesterday or today"}]-> Transaction -[INCLUDES]-> Item I would like to filter above to get the items for a transaction…
alex
  • 65
  • 5
2
votes
2 answers

neo4j delete a node in linked list

I have a list of posts that belong to a user. The posts are structured as linked list that belongs to a given user. I am having deleting the a given node while preserving the data structure. Here is an illustration of the structure. In my list…
thedethfox
  • 1,651
  • 2
  • 20
  • 38
2
votes
1 answer

Calculating In Degree and Out Degree in a single query

I could use the below query for "In Degree" successfully: match a=(p:Person)-->(q:Person{Address:'0xa1e4380a3b1f749673e270229993ee55f35663b4'}) RETURN count(a) as In_Degree I could use the below query for "Out Degree" successfully: match…
user8494391
  • 49
  • 1
  • 5
2
votes
2 answers

Find nodes where 2 number ranges overlap

I have nodes with the following properties (n:User {valUpper:100, valLower:-100}) (m:User {valUpper:200, valLower: 0}) Using cypher is it possible to find if (m)'s range overlaps with (n)? This is what I would have done in js.. if max(x2, y2) -…
gk103
  • 377
  • 5
  • 15
1
vote
1 answer

how to calculate a distinct count for nodes

I need your help in neo4j project. I have two nodes Author and Article. The relationship between those is (author:Author)-[:WRITES]->(article:Article) An article could be written by more than one author. So i want to calculate which are the top 5…
person
  • 25
  • 4
1
vote
1 answer

Cypher: Query to check if node is part of top 10 results

I'm trying to make a cypher query which does the following Find the top 10 largest USA organisations (in terms of revenue) Return "True" if an organisation part of the top 10, if not return "False" My attempted code looks like this to extract…
star_it8293
  • 399
  • 3
  • 12
1
vote
1 answer

How to find nodes in a neo4j database based on a large list of names

So I work with a neo4j database and I would like to find certain people in this database. People are stored as nodes and have certain properties and relationships to other nodes. Now I have a list (xlsm/csv file) of people I want to find. This list…
Sol
  • 11
  • 3
1
vote
3 answers

Complexity of a neo4j query

I need to measure the performance of any query. for example : MATCH (n:StateNode)-[r:has_city]->(n1:CityNode) WHERE n.shortName IN {0} and n1.name IN {1} WITH n1 Match…
Reetish Chand
  • 103
  • 1
  • 10
1
vote
1 answer

How to optimize this cypher query to get faster Result

the-file-name.csv is on the previous question How to make the Cypher request to handle those both cases without duplicating Nodes On the first step I do CREATE CONSTRAINT ON (r:Region) ASSERT r.region IS UNIQUE; CREATE CONSTRAINT ON (c:City)…
Schwertfisch
  • 133
  • 3
  • 16
1
vote
2 answers

Why multiple nodes are created in Neo4j by CREATE or MERGE query

I'm using Cypher to create some data in Neo4j. It's a pretty straight forward product model, with following elements Product (e.g. a mobile) Features (e.g. quick charge) Related products (e.g. tampered glass) Outlets (e.g. local store, related…
Arghya C
  • 9,805
  • 2
  • 47
  • 66
1
vote
1 answer

cypher query with apoc.path.subgraphAll , it seems limit config is not working

I am executing following query: MATCH (e:COMP) WHERE e.componentID= "f4db22e7-68d2-473d-960b-c98dbbadb3a0" with e limit 1 CALL apoc.path.subgraphAll(e, {relationshipFilter:'CHILD_OF|CONNECTED_TO|LINKED_TO', limit:10}) YIELD nodes UNWIND nodes as…
Shishal
  • 27
  • 1
  • 9
1
vote
1 answer

neo4j: how to return nodes' content with node name?

I select a path and want to return distinct nodes from that path with labels: match path = ... unwind(nodes(path)) as node return distinct node { .*, type: labels(node)} As a result I get [{node={a:1, b:2, type=[t]}}, {node={a:3, b:4 type=[x]}}] i…
piotrek
  • 13,982
  • 13
  • 79
  • 165
1
vote
1 answer

Handling escape character (\) in Neo4j Cypher Query

Is there any way to ingest data with backslash (\) character into Neo4j without replacing it with double backslash (\\)
Saurabh wagh
  • 61
  • 1
  • 9
1
vote
1 answer

Order by nodes that received more relationships in a certain period of time

Is it possible to order by nodes that received more relationships in a certain period of time? For example, I have User and Movie, and a User can LIKE a Movie. The LIKE relationship has a property called date, which is the moment the user liked the…
sadtroll
  • 191
  • 4
  • 17
1
2 3 4