|
@@ -311,17 +311,17 @@ def list_pop_final(a, **remainder):
|
|
|
_, = yield [("DE", [result_edge])]
|
|
|
yield [("RETURN", [{'id': result}])]
|
|
|
|
|
|
-"""
|
|
|
def instantiate_node(a, b, c, **remainder):
|
|
|
+ if "value" not in b:
|
|
|
+ b['value'], = yield [("RV", [b['id']])]
|
|
|
+
|
|
|
if "value" not in c:
|
|
|
c['value'], = yield [("RV", [c['id']])]
|
|
|
|
|
|
- if "id" not in b:
|
|
|
- b['id'], = yield [("CNV", [b['value']])]
|
|
|
-
|
|
|
- node, dict_entry = \
|
|
|
+ node, dict_entry, tm = \
|
|
|
yield [("CN", []),
|
|
|
("RD", [a['id'], "model"]),
|
|
|
+ ("RD", [a['id'], "type_mapping"]),
|
|
|
]
|
|
|
|
|
|
if c['value'] == "":
|
|
@@ -331,10 +331,21 @@ def instantiate_node(a, b, c, **remainder):
|
|
|
name = c['value']
|
|
|
name_node = c
|
|
|
|
|
|
- yield [("CD", [dict_entry, name, node])]
|
|
|
+ _, root = yield [("CD", [dict_entry, name, node]),
|
|
|
+ ("RD", [tm, "root"])]
|
|
|
+
|
|
|
+ # Create new type links
|
|
|
+ type_elem, instance_elem = yield [("CNV", [b['value']]), ("CNV", [name])]
|
|
|
+ type_link, = yield [("CE", [root, type_elem])]
|
|
|
+ instance_link, = yield [("CE", [type_link, instance_elem])]
|
|
|
+
|
|
|
+ # Add them to the model
|
|
|
+ yield [("CD", [tm, str(type_elem), type_elem]),
|
|
|
+ ("CD", [tm, str(instance_elem), instance_elem]),
|
|
|
+ ("CD", [tm, str(type_link), type_link]),
|
|
|
+ ("CD", [tm, str(instance_link), instance_link])]
|
|
|
|
|
|
yield [("RETURN", [name_node])]
|
|
|
-"""
|
|
|
|
|
|
def list_insert(a, b, c, **remainder):
|
|
|
if "id" not in b:
|