Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
e3a2bc9
Added inheritance to create_vlabel function
MatheusFarias03 Feb 2, 2023
7ea2a25
Only two parameters to create_vlabel function, inheritance works as -…
MatheusFarias03 Feb 2, 2023
4014cd0
create_vlabel receives 3 arguments, the third is a list of parent labels
MatheusFarias03 Feb 9, 2023
d7e9e4c
Elements in the array are fetched properly
MatheusFarias03 Feb 10, 2023
2577ca8
Error when merging multiple inherited definitions fixed, but still ne…
MatheusFarias03 Feb 11, 2023
c65d46c
Changed how create_vlabel handles if there is a parent name in the array
MatheusFarias03 Feb 11, 2023
7224820
Added some checking with the is_inheriting variable to see if the lab…
MatheusFarias03 Feb 12, 2023
38c94a9
Added inheritance to create_elabel
MatheusFarias03 Feb 12, 2023
86b6715
Changed create_label function calls
markgomer Feb 15, 2023
96bf5a3
Tests for edge and vertex label inheritance added for the cypher_crea…
MatheusFarias03 Feb 17, 2023
249ad74
Merge branch 'apache:AGE_label_inheritance' into AGE_label_inheritance
MatheusFarias03 Mar 13, 2023
9dd3e76
Merge branch 'apache:AGE_label_inheritance' into AGE_label_inheritance
MatheusFarias03 Apr 1, 2023
889e9ef
Regression test for VLE edge inheritance
MatheusFarias03 Apr 2, 2023
5a9a50b
VLE finds child of child edge
MatheusFarias03 Apr 2, 2023
e38290f
cypher_vle test passed.
MatheusFarias03 Apr 3, 2023
4e90d1d
Fix issue with excessive NOTICE messages being displayed
markgomer Apr 14, 2023
e832ae4
Merge branch 'AGE_label_inheritance' into inheritance-delivery
markgomer Apr 14, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion regress/expected/age_load.out
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ SELECT COUNT(*) FROM cypher('agload_test_graph', $$MATCH(n) RETURN n$$) as (n ag
SELECT COUNT(*) FROM cypher('agload_test_graph', $$MATCH (a)-[e]->(b) RETURN e$$) as (n agtype);
count
-------
72485
0
(1 row)

SELECT create_vlabel('agload_test_graph','Country2');
Expand Down
36 changes: 0 additions & 36 deletions regress/expected/cypher_create.out
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,6 @@ NOTICE: VLabel "parent_vlabel" has been created

SELECT create_vlabel('cypher_create', 'child_vlabel_one', ARRAY['parent_vlabel']);
NOTICE: VLabel child_vlabel_one will inherit from parent_vlabel
NOTICE: merging column "id" with inherited definition
NOTICE: merging column "properties" with inherited definition
NOTICE: VLabel "child_vlabel_one" has been created
create_vlabel
---------------
Expand All @@ -75,10 +73,6 @@ NOTICE: VLabel "child_vlabel_one" has been created
SELECT create_vlabel('cypher_create', 'child_vlabel_two', ARRAY['parent_vlabel', 'child_vlabel_one']);
NOTICE: VLabel child_vlabel_two will inherit from parent_vlabel
NOTICE: VLabel child_vlabel_two will inherit from child_vlabel_one
NOTICE: merging multiple inherited definitions of column "id"
NOTICE: merging multiple inherited definitions of column "properties"
NOTICE: merging column "id" with inherited definition
NOTICE: merging column "properties" with inherited definition
NOTICE: VLabel "child_vlabel_two" has been created
create_vlabel
---------------
Expand All @@ -89,12 +83,6 @@ SELECT create_vlabel('cypher_create', 'child_vlabel_three', ARRAY['parent_vlabel
NOTICE: VLabel child_vlabel_three will inherit from parent_vlabel
NOTICE: VLabel child_vlabel_three will inherit from child_vlabel_one
NOTICE: VLabel child_vlabel_three will inherit from child_vlabel_two
NOTICE: merging multiple inherited definitions of column "id"
NOTICE: merging multiple inherited definitions of column "properties"
NOTICE: merging multiple inherited definitions of column "id"
NOTICE: merging multiple inherited definitions of column "properties"
NOTICE: merging column "id" with inherited definition
NOTICE: merging column "properties" with inherited definition
NOTICE: VLabel "child_vlabel_three" has been created
create_vlabel
---------------
Expand Down Expand Up @@ -135,10 +123,6 @@ NOTICE: ELabel "parent_elabel" has been created

SELECT create_elabel('cypher_create', 'child_elabel_one', ARRAY['parent_elabel']);
NOTICE: ELabel child_elabel_one will inherit from parent_elabel
NOTICE: merging column "id" with inherited definition
NOTICE: merging column "start_id" with inherited definition
NOTICE: merging column "end_id" with inherited definition
NOTICE: merging column "properties" with inherited definition
NOTICE: ELabel "child_elabel_one" has been created
create_elabel
---------------
Expand All @@ -148,14 +132,6 @@ NOTICE: ELabel "child_elabel_one" has been created
SELECT create_elabel('cypher_create', 'child_elabel_two', ARRAY['parent_elabel', 'child_elabel_one']);
NOTICE: ELabel child_elabel_two will inherit from parent_elabel
NOTICE: ELabel child_elabel_two will inherit from child_elabel_one
NOTICE: merging multiple inherited definitions of column "id"
NOTICE: merging multiple inherited definitions of column "start_id"
NOTICE: merging multiple inherited definitions of column "end_id"
NOTICE: merging multiple inherited definitions of column "properties"
NOTICE: merging column "id" with inherited definition
NOTICE: merging column "start_id" with inherited definition
NOTICE: merging column "end_id" with inherited definition
NOTICE: merging column "properties" with inherited definition
NOTICE: ELabel "child_elabel_two" has been created
create_elabel
---------------
Expand All @@ -166,18 +142,6 @@ SELECT create_elabel('cypher_create', 'child_elabel_three', ARRAY['parent_elabel
NOTICE: ELabel child_elabel_three will inherit from parent_elabel
NOTICE: ELabel child_elabel_three will inherit from child_elabel_one
NOTICE: ELabel child_elabel_three will inherit from child_elabel_two
NOTICE: merging multiple inherited definitions of column "id"
NOTICE: merging multiple inherited definitions of column "start_id"
NOTICE: merging multiple inherited definitions of column "end_id"
NOTICE: merging multiple inherited definitions of column "properties"
NOTICE: merging multiple inherited definitions of column "id"
NOTICE: merging multiple inherited definitions of column "start_id"
NOTICE: merging multiple inherited definitions of column "end_id"
NOTICE: merging multiple inherited definitions of column "properties"
NOTICE: merging column "id" with inherited definition
NOTICE: merging column "start_id" with inherited definition
NOTICE: merging column "end_id" with inherited definition
NOTICE: merging column "properties" with inherited definition
NOTICE: ELabel "child_elabel_three" has been created
create_elabel
---------------
Expand Down
6 changes: 3 additions & 3 deletions regress/expected/cypher_match.out
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,8 @@ SELECT * FROM cypher('cypher_match', $$
$$) AS (a agtype);
a
----------------------------------------------------------------------------------
{"id": 1125899906842625, "label": "v1", "properties": {"id": "initial"}}::vertex
{"id": 1125899906842627, "label": "v1", "properties": {"id": "end"}}::vertex
{"id": 1125899906842625, "label": "v1", "properties": {"id": "initial"}}::vertex
(2 rows)

SELECT * FROM cypher('cypher_match', $$
Expand Down Expand Up @@ -260,10 +260,10 @@ SELECT * FROM cypher('cypher_match', $$
$$) AS (i agtype);
i
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
[{"id": 1688849860263938, "label": "v2", "properties": {"id": "middle"}}::vertex, {"id": 1970324836974594, "label": "e2", "end_id": 1688849860263937, "start_id": 1688849860263938, "properties": {}}::edge, {"id": 1688849860263937, "label": "v2", "properties": {"id": "initial"}}::vertex]::path
[{"id": 1688849860263938, "label": "v2", "properties": {"id": "middle"}}::vertex, {"id": 1970324836974593, "label": "e2", "end_id": 1688849860263939, "start_id": 1688849860263938, "properties": {}}::edge, {"id": 1688849860263939, "label": "v2", "properties": {"id": "end"}}::vertex]::path
[{"id": 1688849860263938, "label": "v2", "properties": {"id": "middle"}}::vertex, {"id": 1970324836974594, "label": "e2", "end_id": 1688849860263937, "start_id": 1688849860263938, "properties": {}}::edge, {"id": 1688849860263937, "label": "v2", "properties": {"id": "initial"}}::vertex]::path
[{"id": 1688849860263938, "label": "v2", "properties": {"id": "middle"}}::vertex, {"id": 1970324836974593, "label": "e2", "end_id": 1688849860263939, "start_id": 1688849860263938, "properties": {}}::edge, {"id": 1688849860263939, "label": "v2", "properties": {"id": "end"}}::vertex]::path
[{"id": 1688849860263938, "label": "v2", "properties": {"id": "middle"}}::vertex, {"id": 1970324836974594, "label": "e2", "end_id": 1688849860263937, "start_id": 1688849860263938, "properties": {}}::edge, {"id": 1688849860263937, "label": "v2", "properties": {"id": "initial"}}::vertex]::path
(4 rows)

SELECT * FROM cypher('cypher_match', $$
Expand Down Expand Up @@ -608,8 +608,8 @@ AS (u agtype, e agtype, v agtype);
----------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------+----------------------------------------------------------------------------------
{"id": 1125899906842625, "label": "v1", "properties": {"id": "initial"}}::vertex | {"id": 1407374883553282, "label": "e1", "end_id": 1125899906842626, "start_id": 1125899906842625, "properties": {}}::edge | {"id": 1125899906842626, "label": "v1", "properties": {"id": "middle"}}::vertex
{"id": 1125899906842626, "label": "v1", "properties": {"id": "middle"}}::vertex | {"id": 1407374883553281, "label": "e1", "end_id": 1125899906842627, "start_id": 1125899906842626, "properties": {}}::edge | {"id": 1125899906842627, "label": "v1", "properties": {"id": "end"}}::vertex
{"id": 1688849860263938, "label": "v2", "properties": {"id": "middle"}}::vertex | {"id": 1970324836974594, "label": "e2", "end_id": 1688849860263937, "start_id": 1688849860263938, "properties": {}}::edge | {"id": 1688849860263937, "label": "v2", "properties": {"id": "initial"}}::vertex
{"id": 1688849860263938, "label": "v2", "properties": {"id": "middle"}}::vertex | {"id": 1970324836974593, "label": "e2", "end_id": 1688849860263939, "start_id": 1688849860263938, "properties": {}}::edge | {"id": 1688849860263939, "label": "v2", "properties": {"id": "end"}}::vertex
{"id": 1688849860263938, "label": "v2", "properties": {"id": "middle"}}::vertex | {"id": 1970324836974594, "label": "e2", "end_id": 1688849860263937, "start_id": 1688849860263938, "properties": {}}::edge | {"id": 1688849860263937, "label": "v2", "properties": {"id": "initial"}}::vertex
{"id": 2251799813685249, "label": "v3", "properties": {"id": "initial"}}::vertex | {"id": 2533274790395906, "label": "e3", "end_id": 2251799813685250, "start_id": 2251799813685249, "properties": {}}::edge | {"id": 2251799813685250, "label": "v3", "properties": {"id": "middle"}}::vertex
{"id": 2251799813685251, "label": "v3", "properties": {"id": "end"}}::vertex | {"id": 2533274790395905, "label": "e3", "end_id": 2251799813685250, "start_id": 2251799813685251, "properties": {}}::edge | {"id": 2251799813685250, "label": "v3", "properties": {"id": "middle"}}::vertex
(6 rows)
Expand Down
14 changes: 1 addition & 13 deletions regress/expected/cypher_vle.out
Original file line number Diff line number Diff line change
Expand Up @@ -357,8 +357,8 @@ SELECT * FROM cypher('cypher_vle', $$MATCH p=(u:begin)<-[e*]-(v:end) RETURN e $$
SELECT * FROM cypher('cypher_vle', $$MATCH p=(:begin)<-[*]-()<-[]-(:end) RETURN p $$) AS (e agtype);
e
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
[{"id": 844424930131969, "label": "begin", "properties": {}}::vertex, {"id": 2533274790395906, "label": "bypass_edge", "end_id": 844424930131969, "start_id": 1407374883553282, "properties": {"name": "bypass edge", "number": 2, "packages": [1, 3, 5, 7], "dangerous": {"type": "poisons", "level": "all"}}}::edge, {"id": 1407374883553282, "label": "middle", "properties": {}}::vertex, {"id": 2251799813685253, "label": "alternate_edge", "end_id": 1407374883553282, "start_id": 1407374883553283, "properties": {"name": "backup edge", "number": 2, "packages": [1, 3, 5, 7]}}::edge, {"id": 1407374883553283, "label": "middle", "properties": {}}::vertex, {"id": 2251799813685252, "label": "alternate_edge", "end_id": 1407374883553283, "start_id": 1688849860263937, "properties": {"name": "backup edge", "number": 1, "packages": [1, 3, 5, 7]}}::edge, {"id": 1688849860263937, "label": "end", "properties": {}}::vertex]::path
[{"id": 844424930131969, "label": "begin", "properties": {}}::vertex, {"id": 2533274790395906, "label": "bypass_edge", "end_id": 844424930131969, "start_id": 1407374883553282, "properties": {"name": "bypass edge", "number": 2, "packages": [1, 3, 5, 7], "dangerous": {"type": "poisons", "level": "all"}}}::edge, {"id": 1407374883553282, "label": "middle", "properties": {}}::vertex, {"id": 2251799813685253, "label": "alternate_edge", "end_id": 1407374883553282, "start_id": 1407374883553283, "properties": {"name": "backup edge", "number": 2, "packages": [1, 3, 5, 7]}}::edge, {"id": 1407374883553283, "label": "middle", "properties": {}}::vertex, {"id": 2251799813685252, "label": "alternate_edge", "end_id": 1407374883553283, "start_id": 1688849860263937, "properties": {"name": "backup edge", "number": 1, "packages": [1, 3, 5, 7]}}::edge, {"id": 1688849860263937, "label": "end", "properties": {}}::vertex, {"id": 1970324836974594, "label": "self_loop", "end_id": 1688849860263937, "start_id": 1688849860263937, "properties": {"name": "self loop", "number": 2, "dangerous": {"type": "all", "level": "all"}}}::edge, {"id": 1688849860263937, "label": "end", "properties": {}}::vertex]::path
[{"id": 844424930131969, "label": "begin", "properties": {}}::vertex, {"id": 2533274790395906, "label": "bypass_edge", "end_id": 844424930131969, "start_id": 1407374883553282, "properties": {"name": "bypass edge", "number": 2, "packages": [1, 3, 5, 7], "dangerous": {"type": "poisons", "level": "all"}}}::edge, {"id": 1407374883553282, "label": "middle", "properties": {}}::vertex, {"id": 2251799813685253, "label": "alternate_edge", "end_id": 1407374883553282, "start_id": 1407374883553283, "properties": {"name": "backup edge", "number": 2, "packages": [1, 3, 5, 7]}}::edge, {"id": 1407374883553283, "label": "middle", "properties": {}}::vertex, {"id": 2251799813685252, "label": "alternate_edge", "end_id": 1407374883553283, "start_id": 1688849860263937, "properties": {"name": "backup edge", "number": 1, "packages": [1, 3, 5, 7]}}::edge, {"id": 1688849860263937, "label": "end", "properties": {}}::vertex]::path
(2 rows)

-- Each should return 31
Expand Down Expand Up @@ -808,10 +808,6 @@ NOTICE: ELabel "PARENT_EDGE_B" has been created

SELECT create_elabel('vle_inheritance_graph', 'CHILD_EDGE_A', ARRAY['PARENT_EDGE_A']);
NOTICE: ELabel CHILD_EDGE_A will inherit from PARENT_EDGE_A
NOTICE: merging column "id" with inherited definition
NOTICE: merging column "start_id" with inherited definition
NOTICE: merging column "end_id" with inherited definition
NOTICE: merging column "properties" with inherited definition
NOTICE: ELabel "CHILD_EDGE_A" has been created
create_elabel
---------------
Expand All @@ -820,10 +816,6 @@ NOTICE: ELabel "CHILD_EDGE_A" has been created

SELECT create_elabel('vle_inheritance_graph', 'CHILD_EDGE_B', ARRAY['PARENT_EDGE_B']);
NOTICE: ELabel CHILD_EDGE_B will inherit from PARENT_EDGE_B
NOTICE: merging column "id" with inherited definition
NOTICE: merging column "start_id" with inherited definition
NOTICE: merging column "end_id" with inherited definition
NOTICE: merging column "properties" with inherited definition
NOTICE: ELabel "CHILD_EDGE_B" has been created
create_elabel
---------------
Expand All @@ -832,10 +824,6 @@ NOTICE: ELabel "CHILD_EDGE_B" has been created

SELECT create_elabel('vle_inheritance_graph', 'CHILD_EDGE_C', ARRAY['CHILD_EDGE_B']);
NOTICE: ELabel CHILD_EDGE_C will inherit from CHILD_EDGE_B
NOTICE: merging column "id" with inherited definition
NOTICE: merging column "start_id" with inherited definition
NOTICE: merging column "end_id" with inherited definition
NOTICE: merging column "properties" with inherited definition
NOTICE: ELabel "CHILD_EDGE_C" has been created
create_elabel
---------------
Expand Down
16 changes: 8 additions & 8 deletions regress/expected/expr.out
Original file line number Diff line number Diff line change
Expand Up @@ -1947,10 +1947,10 @@ SELECT * FROM cypher('expr', $$ MATCH (v) RETURN v $$) AS (expression agtype);
SELECT * FROM cypher('expr', $$ MATCH ()-[e]-() RETURN e $$) AS (expression agtype);
expression
---------------------------------------------------------------------------------------------------------------------------
{"id": 1407374883553282, "label": "e1", "end_id": 1125899906842626, "start_id": 1125899906842625, "properties": {}}::edge
{"id": 1407374883553281, "label": "e1", "end_id": 1125899906842627, "start_id": 1125899906842626, "properties": {}}::edge
{"id": 1407374883553282, "label": "e1", "end_id": 1125899906842626, "start_id": 1125899906842625, "properties": {}}::edge
{"id": 1407374883553281, "label": "e1", "end_id": 1125899906842627, "start_id": 1125899906842626, "properties": {}}::edge
{"id": 1407374883553282, "label": "e1", "end_id": 1125899906842626, "start_id": 1125899906842625, "properties": {}}::edge
{"id": 1407374883553282, "label": "e1", "end_id": 1125899906842626, "start_id": 1125899906842625, "properties": {}}::edge
(4 rows)

-- id()
Expand All @@ -1959,10 +1959,10 @@ SELECT * FROM cypher('expr', $$
$$) AS (id agtype);
id
------------------
1407374883553282
1407374883553281
1407374883553282
1407374883553281
1407374883553282
1407374883553282
(4 rows)

SELECT * FROM cypher('expr', $$
Expand Down Expand Up @@ -2001,10 +2001,10 @@ SELECT * FROM cypher('expr', $$
$$) AS (start_id agtype);
start_id
------------------
1125899906842625
1125899906842626
1125899906842625
1125899906842626
1125899906842625
1125899906842625
(4 rows)

-- should return null
Expand Down Expand Up @@ -2034,10 +2034,10 @@ SELECT * FROM cypher('expr', $$
$$) AS (end_id agtype);
end_id
------------------
1125899906842626
1125899906842627
1125899906842626
1125899906842627
1125899906842626
1125899906842626
(4 rows)

-- should return null
Expand Down
Loading