1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
| INSERT INTO node(properties) VALUES('{"Label":"Person", "Name":"张三", "Age": 22}'); INSERT INTO node(properties) VALUES('{"Label":"Person", "Name":"李四", "Age": 30}'); INSERT INTO node(properties) VALUES('{"Label":"Person", "Name":"王五", "Age": 28}');
INSERT INTO edge(source_id, target_id, properties) VALUES((SELECT node_id FROM node WHERE properties ->> 'Name'='张三'), (SELECT node_id FROM node WHERE properties ->> 'Name'='李四'), '{"Label":"关注", "Degree": 80}'); INSERT INTO edge(source_id, target_id, properties) VALUES((SELECT node_id FROM node WHERE properties ->> 'Name'='李四'), (SELECT node_id FROM node WHERE properties ->> 'Name'='王五'), '{"Label":"关注", "Degree": 90}'); INSERT INTO edge(source_id, target_id, properties) VALUES((SELECT node_id FROM node WHERE properties ->> 'Name'='张三'), (SELECT node_id FROM node WHERE properties ->> 'Name'='王五'), '{"Label":"关注", "Degree": 60}');
|