Unsure how this should be handled. When updating a table that has been registered within a property graph, the following query won't work anymore, since the primary (or foreign key) which was used during registration no longer matches with the actual column value. Perhaps this is the way to handle it
# Data
CREATE TABLE Student(id BIGINT, name VARCHAR);
CREATE TABLE know(src BIGINT, dst BIGINT, createDate BIGINT);
CREATE TABLE School(name VARCHAR, Id BIGINT, Kind VARCHAR);
CREATE TABLE StudyAt(personId BIGINT, schoolId BIGINT);
INSERT INTO Student VALUES (0, 'Daniel'), (1, 'Tavneet'), (2, 'Gabor'), (3, 'Peter'), (4, 'David');
INSERT INTO know VALUES (0,1, 10), (0,2, 11), (0,3, 12), (3,0, 13), (1,2, 14), (1,3, 15), (2,3, 16), (4,3, 17);
INSERT INTO School VALUES ('VU', 0, 'University'), ('UVA', 1, 'University');
INSERT INTO StudyAt VALUES (0, 0), (1, 0), (2, 1), (3, 1), (4, 1);
-CREATE PROPERTY GRAPH pg
VERTEX TABLES (
Student PROPERTIES ( id, name ) LABEL Person,
School LABEL SCHOOL
)
EDGE TABLES (
know SOURCE KEY ( src ) REFERENCES Student ( id )
DESTINATION KEY ( dst ) REFERENCES Student ( id )
LABEL Knows,
studyAt SOURCE KEY ( personId ) REFERENCES Student ( id )
DESTINATION KEY ( SchoolId ) REFERENCES School ( id )
LABEL StudyAt
);
ALTER TABLE student RENAME id TO jd;
-FROM GRAPH_TABLE (pg
MATCH
(a:Person)-[s:StudyAt]->(b:School)
WHERE a.name = 'Daniel'
COLUMNS (a.jd)
) study;