Questions tagged [memgraphdb]

Use this tag for questions related to Memgraph streaming graph database.

Memgraph is an open source graph database built for real time streaming data, compatible with Neo4j. It is an in-memory graph database that uses Cypher as a query language. Memgraph can be extended with graph algorithms that are part of Memgraph Advanced Graph Extensions (MAGE). Graphs can be visualized using Memgraph Lab application.

390 questions
0
votes
2 answers

MemgraphDB: Using openCypher to add names to Karate club friendship network

I'm using Karate club friendship network sample data set to learn Cypher. Here is the description of it: The model consists of 34 users where some users are friends within a university karate club. User node - A user in the karate club. id - A…
Juliette Gia
  • 126
  • 6
0
votes
2 answers

Does MERGE clause in Cypher allows creating relationships without specifying the direction?

When I execute the query CREATE (p:Person)-[s:SPEAKS]-(l:Language) RETURN p, s, l;, I get the following error: Error: Query failed: Bidirectional relationship are not supported when creating an edge If I use MERGE instead of CREATE, the…
MasaZo
  • 43
  • 5
0
votes
1 answer

How can I run the smaller Memgraph Platform image (one without MAGE)?

I'm looking for a Memgraph platform image that has only Memgraph and Memgraph Lab. I don't need MAGE at this time. In the documentation the following images are listed: There are three Docker images you can use to run Memgraph: memgraph-platform -…
ShymPi1999
  • 51
  • 3
0
votes
1 answer

How to make sure that created node will exist and will be unique in Memgraph?

If I get it correctly, this only enforces an existence constraint, not a uniqueness: CREATE CONSTRAINT ON (c:City) ASSERT exists (c.name); To make it unique, I would use a unique property constraint using the following syntax: CREATE CONSTRAINT ON…
KWriter
  • 1,024
  • 4
  • 22
0
votes
1 answer

How to create an AMQP message (Memgraph+Cypher comination)?

What would be the best way to go if I want to create an AMQP message every time a specific node is inserted/deleted from the graph? I looked into trigger events but they are only capable of Cypher so I can trigger a simple python/go/c++ script or am…
Moraltox
  • 537
  • 1
  • 7
0
votes
1 answer

Why does a MERGE command fails if there is a unique constraint violation?

I thought that MERGE is something like a combination of MATCH and CREATE, in pseudocode: MATCH (n...) IF n NOT EXISTANT -> CREATE (n...) Why does a MERGE command fails if there is a unique constraint violation?
MasaZo
  • 43
  • 5
0
votes
1 answer

How to dedup.group by the output based on vertex property?

I have a use case where I need to dedup.group by the output based on vertex property, but still output all the properties of the vertex. e.g. Imagine you have a shop which has products and you want to return from each product category one product…
Juliette Gia
  • 126
  • 6
0
votes
1 answer

How to find all distinct relationships and count of relations?

I know that I can get total number of relationships using MATCH () -[r]-> () RETURN count(r) AS quantity. How I can get count per relationship type?
ShymPi1999
  • 51
  • 3
0
votes
1 answer

How can I use subqueries in Memgraph?

I would like to use this query in Memgraph, but it doesn't work (this is only part of the query): UNWIND $data as rowData MERGE (element:Element {item_id: rowData.item_id, revision: rowData.revision, identifier: rowData.element_id}) WITH element,…
Juliette Gia
  • 126
  • 6
0
votes
1 answer

What is a correct way to update a property using Cypher?

I have nodes that have first name. I want to update all of the names John to Johan. Is there a difference between this two queries? The end result seems the same to me. Query 1 MATCH (p:Person) WHERE p.name= "John" SET p += {name: "Johan"}; Query…
Juliette Gia
  • 126
  • 6
0
votes
2 answers

How to query nodes that have no relationships in Memgraph?

I am trying to find a simple way to query the database to find orphan nodes - the ones that have no relationships. I tried running: MATCH (n:NodeA) WHERE NOT (n)-[]->(:NodeB) RETURN n; but it is not working in Memgraph. Does anyone know how to do…
KateLatte
  • 611
  • 1
  • 12
0
votes
1 answer

What is the Cypher query on Expand action in Memgraph Lab?

I'm using Memgraph Lab. Once the visualization of graph is done I know that I can expand individual nodes. What is the exact Cypher query that gets executed?
Taja Jan
  • 942
  • 1
  • 1
  • 11
0
votes
1 answer

Can I rename a property that already exist and that has values in it?

Is there a clause in Cypher that would allow me to rename property o.operating_system into o.os? I already have values assigned to a property.
ShymPi1999
  • 51
  • 3
0
votes
1 answer

How can I ensure not to creat a duplicate relationship when creating one between existing nodes?

I've used the following code to create relationship between two nodes: MATCH (c1), (c2) WHERE c1.name = "UK" AND c2.name = "London" CREATE (c2)-[:IN]->(c1); If I run it few times it will duplicate the relationship. I want to avoid possible…
Taja Jan
  • 942
  • 1
  • 1
  • 11
0
votes
1 answer

Can I create nodes and relationship between them in single query?

I know that that I can create a relationship between exiting nodes. But can I create nodes and relationship at the same time?
Taja Jan
  • 942
  • 1
  • 1
  • 11