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
0
votes
3 answers

Apache AGE - MATCH clause and direction of edges

I noticed an unusual aspect while experimenting with MATCH clause. Here I have created a directed edge between the vertices as SELECT * FROM cypher('university_graph', $$ CREATE ((n: Student {name : "John", bornIn : "USA"})-[e: StudiesAt {since :…
Zainab Saad
  • 728
  • 1
  • 2
  • 8
0
votes
4 answers

Query for returning edge

MATCH (a:Person)-[l:workWith]-(b:Person) RETURN a, l, b If I execute a query and it returns three values (start node, edge, and end node), how can I modify the query to retrieve only the information about the edge
M Jin
  • 11
  • 1
0
votes
2 answers

Returning edges taking too much times

SELECT * from cypher('age', $$ MATCH (V)-[R]-(V2) RETURN V,R,V2 as (V agtype, R agtype, V2 agtype); If there are only a few edges (e.g. around 100), queries can be executed quickly without much delay. However, if there are 500 or 1000 edges, it can…
M Jin
  • 11
  • 1
0
votes
1 answer

How can I drop all indexes at once using Cypher in Memgraph?

Is there a way to do something like DROP INDEX ON * that would delete all indexes? If I have a larger number of indexes it can take some time to delete them one by one. Is there some query that can loop through exiting indexes and delete them?
GrandMel
  • 157
  • 8
0
votes
1 answer

When executing the CREATE query I get the error about Bidirectional relationship

When I execute the query CREATE (h:Human)-[l:LOVES]-(f:Foof) RETURN h, l, f;, 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 relationship is…
EWoodAv
  • 15
  • 4
0
votes
2 answers

How to return distinct nodes asJson

Using GRAPH.QUERY mykey "MATCH (node:m000) RETURN toJson(node)" I get the following: [ { "key": "000", "containerid": "10000" // id 1 }, { "key": "001", "containerid": "10001" // id 2 }, { "key": "000", "containerid": "10000"…
Murrah
  • 1,508
  • 1
  • 13
  • 26
0
votes
1 answer

What if PostgreSql introduce a new function with name "cypher" then how to distingush between cypher and sql query with cypher function

Currently, the structure of Apache-age query is: SELECT * FROM cypher(, ) I am not sure how PostgreSQL is able to distinguish between regular sql queries and Cypher queries after loading age extension. For now parsers can…
Kamlesh Kumar
  • 351
  • 1
  • 7
0
votes
1 answer

Insert an array into a node property in Amazon Neptune using openCypher

I am trying to insert an array into a node property in Amazon Neptune using openCypher. Is there a way to do this with openCypher ? I have tried the following query : MERGE (n:Test { name: 'test', colors : ['blue', 'yellow'] }) Error message…
0
votes
1 answer

Finding distance between 2 geospatial location in aws neptune with opencypher query language

I am working with amazon neptune and using openCypher query language and doing some stuff using notebook. I have latitude and longitude of 2 points and I want to calculate the distance between these 2 points. For the purpose I am using Haversine…
Vishal Jamdade
  • 182
  • 1
  • 2
  • 17
0
votes
10 answers

How can I ensure that all nodes in a graph database like AGE are unique?

I am using AGE to create a graph database, and I want to ensure that all nodes in my database are unique. I want to avoid having multiple nodes with the same properties and labels in my graph. For example, if I have a node with label Person and…
Abdul Manan
  • 117
  • 5
0
votes
1 answer

Neo4j, empty list in first unwind stop second unwind from executing

I have two unwinds, that create some relationships and nodes, but if the list for the first unwinds is empty, the second unwind doesn't execute. How can I fix that? CALL apoc.periodic.iterate( " UNWIND $POSTS as post RETURN post …
Damian Grzanka
  • 275
  • 2
  • 13
0
votes
1 answer

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 iso_2_code: String iso_3_code: String region:…
GiteNator
  • 25
  • 6
0
votes
3 answers

AGE question: WITH clause doesn't work with MATCH/WITH

If I have the following query select * from cypher('agload_test_graph', $$ match (n) with n where n.name='A' return n $$) as (sp agtype) then n.name='A' doesn't work. but if I remove with clause, then it works: select * from…
M Jin
  • 11
  • 1
0
votes
1 answer

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 authors just additional node properties? I've come up…
user20833054
0
votes
1 answer

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: "Memgraph"}); The explanation for this code is: The query above…
user20833054