Questions tagged [memgraphdb]
Use this tag for questions related to Memgraph streaming graph database.
265
questions
0
votes
1
answer
14
views
When I try to profile large query I only get aggregate results, how to profile query parts?
When I try to profile large query I only get aggregate results. How can I profile query parts? Sometimes I get an an error during execution of my PROFILE query.
Can I somehow get at least part of the ...
0
votes
1
answer
9
views
What's the best way to reload python query module during development?
I'm working on my first query module for Memgraph. I'm trying to find the best approach.
I have a query module that depends on a local submodule (firstone):
import firstone
import mgp
import importlib
...
1
vote
1
answer
6
views
Are composite indexes supported in Memgraph?
Can I create index on more than one property for any given label? I am running query like:
MATCH (n:Node) WHERE n.id = xyz AND n.source = abc;
and I want to know whether I can create multiple ...
-1
votes
1
answer
13
views
When developing query modules for Memgraph in Python how to get type completion?
I'd like to have type completion when developing query modules for Memgraph in Python. Is it possible to add that?
-1
votes
1
answer
10
views
What the difference between Cypher procedure and function in Memgraph?
I see that Cypher has both procedures and functions. What is the difference between those two in Cypher implementation in Memgraph?
0
votes
1
answer
21
views
Adding packages to memgraph transformation
I am writing a memgraph transformation in python.
When I import modules such as "requests" or "networkx", the transformation works as expected.
I have avro data w/ schema registry, ...
0
votes
1
answer
12
views
Problems with temporal types like duration in of the wShortest aggregate function
I have v2.0 of Memgraph, seems like temporal types like duration can't be part of the wShortest aggregate function.
Here is my code:
MATCH (n) DETACH DELETE n;
CREATE
(storage {name: "storage&...
0
votes
1
answer
10
views
How to import CSV file (LOAD CSV) from a remote location?
I have my CSV data stored on a server that can be accessed via the internet. There is no authorization needed for access to that file. At the moment, I use scp and some crone jobs to copy that file to ...
0
votes
1
answer
8
views
Are subqueries supported in Memgraph?
I am using Memgraph Platform 2.6.4 and I want to call a subquery within a query. For example:
UNWIND [0, 1, 2] AS n
CALL {
RETURN 'hi' AS returnValue
}
RETURN returnValue
I couldn't find anything ...
0
votes
1
answer
2
views
Can I restrict access to properties with Memgraph database?
I see that you have documentation about the Label-based access control as an Enterprise feature of Memgraph. I notice that there is label/type based security, but is there a way to restrict access to ...
0
votes
2
answers
42
views
Cypher - given relationship, get the nodes
If I do the query
MATCH (:Label1 {prop1: "start node"}) -[relationships*1..10]-> ()
UNWIND relationships as relationship
RETURN DISTINCT relationship
How do I get nodes for each of ...
0
votes
2
answers
26
views
Can I install and run Memgraph on Amazon Linux?
I would like to run Memgraph on Amazon Linux. How can I install it? Are there prebuild packages specific for Amazon Linux?
0
votes
1
answer
11
views
Error when trying to run Memgraph under Ubuntu on WSL: "System has not been booted with systemd as init system (PID 1). Can't operate."
My setup is Windows 11 with WSL2 and Ubuntu 22.04.1 LTS (GNU/Linux 5.15.79.1-microsoft-standard-WSL2 x86_64). I'm following the instructions for installing Memgraph on Ubuntu
but I keep getting the ...
0
votes
1
answer
12
views
Memgraph 1.6.0 returns error "does not match the detected host platform" on Docker run when using Apple M1
I inherited a Memgrpah 1.6.0 based project. When I try to run the docker on my M1 power Apple I get the following error message:
m1lap ~> docker run -p 7687:7687 memgraph/memgraph
WARNING: The ...
0
votes
1
answer
9
views
Can I pass around mgp.ProcCtx and implement parallel graph algorithms in Python that use the actual graph?
I am using Memgraph Platform 2.6.4 which includes MAGE 1.5.1. I noticed that MAGE has an interesting part of the code that tells me that you can use multiprocessing on the server. But, can I pass ...
0
votes
1
answer
31
views
Is there something in Memgraph that has the same function as APOC in Neo4j?
I know that both Memgraph and Neo4j use Cypher as query language. I see that Neo4j has APOC (Awesome Procedures on Cypher). Is there a Memgraph version or replacement for APOC?
I've looked at Memgraph ...
2
votes
2
answers
42
views
Remove property from all nodes in a Neo4j database
I've inherited a Neo4j database which is massive to say the least. I've been looking into it and noticed we store a large string in each node that is not used.
Let's say we have a few million nodes ...
1
vote
1
answer
34
views
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 ...
0
votes
1
answer
26
views
How can I get all of the properties related to one node type?
I have a node Country. I know that this node has some properties, but I don't know which. I mean, I know since I've take a look at model. Here is what I've found in documentation:
Country
name: String
...
-1
votes
1
answer
22
views
Can I use case insensitive regex in Cypher query?
I am using Memgraph Platform 2.6.4 and I can't seem to use (?i) for case insensitive regular expression. It throws "Invalid special open parenthesis" error. What is the best way to approach ...
1
vote
2
answers
50
views
Neo4j query for getting multiple connected nodes
In my graph, I want to get the first-degree, second-degree, and third-degree neighbors of a certain node. If my graph is A -> B -> C -> D -> E, then
first-degree neighbor of C is B
second-...
1
vote
1
answer
17
views
Adding SORT after YIELD produces no results or errors
If I run this code
CALL pagerank.get()
YIELD node, rank;
everything works like a charm. But If I expand the query just a little with sorting it gets stuck.
CALL pagerank.get()
YIELD node, rank
ORDER ...
1
vote
1
answer
22
views
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"})
...
-1
votes
0
answers
21
views
Does CREATE query in Cypher always create duplicates?
I've read that CREATE is used to create a single node, and that MERGE can be used for a node if it doesn't exist. If this is true, If I run the same query that has CREATE in it I will get duplicate ...
0
votes
0
answers
29
views
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=(:...
0
votes
0
answers
53
views
How to find type of relationship between nodes in graph db?
I'm using neo4j database in my project and I have a number of cities (nodes as A, B, C, D, E) linked with relationships "toward ->" and "backward <-" (both directions). So, ...
0
votes
1
answer
14
views
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*...
0
votes
1
answer
32
views
I want to run Memgraph using WSL but I can't install Ubuntu 22.04 on Windows 11
In the Memgraph official documentation it says "Install MemgraphDB using the latest Memgraph Ubuntu package and by running the following command in the Ubuntu terminal.". On the download ...
-1
votes
1
answer
17
views
Finding an alternate route using Cypher and Memgraph
I have a situation where I have several data centers spread across large distances. I have a main site and a backup site.
There are several routes between main and backup site. Based on conditions (...
-1
votes
1
answer
14
views
Cypher query for finding out content and connectedness as security measure
I have a node that represents a computer infected with malware. I want to see if other computers (based on log files) have had some interaction with the infected computer. I have already transferred ...
-1
votes
1
answer
17
views
"Cannot bind to socket on endpoint {}." error within Memgraph
When binding to Memgraph I get the error Cannot bind to socket on endpoint {}. How can I avoid this error?
0
votes
1
answer
29
views
How to approach graph modeling using Cypher - should I use property or node?
I have books and authors. In SQL, I would have two tables and then I would create relations between them.
How does this work in the graph world? Should books and authors be separate nodes or are ...
0
votes
1
answer
26
views
I'm having problems undestanding some cypher concepts - naming nodes
I'm following one tutorial and I'm having a hard time understating the very basic things and I need your help. The code is:
CREATE (u:User {name: "Alice"})-[:Likes]->(m:Software {name: &...
0
votes
1
answer
32
views
Querying nodes using array property - neo4j
I have a property on the node which is stored as array of strings. But when I use this field to find the node, it's not returning any results. What am I doing wrong?
Below is the node:
MATCH (n:...
0
votes
1
answer
12
views
Does Memgraph support adding relationships to the same node in parallel?
I am using Memgraph Platform v2.6.1 and trying to add relationships to the same node in parallel and I get a transaction conflict error. I am wondering whether it is even possible to add relationships ...
2
votes
2
answers
51
views
What does separate curly bracket means in Cypher?
I have read the document, and i found that curly brackets are normally used to form a subquery or it can be used to describe the properties of a node or relationships.
But i notice that some times ...
1
vote
2
answers
33
views
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 ...
0
votes
1
answer
34
views
What is the difference between two FOREACH block codes in Cypher?
Are these two blocks actually the same? The goal is to create three nodes with IDs 1, 2, 3, and 4.
Block 1:
FOREACH ( i IN [1, 2, 3, 4] | CREATE (n {id : i}) )
Block 2:
CREATE (n { prop : [[1, 2], [...
0
votes
1
answer
12
views
How to set more that one node property using Cypher in Memgraph?
When I want to set a node property value, I use
MATCH (c:City)
WHERE c.name = 'London'
SET c.population = 8900000
RETURN c;
How can I set more than one property within code block?
0
votes
1
answer
35
views
Neo4J Cypher: create relationship only if destination node exists
I am trying to load a csv file that and as part of import try to create a relationship if the foreign key fields are resolved.
OPTIONAL MATCH (d1:Destination1 { id: line[2], name: line[3] })
OPTIONAL ...
0
votes
1
answer
21
views
Is DETACH a clause or a some kind of modifier?
I'm trying to figure out the naming convention for parts of Cypher queries. In Cypher Query Language Reference, Version 9 DETACH is listed on page 197 as a clause.
But in all examples, I've seen ...
1
vote
1
answer
49
views
How create node using gqlalchemy in neo4j?
I tried to create node and relationship using gqlalchemy in neo4j as per the memgraph documentation but it did not worked
from gqlalchemy import Memgraph, Node, Relationship, Field,Neo4j
from typing ...
0
votes
1
answer
12
views
Error when deleting a node using Cypher in Memgraph
When I try to delete the node
MATCH (c:Customer {name: 'John Smith'})
DELETE c;
I get the message Failed to remove node because of it's existing connections. Consider using DETACH DELETE.. What ...
0
votes
1
answer
14
views
How can I create a node in Memgraph using Cypher that has more than one label?
I know that I can create a node with a label using the code:
CREATE (n:Person)
RETURN n;
But how can I add multiple labels at the time of creating?
0
votes
0
answers
11
views
Should I use question mark when styling GSS code in Memgraph Lab?
I'm going through GSS tutorial and I can see that sometimes there is question mark when styling GSS code, and other time there isn't one. For example:
@NodeStyle HasLabel?(node, "Country") {
...
0
votes
1
answer
32
views
Is there in Cypher sometihg like RETURN all?
I have a code
MATCH (n1)-[r:CREATED_ON {manufactureDate: '11-03-2021'}]->(n2)
RETURN n1, r, n2;
Is there a shorthand to replace RETURN n1, r, n2; that would be equivalent to saying, "Return ...
0
votes
0
answers
11
views
Difference in saving nodes in Memgraph
Is there a difference between saving a node, which is an instance of a class that inherits Node class, with save method and saving a node using the query builder in GQLAlchemy?
Also, is there any ...
0
votes
1
answer
8
views
How can I change the Memgraph port when using Docker?
When I run the Memgrpah platform, a MEmgraph runs on port 7687. I already use that port by another container. How can I change the Memgraph port?
0
votes
1
answer
10
views
Is data lost when Memgraph that runs on Docker is restarted?
I want to run the Memgprah platform inside Docker (on Windows 10 machine, if it is important). What will happen if I restart my computer or Docker service? Will my data be saved?
0
votes
1
answer
11
views
Can't bind or listen to Memgraphs sockets
It makes no difference if I try to bind or listen to Memgraph I get the error. Depengin on the thing that I'm trying to do I get either: Cannot bind to socket on endpoint {} or Cannot listen on socket ...