diff options
| author | LV-426 <lv-426@taproot.org.il> | 2014-12-15 23:38:05 +0200 |
|---|---|---|
| committer | LV-426 <lv-426@taproot.org.il> | 2014-12-16 15:08:37 +0200 |
| commit | 2ce705db9086188897df8464ac9cb8cb6fb6ce0e (patch) | |
| tree | 496f63d9a2bf403171f77b3e79d3db501d043714 /src-py | |
| parent | bc5d0e72bbad1700d6738ae94ee35ad1d7455b39 (diff) | |
gen_query_create_from_node_map(): validate label
Diffstat (limited to 'src-py')
| -rw-r--r-- | src-py/neo4j_util.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src-py/neo4j_util.py b/src-py/neo4j_util.py index a203207f..cf2f962e 100644 --- a/src-py/neo4j_util.py +++ b/src-py/neo4j_util.py @@ -165,8 +165,11 @@ def gen_query_create_from_node_map(node_map, input_to_DB_property_map=lambda _: __type_check_link_or_node_map(node_map) ret = [] - for n_type, n_set in node_map.items(): - q_arr = ['create (n:%s {node_attr})' % (n_type), + for label, n_set in node_map.items(): + + assert len(label) > 2 and label[0].isupper() and label[1:].islower(), 'malformed label: ' + label + + q_arr = ['create (n:%s {node_attr})' % (label), 'return n.id' ] |
