Questions tagged [opencypher]

For questions related to openCypher, a declarative graph query language

openCypher, a declarative graph database query language, is an open source project, including a language specification, located at here and the specification is available here.

105 questions
1
vote
1 answer

Can two way relation be created in single CREATE query?

When I have two nodes that are connected in both directions, I use two create queries to connect them: MATCH (london:City {name: "London"}) MATCH (dublin:City {name: "Dublin"}) CREATE (london)-[:Flight {length: 450}]->(dublin) CREATE…
Juliette Gia
  • 126
  • 6
1
vote
1 answer

Why do I neeed to use new variable after unwinding in Cypher?

I've been playing around (learing) with Cypher. I've created a query that will return list of the cities that are between 190 and 200 distnace units away from London. This is the code: MATCH path=(:City {name: "London"})-\[:Road \*…
Juliette Gia
  • 126
  • 6
1
vote
1 answer

Can I print out somehow result of rand() function called from Cypher?

I have the following code: MATCH (:City {name: 'London'})-[road:Road]->(city:City) WHERE NOT city.name IN ['Islington', 'Wembley'] RETURN city.name ORDER BY road.length ASC LIMIT 1 + toInteger(7*rand()); On each run I get differnt number of…
Juliette Gia
  • 126
  • 6
1
vote
2 answers

Regular expression on the string of a property name in Cypher

I know it is possible to use regular expressions for property values like for example: MATCH (n) WHERE n.SomeProperty =~ 'somestring*' RETURN n; What i want is to use regular expression on the property name and check for all the properties which…
L.Rex
  • 427
  • 5
  • 12
1
vote
1 answer

Using the MATCH statement in NebulaGraph database fails

I have NebulaGraph database version 3.1.2 running in my AWS environment and I am testing basic openCypher. If I run MATCH (n:Person{lastName:"Brown"})-[e:LIKES_COMMENT]-(m) RETURN m.locationIP, it fails to retrieve the user IP. Not sure where it…
randomv
  • 218
  • 1
  • 7
1
vote
1 answer

How to do random node scan in NebulaGraph database?

I tried to fetch 10 random and non-isolated nodes in the Nebula Graph database. According to their docs the query should be MATCH (n:tag)-[e]-() RETURN n LIMIT 10. But it fails to work. The screenshots of running the query is as follows: What is…
randomv
  • 218
  • 1
  • 7
1
vote
1 answer

How to find all nodes between two nodes in graph database?

I`m using Cypher query language and I need to find nodes between node A and E. (A->B->C->D->E) Next query returns all nodes including A and E, but i need to exclude them, to have B, C, D nodes. How can I filter my query result? MATCH p=…
1
vote
0 answers

Return variable state before WHERE in Cypher query

Consider the following query where some items are merged into the database and where one of the properties is converted into a relationship (all in one go): # items=[{id: 'a', experiment: 1}, {id: 'b'}] UNWIND $items AS item MERGE (x:Item { id:…
BorjaEst
  • 390
  • 2
  • 11
1
vote
1 answer

OpenCypher - Get all nodes that not connect to the center of the graph

I have a graph on Neptune and I used OpenCypher to query on it. At the middle of the graph I have a big connected nodes, at the edges you can see that I have some single nodes/ nodes that connected only to 1-5 other nodes. (see on the picture) I…
0
votes
0 answers

memgraph query optimization

Hi everyone I have created a collaborative-filtering algorithm in opencypher (memgraph). Although my coworker says that it would not scale to high demands is this the case? if so how would I make it more scalable MATCH…
0
votes
1 answer

Neo4j OGM: How to correctly use @RelationshipEntity to load connected nodes

Say I have nodes of types A, B and C, and I have the following graph: @NodeEntity data class A( @Id val id: String? = null, @Relationship(type = "HAS_B") val b: MutableSet = mutableSetOf() ) @RelationshipEntity(type =…
0
votes
7 answers

Cypher query to find locations in a given radius using latitude and longitude

I am trying to use Apache AGE to store geographical information. I have a table called locations that contains the following columns: id: The unique identifier of the location name: The name of the location latitude: The latitude of the…
0
votes
5 answers

How to differentiate a Cypher clause from an SQL clause in C?

I am working on adding support for Cypher clauses on Postgres psql. So far, we have added if clauses with string comparison to separate Cypher clauses from SQL clauses, with one parser for each. The HandleCypherCmds() function calls the Cypher…
Carla
  • 326
  • 1
  • 7
0
votes
4 answers

How to use YAML to create a common node between two functions in Apache Age?

have two Python functions that each create a Person node in an Apache Age graph. I want to create a common Person node between these two functions that has the same properties. I've been told that YAML can be used to define a common configuration…
AmrShams07
  • 96
  • 1
  • 7
0
votes
2 answers

Retrieving Specific Characters with Specific Items in Database on Apache AGE

I'm currently working with a database that represents an RPG game. It contains nodes for characters, items, and locations. The relationships between these nodes are represented as 'HAS_ITEM' (between characters and items) and 'VISITED' (between…
MarkSoulz
  • 33
  • 4