Questions tagged [cypher-3.1]

50 questions
0
votes
2 answers

Neo4j Cypher - Conditional writes on matches

I have a database with users (u:User {id: 1}), user statuses (us:UserStatus {status: 'pending'}), and the relationships between them (u)-[hs:HAS_STATUS {from: 1541030400, to: 4102444800}]->(us). Where user statuses can be "pending", "active" or…
tshaw
  • 31
  • 6
0
votes
1 answer

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 creation query code) and assign them to as another…
N6DYN
  • 325
  • 1
  • 3
  • 17
0
votes
1 answer

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. MATCH (act)--(obj) WHERE obj.filename IN ["6013",…
N6DYN
  • 325
  • 1
  • 3
  • 17
0
votes
1 answer

Geohash Roll up Graph (level 5) from (level7) with Cypher?

I am trying to create a geohash graph with level 5 of zoom from an existing one with level 7. i tried this code : FROM GRAPH mergedGraph MATCH (from)-[via]->(to) CASE WHEN substring(from.geohash,0,5)=substring(to.geohash,0,5) THEN CONSTRUCT …
A.HADDAD
  • 1,809
  • 4
  • 26
  • 51
0
votes
2 answers

Neo4j cypher Query - How to get specific labels data?

I want to get only customer and supplier name and ID using cypher query. "Match (n: customer:supplier) where has (n.ID) return n.ID,n.nme"; How to combine 2 labels to get the data? Above query is getting syntax error. Please advise.
user2848031
  • 187
  • 12
  • 36
  • 69
0
votes
1 answer

when loading csv in neo4j do not create all the relationships

good to all please help me with this problem :D when I execute my query: USING PERIODIC COMMIT LOAD CSV WITH HEADERS FROM "file:///Create_all.csv" AS row MATCH(x:Category{uuid:row.uuid_category}) MERGE (t:Subscriber{name:row.name_subscriber,…
Claure
  • 55
  • 1
  • 1
  • 4
0
votes
1 answer

Neo4j - shortestPath not returning path length

I am attempting to execute a "shortestPath" cypher query in Neo4j but am encountering a strange difficulty. I should get "2 nodes" as the shortest path, however I get nothing. MATCH p=shortestPath((charlize:Person)-[:KNOWS]-(bacon:Person)) WHERE…
Jeh Hayer
  • 13
  • 4
0
votes
1 answer

Neo4j queries very slow

I set up a Neo4j 3.3.5 database with the following Labels: Tag: 30K Expert: 304K Publication: 28M There are 1.2B relationships between tags and publications. And 455K relationships between publications and experts. I've done tests on a Mac (16G -…
0
votes
1 answer

cypher distinct is returning duplicate using with parameter

MATCH (c:someNode) WHERE LOWER(c.erpId) contains (LOWER("1")) OR LOWER(c.constructionYear) contains (LOWER("1")) OR LOWER(c.label) contains (LOWER("1")) OR LOWER(c.name) contains (LOWER("1")) OR LOWER(c.description) contains…
Abdullah Al Noman
  • 2,817
  • 4
  • 20
  • 35
0
votes
1 answer

cypher how get relation between every two node and the distance from start node?

I have some nodes and relation like A -> B ->C -> D; andB->DSo the B C D is a loop, now I want get all relations and each relation distance from node A; I expect result like: {startNode: A, endNode: B, rel:FRIEND, distanceFromAtoEndnode:…
WesleyHsiung
  • 351
  • 2
  • 13
0
votes
1 answer

how to normalize value in neo4j cypher

Given the set of results, I would like to normalize one value. Example of ideal world query: match (c)<-[:WORKS_FOR]-(u)-[:KNOWS]->(s) where s.label = "Test" with u as users match (users)-[com:SEND]-(otherUsers) with users, sum(com.count) as…
Jacek Dominiak
  • 857
  • 1
  • 9
  • 19
0
votes
2 answers

"Unable to deserialize request: Unexpected character ('j' (code 106)): was expecting comma to separate OBJECT entries

I'm having trouble sending something to neo4j api. This is the body of my request. { "statements" : [ { "statement" : "Create (user:User{ name: "jon" }) Return user" } ] } I'm getting: { "results": [], "errors": [ { …
AIon
  • 12,521
  • 10
  • 47
  • 73
0
votes
1 answer

Cypher query whether a node is connected to multiple nodes in a filtered group

I am experimenting with a graph representing (:Shopper)'s who -[:Make]->(:Purchase)'s and each purchase -[:Contains]->(:Item)'s. The challenge is that I want to compare the quantity of Item A each Shopper bought on their most recent purchase.…
0
votes
1 answer

Is there a way to add the values present in an array in cypher?

I have got two arrays through the following cypher query return p.home,p1.away collect(distinct toInteger(p.score[0])) as value1, collect(distinct toInteger(p1.score[1])) as value2 Here, value1=[1,2,3,4] and value=[3,0,6,2] I wanted to…
Suman
  • 53
  • 7
0
votes
1 answer

how to get total score as a sum of two two score values in neo4j or cypher

I have tried the following query to get total score (score is in array of string like ("5","2")) as sum of home score and away score game. match (e:Epl), (e1:Epl) where ((e)-[:AWAY]->(e1) or (e1)-[:HOME]->(e)) and e.home=e1.away return…
Suman
  • 53
  • 7