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
2 answers

Is it possible to update the type of property in Apache AGE?

Suppose I have an Apache AGE graph database 'books' in which some vertices have the pages property stored in different types, as shown in the examples below: SELECT * FROM cypher('books', $$ CREATE (v:Book {title: 'A book', pages: 10}) RETURN…
Carla
  • 326
  • 1
  • 7
1
vote
0 answers

Dijkstra's algorithm in Memgraph

I'm trying to run Dijkstra's algorithm in Memgraph on a dataset containing nodes with different properties, one of them being Euro and with different relationships, one of them being :MarriedTo. My goal is to find the weighted shortest path between…
MPesi
  • 212
  • 8
1
vote
2 answers

How to check if a certain relationship goes both ways on Memgraph?

I have a dataset in Memgraph and I'm trying to check if a certain relationship goes both ways. But I'm either getting a failed query or wrong results.
An Martin
  • 53
  • 2
1
vote
2 answers

Failed query in Memgraph

I am trying to execute the following query from Memgraph's documentation: MATCH (p:Person) WHERE exists((p)-[:LIVING_IN]->(:Country {name: 'Germany'})) RETURN p.name ORDER BY p.name; but I'm getting this error: Query failed: Not yet implemented:…
MPesi
  • 212
  • 8
1
vote
1 answer

Why doesn't the != operator work in my query in AGE?

I am facing a problem when I try to use STACK_MATCH relationships to connect Person nodes having the 'backend' title, while avoiding Person nodes ending up being related to themselves. SELECT * FROM cypher('devbook', $$ MATCH (a: Person), (b:…
1
vote
1 answer

Can reserved keyword be used as variable in Memgraph?

I'm starting to learn Cypher. I've read the openCypher specification, and I've spun up few different graph databases that use Cypher. At the moment I'm running Memgraph inside Docker. Here is my query that works just fine MATCH (p:Park) WITH…
1
vote
1 answer

The exists() function

This example uses the exists() function: MATCH (p:Person) WHERE exists((p)-[:LIVING_IN]->(:Country {name: 'Germany'})) RETURN p.name ORDER BY p.name; How is that query different than: MATCH (p:Person)-[:LIVING_IN]->(:Country {name:…
Vlasta
  • 141
  • 3
1
vote
1 answer

How can I see which nodes are duplicates?

I'm trying to create a constraint with this Cypher query: CREATE CONSTRAINT ON (p:Person) ASSERT p.name IS UNIQUE; But I get the error: Query failed: Unable to create unique constraint :Person(name), because an existing node violates it. How can…
ShymPi1999
  • 51
  • 3
1
vote
1 answer

How to do find weakly connected components using Cypher?

I'm trying to "translate" this Cypher query that uses NetworkX into pure Cypher. Can this even be achieved? MATCH (n)-[e]->() WITH collect(n) AS nodes, collect(e) AS edges CALL wcc.get_components(nodes, edges) YIELD * RETURN n_components,…
MasaZo
  • 43
  • 5
1
vote
1 answer

How to sum every property from a variable length edge

I have a graph that has vertices as cities and it also has edges that connect each city. These edges contain a property called travelTime that represents the time to got from one city to another. SELECT * FROM cypher('Saxeburg', $$ MATCH…
Matheus Farias
  • 716
  • 1
  • 10
1
vote
1 answer

Appending data to an array

I created a vertex with a property called interests and it should store an array of strings. SELECT * FROM cypher('DatingApp', $$ CREATE (v:Person { name: 'Alex', age: 27, occupation: 'Graphic Designer', …
Matheus Farias
  • 716
  • 1
  • 10
1
vote
2 answers

Cypher query with chaining does not propagate

In the following cypher query, whenever the $dlt parameter is false, the query never continues beyond the DETACH DELETE statement: MATCH (person:Person {id: $id}) SET person.matched = (CASE person.secret WHEN $secret THEN 1 ELSE 0 END) WITH person…
Mor Sagmon
  • 905
  • 1
  • 16
  • 35
1
vote
1 answer

What's the default expansion policy in the variable expand case?

What's the default expansion policy in the variable expand case when using Memgraph? When I have a query MATCH (x {id: 587})-[edge_list:Type *dfs..10]-(y {id: 963}) RETURN *; I'm using DFS algorithm. I explicitly tell to use DFS. Which algorithm is…
EWoodAv
  • 15
  • 4
1
vote
2 answers

Multiple versions of the graph

Currently, I am working on an application that allows the user to display graph-related data visually. Users can then make specific edits on the graph: adding a link between nodes adding new node changing specific attributes of the node removing…
Piotr G
  • 133
  • 8
1
vote
1 answer

Can I bulk delete one node property for all nodes?

I got the data model that has three nodes that are connected with three relations. This is my data model By looking at the model it makes no sense to me to store both 2 and 3 letter codes for each Country so I would like to delete all 2 letter ISO…
GiteNator
  • 25
  • 6