age icon indicating copy to clipboard operation
age copied to clipboard

Match node with not existed label

Open kevintruong opened this issue 2 years ago • 5 comments

Describe the bug A clear and concise description of what the bug is.

How are you accessing AGE (Command line, driver, etc.)?

  • python driver
  • pgcli with load 'age'

What data setup do we need to do?

None

What is the command that caused the error?

SELECT * from cypher('agegraph', $$ MATCH (node:NodeWithKey) RETURN node $$) as (v agtype);
 SELECT * from cypher('agegraph', $$ MATCH (node:NodeWithKey) RETURN node $$) as (v agtype);
label NodeWithKey does not exists
LINE 1: SELECT * from cypher('agegraph', $$ MATCH (node:NodeWithKey)...

Expected behavior return empty record

Environment (please complete the following information):

  • Version: [e.g. 0.7.0]

Additional context Add any other context about the problem here.

kevintruong avatar Feb 12 '22 14:02 kevintruong

The error, if I recall correctly, is expected behavior for an incorrect label name. However, we will review this to see if it should be changed.

jrgemignani avatar Feb 14 '22 17:02 jrgemignani

With other graph databases I've used (Neo4j and RedisGraph), querying a node label or relationship type that doesn't exist simply returns no matches.

If this error is expected, is it possible to create a node label or relationship type other than by creating a node or relationship with it? If not, that makes it difficult to use for certain applications.

jgaskins avatar Jul 30 '22 04:07 jgaskins

You can use the create_elabel(graph_name, label_name) and create_vlabel(graph_name, label_name) functions. Also, for any single graph, a vertex and an edge can't have the same label and label names are case specific.

On Sat, Jul 30, 2022 at 1:57 PM Jamie Gaskins @.***> wrote:

With other graph databases I've used (Neo4j and RedisGraph), querying a node label or relationship type that doesn't exist simply fails to match.

If this error is expected, is it possible to create a node label or relationship type other than by creating a node or relationship with it? If not, that makes it difficult to use for certain applications.

— Reply to this email directly, view it on GitHub https://github.com/apache/age/issues/186#issuecomment-1200089945, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABZW5ASSFSGNJFGDL6JRF5LVWSY4NANCNFSM5OG6HSZQ . You are receiving this because you are subscribed to this thread.Message ID: @.***>

JoshInnis avatar Oct 11 '22 09:10 JoshInnis

This is now an active task to align this behavior with other graph databases, like Neo4j.

jrgemignani avatar Oct 17 '22 18:10 jrgemignani

@jrgemignani It seems the issue is now fixed?

rafsun42 avatar Apr 25 '24 21:04 rafsun42