python-eigen-ingenuity-nocli 0.5.29b1__tar.gz → 0.5.30b2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {python_eigen_ingenuity_nocli-0.5.29b1/python_eigen_ingenuity_nocli.egg-info → python_eigen_ingenuity_nocli-0.5.30b2}/PKG-INFO +1 -1
- {python_eigen_ingenuity_nocli-0.5.29b1 → python_eigen_ingenuity_nocli-0.5.30b2}/modelbuilder/src/csvcontentsmanager.py +19 -6
- {python_eigen_ingenuity_nocli-0.5.29b1 → python_eigen_ingenuity_nocli-0.5.30b2}/modelbuilder/src/processors/nodefileprocessor.py +14 -2
- {python_eigen_ingenuity_nocli-0.5.29b1 → python_eigen_ingenuity_nocli-0.5.30b2}/modelbuilder/src/processors/relationshipfileprocessor.py +64 -5
- {python_eigen_ingenuity_nocli-0.5.29b1 → python_eigen_ingenuity_nocli-0.5.30b2}/modelbuilder/src/property.py +3 -1
- {python_eigen_ingenuity_nocli-0.5.29b1 → python_eigen_ingenuity_nocli-0.5.30b2/python_eigen_ingenuity_nocli.egg-info}/PKG-INFO +1 -1
- {python_eigen_ingenuity_nocli-0.5.29b1 → python_eigen_ingenuity_nocli-0.5.30b2}/MANIFEST.in +0 -0
- {python_eigen_ingenuity_nocli-0.5.29b1 → python_eigen_ingenuity_nocli-0.5.30b2}/README-nocli.md +0 -0
- {python_eigen_ingenuity_nocli-0.5.29b1 → python_eigen_ingenuity_nocli-0.5.30b2}/README.md +0 -0
- {python_eigen_ingenuity_nocli-0.5.29b1 → python_eigen_ingenuity_nocli-0.5.30b2}/eigeningenuity/__init__.py +0 -0
- {python_eigen_ingenuity_nocli-0.5.29b1 → python_eigen_ingenuity_nocli-0.5.30b2}/eigeningenuity/assetmodel.py +0 -0
- {python_eigen_ingenuity_nocli-0.5.29b1 → python_eigen_ingenuity_nocli-0.5.30b2}/eigeningenuity/auth.py +0 -0
- {python_eigen_ingenuity_nocli-0.5.29b1 → python_eigen_ingenuity_nocli-0.5.30b2}/eigeningenuity/commonmenu.py +0 -0
- {python_eigen_ingenuity_nocli-0.5.29b1 → python_eigen_ingenuity_nocli-0.5.30b2}/eigeningenuity/core/__init__.py +0 -0
- {python_eigen_ingenuity_nocli-0.5.29b1 → python_eigen_ingenuity_nocli-0.5.30b2}/eigeningenuity/elastic.py +0 -0
- {python_eigen_ingenuity_nocli-0.5.29b1 → python_eigen_ingenuity_nocli-0.5.30b2}/eigeningenuity/events.py +0 -0
- {python_eigen_ingenuity_nocli-0.5.29b1 → python_eigen_ingenuity_nocli-0.5.30b2}/eigeningenuity/historian.py +0 -0
- {python_eigen_ingenuity_nocli-0.5.29b1 → python_eigen_ingenuity_nocli-0.5.30b2}/eigeningenuity/historianmulti.py +0 -0
- {python_eigen_ingenuity_nocli-0.5.29b1 → python_eigen_ingenuity_nocli-0.5.30b2}/eigeningenuity/logformatter.py +0 -0
- {python_eigen_ingenuity_nocli-0.5.29b1 → python_eigen_ingenuity_nocli-0.5.30b2}/eigeningenuity/settings.py +0 -0
- {python_eigen_ingenuity_nocli-0.5.29b1 → python_eigen_ingenuity_nocli-0.5.30b2}/eigeningenuity/sql.py +0 -0
- {python_eigen_ingenuity_nocli-0.5.29b1 → python_eigen_ingenuity_nocli-0.5.30b2}/eigeningenuity/util.py +0 -0
- {python_eigen_ingenuity_nocli-0.5.29b1 → python_eigen_ingenuity_nocli-0.5.30b2}/local-tests/__init__.py +0 -0
- {python_eigen_ingenuity_nocli-0.5.29b1 → python_eigen_ingenuity_nocli-0.5.30b2}/local-tests/common.py +0 -0
- {python_eigen_ingenuity_nocli-0.5.29b1 → python_eigen_ingenuity_nocli-0.5.30b2}/local-tests/config.py +0 -0
- {python_eigen_ingenuity_nocli-0.5.29b1 → python_eigen_ingenuity_nocli-0.5.30b2}/local-tests/demo.py +0 -0
- {python_eigen_ingenuity_nocli-0.5.29b1 → python_eigen_ingenuity_nocli-0.5.30b2}/local-tests/historian/__init__.py +0 -0
- {python_eigen_ingenuity_nocli-0.5.29b1 → python_eigen_ingenuity_nocli-0.5.30b2}/local-tests/historian/test_getCurrentDataPoints.py +0 -0
- {python_eigen_ingenuity_nocli-0.5.29b1 → python_eigen_ingenuity_nocli-0.5.30b2}/local-tests/historian/test_getInterpolatedPoints.py +0 -0
- {python_eigen_ingenuity_nocli-0.5.29b1 → python_eigen_ingenuity_nocli-0.5.30b2}/local-tests/historian/test_getInterpolatedRange.py +0 -0
- {python_eigen_ingenuity_nocli-0.5.29b1 → python_eigen_ingenuity_nocli-0.5.30b2}/local-tests/historian/test_getMetaData.py +0 -0
- {python_eigen_ingenuity_nocli-0.5.29b1 → python_eigen_ingenuity_nocli-0.5.30b2}/local-tests/historian/test_getRawDataPoints.py +0 -0
- {python_eigen_ingenuity_nocli-0.5.29b1 → python_eigen_ingenuity_nocli-0.5.30b2}/local-tests/historian/test_listDataTags.py +0 -0
- {python_eigen_ingenuity_nocli-0.5.29b1 → python_eigen_ingenuity_nocli-0.5.30b2}/local-tests/historian/test_writePoints.py +0 -0
- {python_eigen_ingenuity_nocli-0.5.29b1 → python_eigen_ingenuity_nocli-0.5.30b2}/local-tests/historianmulti/__init__.py +0 -0
- {python_eigen_ingenuity_nocli-0.5.29b1 → python_eigen_ingenuity_nocli-0.5.30b2}/local-tests/historianmulti/common_multi.py +0 -0
- {python_eigen_ingenuity_nocli-0.5.29b1 → python_eigen_ingenuity_nocli-0.5.30b2}/local-tests/historianmulti/test_getClosestRawPoint.py +0 -0
- {python_eigen_ingenuity_nocli-0.5.29b1 → python_eigen_ingenuity_nocli-0.5.30b2}/local-tests/historianmulti/test_getCurrentDataPoints.py +0 -0
- {python_eigen_ingenuity_nocli-0.5.29b1 → python_eigen_ingenuity_nocli-0.5.30b2}/local-tests/historianmulti/test_getInterpolatedPoints.py +0 -0
- {python_eigen_ingenuity_nocli-0.5.29b1 → python_eigen_ingenuity_nocli-0.5.30b2}/local-tests/historianmulti/test_getInterpolatedRange.py +0 -0
- {python_eigen_ingenuity_nocli-0.5.29b1 → python_eigen_ingenuity_nocli-0.5.30b2}/local-tests/historianmulti/test_getMetaData.py +0 -0
- {python_eigen_ingenuity_nocli-0.5.29b1 → python_eigen_ingenuity_nocli-0.5.30b2}/local-tests/historianmulti/test_getRawDatapoints.py +0 -0
- {python_eigen_ingenuity_nocli-0.5.29b1 → python_eigen_ingenuity_nocli-0.5.30b2}/local-tests/historianmulti/test_listDataTags.py +0 -0
- {python_eigen_ingenuity_nocli-0.5.29b1 → python_eigen_ingenuity_nocli-0.5.30b2}/local-tests/historianmulti/test_tagManagement.py +0 -0
- {python_eigen_ingenuity_nocli-0.5.29b1 → python_eigen_ingenuity_nocli-0.5.30b2}/local-tests/historianmulti/test_writePoints.py +0 -0
- {python_eigen_ingenuity_nocli-0.5.29b1 → python_eigen_ingenuity_nocli-0.5.30b2}/local-tests/run_tests.py +0 -0
- {python_eigen_ingenuity_nocli-0.5.29b1 → python_eigen_ingenuity_nocli-0.5.30b2}/modelbuilder/__init__.py +0 -0
- {python_eigen_ingenuity_nocli-0.5.29b1 → python_eigen_ingenuity_nocli-0.5.30b2}/modelbuilder/src/__init__.py +0 -0
- {python_eigen_ingenuity_nocli-0.5.29b1 → python_eigen_ingenuity_nocli-0.5.30b2}/modelbuilder/src/assetmodelbuilder.py +0 -0
- {python_eigen_ingenuity_nocli-0.5.29b1 → python_eigen_ingenuity_nocli-0.5.30b2}/modelbuilder/src/assetmodelcsvwriter.py +0 -0
- {python_eigen_ingenuity_nocli-0.5.29b1 → python_eigen_ingenuity_nocli-0.5.30b2}/modelbuilder/src/assetmodelutilities.py +0 -0
- {python_eigen_ingenuity_nocli-0.5.29b1 → python_eigen_ingenuity_nocli-0.5.30b2}/modelbuilder/src/configmanager.py +0 -0
- {python_eigen_ingenuity_nocli-0.5.29b1 → python_eigen_ingenuity_nocli-0.5.30b2}/modelbuilder/src/connectors/__init__.py +0 -0
- {python_eigen_ingenuity_nocli-0.5.29b1 → python_eigen_ingenuity_nocli-0.5.30b2}/modelbuilder/src/connectors/boltconnector.py +0 -0
- {python_eigen_ingenuity_nocli-0.5.29b1 → python_eigen_ingenuity_nocli-0.5.30b2}/modelbuilder/src/connectors/dbconnectors.py +0 -0
- {python_eigen_ingenuity_nocli-0.5.29b1 → python_eigen_ingenuity_nocli-0.5.30b2}/modelbuilder/src/connectors/genericconnector.py +0 -0
- {python_eigen_ingenuity_nocli-0.5.29b1 → python_eigen_ingenuity_nocli-0.5.30b2}/modelbuilder/src/connectors/httpsconnector.py +0 -0
- {python_eigen_ingenuity_nocli-0.5.29b1 → python_eigen_ingenuity_nocli-0.5.30b2}/modelbuilder/src/csvwriter.py +0 -0
- {python_eigen_ingenuity_nocli-0.5.29b1 → python_eigen_ingenuity_nocli-0.5.30b2}/modelbuilder/src/fileanalyser.py +0 -0
- {python_eigen_ingenuity_nocli-0.5.29b1 → python_eigen_ingenuity_nocli-0.5.30b2}/modelbuilder/src/filemanager.py +0 -0
- {python_eigen_ingenuity_nocli-0.5.29b1 → python_eigen_ingenuity_nocli-0.5.30b2}/modelbuilder/src/messages.py +0 -0
- {python_eigen_ingenuity_nocli-0.5.29b1 → python_eigen_ingenuity_nocli-0.5.30b2}/modelbuilder/src/processors/__init__.py +0 -0
- {python_eigen_ingenuity_nocli-0.5.29b1 → python_eigen_ingenuity_nocli-0.5.30b2}/modelbuilder/src/processors/cypherfileprocessor.py +0 -0
- {python_eigen_ingenuity_nocli-0.5.29b1 → python_eigen_ingenuity_nocli-0.5.30b2}/modelbuilder/src/processors/labelmanager.py +0 -0
- {python_eigen_ingenuity_nocli-0.5.29b1 → python_eigen_ingenuity_nocli-0.5.30b2}/modelbuilder/src/processors/propertymanager.py +0 -0
- {python_eigen_ingenuity_nocli-0.5.29b1 → python_eigen_ingenuity_nocli-0.5.30b2}/modelbuilder/src/processors/relationshipmanager.py +0 -0
- {python_eigen_ingenuity_nocli-0.5.29b1 → python_eigen_ingenuity_nocli-0.5.30b2}/modelbuilder/src/queries/__init__.py +0 -0
- {python_eigen_ingenuity_nocli-0.5.29b1 → python_eigen_ingenuity_nocli-0.5.30b2}/modelbuilder/src/queries/cypherbuilder.py +0 -0
- {python_eigen_ingenuity_nocli-0.5.29b1 → python_eigen_ingenuity_nocli-0.5.30b2}/modelbuilder/src/queries/query.py +0 -0
- {python_eigen_ingenuity_nocli-0.5.29b1 → python_eigen_ingenuity_nocli-0.5.30b2}/modelbuilder/src/querymanager.py +0 -0
- {python_eigen_ingenuity_nocli-0.5.29b1 → python_eigen_ingenuity_nocli-0.5.30b2}/modelbuilder/src/versionmanager.py +0 -0
- {python_eigen_ingenuity_nocli-0.5.29b1 → python_eigen_ingenuity_nocli-0.5.30b2}/pyproject.toml +0 -0
- {python_eigen_ingenuity_nocli-0.5.29b1 → python_eigen_ingenuity_nocli-0.5.30b2}/python_eigen_ingenuity_nocli.egg-info/SOURCES.txt +0 -0
- {python_eigen_ingenuity_nocli-0.5.29b1 → python_eigen_ingenuity_nocli-0.5.30b2}/python_eigen_ingenuity_nocli.egg-info/dependency_links.txt +0 -0
- {python_eigen_ingenuity_nocli-0.5.29b1 → python_eigen_ingenuity_nocli-0.5.30b2}/python_eigen_ingenuity_nocli.egg-info/requires.txt +0 -0
- {python_eigen_ingenuity_nocli-0.5.29b1 → python_eigen_ingenuity_nocli-0.5.30b2}/python_eigen_ingenuity_nocli.egg-info/top_level.txt +0 -0
- {python_eigen_ingenuity_nocli-0.5.29b1 → python_eigen_ingenuity_nocli-0.5.30b2}/regressiontests/__init__.py +0 -0
- {python_eigen_ingenuity_nocli-0.5.29b1 → python_eigen_ingenuity_nocli-0.5.30b2}/regressiontests/eigeningenuity/__init__.py +0 -0
- {python_eigen_ingenuity_nocli-0.5.29b1 → python_eigen_ingenuity_nocli-0.5.30b2}/regressiontests/eigeningenuity/common.py +0 -0
- {python_eigen_ingenuity_nocli-0.5.29b1 → python_eigen_ingenuity_nocli-0.5.30b2}/regressiontests/eigeningenuity/common_multi.py +0 -0
- {python_eigen_ingenuity_nocli-0.5.29b1 → python_eigen_ingenuity_nocli-0.5.30b2}/regressiontests/eigeningenuity/historian/__init__.py +0 -0
- {python_eigen_ingenuity_nocli-0.5.29b1 → python_eigen_ingenuity_nocli-0.5.30b2}/regressiontests/eigeningenuity/historian/common.py +0 -0
- {python_eigen_ingenuity_nocli-0.5.29b1 → python_eigen_ingenuity_nocli-0.5.30b2}/regressiontests/eigeningenuity/historian/test_getCurrentDataPoints.py +0 -0
- {python_eigen_ingenuity_nocli-0.5.29b1 → python_eigen_ingenuity_nocli-0.5.30b2}/regressiontests/eigeningenuity/historian/test_getInterpolatedPoints.py +0 -0
- {python_eigen_ingenuity_nocli-0.5.29b1 → python_eigen_ingenuity_nocli-0.5.30b2}/regressiontests/eigeningenuity/historian/test_getInterpolatedRange.py +0 -0
- {python_eigen_ingenuity_nocli-0.5.29b1 → python_eigen_ingenuity_nocli-0.5.30b2}/regressiontests/eigeningenuity/historian/test_getMetaData.py +0 -0
- {python_eigen_ingenuity_nocli-0.5.29b1 → python_eigen_ingenuity_nocli-0.5.30b2}/regressiontests/eigeningenuity/historian/test_getRawDataPoints.py +0 -0
- {python_eigen_ingenuity_nocli-0.5.29b1 → python_eigen_ingenuity_nocli-0.5.30b2}/regressiontests/eigeningenuity/historian/test_listDataTags.py +0 -0
- {python_eigen_ingenuity_nocli-0.5.29b1 → python_eigen_ingenuity_nocli-0.5.30b2}/regressiontests/eigeningenuity/historian/test_writePoints.py +0 -0
- {python_eigen_ingenuity_nocli-0.5.29b1 → python_eigen_ingenuity_nocli-0.5.30b2}/regressiontests/eigeningenuity/historian-multi/__init__.py +0 -0
- {python_eigen_ingenuity_nocli-0.5.29b1 → python_eigen_ingenuity_nocli-0.5.30b2}/regressiontests/eigeningenuity/historian-multi/common_multi.py +0 -0
- {python_eigen_ingenuity_nocli-0.5.29b1 → python_eigen_ingenuity_nocli-0.5.30b2}/regressiontests/eigeningenuity/historian-multi/test_getClosestRawPoint.py +0 -0
- {python_eigen_ingenuity_nocli-0.5.29b1 → python_eigen_ingenuity_nocli-0.5.30b2}/regressiontests/eigeningenuity/historian-multi/test_getCurrentDataPoints.py +0 -0
- {python_eigen_ingenuity_nocli-0.5.29b1 → python_eigen_ingenuity_nocli-0.5.30b2}/regressiontests/eigeningenuity/historian-multi/test_getInterpolatedPoints.py +0 -0
- {python_eigen_ingenuity_nocli-0.5.29b1 → python_eigen_ingenuity_nocli-0.5.30b2}/regressiontests/eigeningenuity/historian-multi/test_getInterpolatedRange.py +0 -0
- {python_eigen_ingenuity_nocli-0.5.29b1 → python_eigen_ingenuity_nocli-0.5.30b2}/regressiontests/eigeningenuity/historian-multi/test_getMetaData.py +0 -0
- {python_eigen_ingenuity_nocli-0.5.29b1 → python_eigen_ingenuity_nocli-0.5.30b2}/regressiontests/eigeningenuity/historian-multi/test_getRawDatapoints.py +0 -0
- {python_eigen_ingenuity_nocli-0.5.29b1 → python_eigen_ingenuity_nocli-0.5.30b2}/regressiontests/eigeningenuity/historian-multi/test_listDataTags.py +0 -0
- {python_eigen_ingenuity_nocli-0.5.29b1 → python_eigen_ingenuity_nocli-0.5.30b2}/regressiontests/eigeningenuity/historian-multi/test_tagManagement.py +0 -0
- {python_eigen_ingenuity_nocli-0.5.29b1 → python_eigen_ingenuity_nocli-0.5.30b2}/regressiontests/eigeningenuity/historian-multi/test_writePoints.py +0 -0
- {python_eigen_ingenuity_nocli-0.5.29b1 → python_eigen_ingenuity_nocli-0.5.30b2}/requirements.txt +0 -0
- {python_eigen_ingenuity_nocli-0.5.29b1 → python_eigen_ingenuity_nocli-0.5.30b2}/setup.cfg +0 -0
- {python_eigen_ingenuity_nocli-0.5.29b1 → python_eigen_ingenuity_nocli-0.5.30b2}/setup.py +0 -0
|
@@ -134,20 +134,33 @@ class CSVContentsManager:
|
|
|
134
134
|
def get_property_values_dict(self, row_number, column_numbers, allow_blank_property_list, default_key='', prefix='', blank_override='', allow_split=True):
|
|
135
135
|
this_row = self.data_list[row_number]
|
|
136
136
|
if allow_split:
|
|
137
|
-
split_values = [this_row[column].split('::') for column in column_numbers]
|
|
137
|
+
split_values = [this_row[column].split('::', 2) for column in column_numbers]
|
|
138
138
|
else:
|
|
139
139
|
split_values = [[this_row[column]] for column in column_numbers]
|
|
140
140
|
split_keys = [(value[0] + ':').split(':') for value in split_values]
|
|
141
141
|
this_list = {prefix + (self.mapped_keys[column] or default_key): Neo4jProperty(prefix + (self.mapped_keys[column] or default_key), this_row[column], self.formats[column], blank_override=blank_override) if len(split_values[count]) == 1 else {prefix + (split_keys[count][0] or default_key): Neo4jProperty(prefix + (split_keys[count][0] or default_key), split_values[count][1], split_keys[count][1] or self.formats[column], blank_override=blank_override)} for count, column in enumerate(column_numbers) if this_row[column] or self.mapped_keys[column] in allow_blank_property_list or allow_blank_property_list == []}
|
|
142
142
|
return this_list
|
|
143
143
|
|
|
144
|
+
def parse_property_value_with_labels(self, raw_value, default_key, override_key, format_value):
|
|
145
|
+
match_labels = ''
|
|
146
|
+
value_parts = raw_value.split('$$', 1)
|
|
147
|
+
value = value_parts[0]
|
|
148
|
+
if len(value_parts) > 1:
|
|
149
|
+
match_labels = value_parts[1]
|
|
150
|
+
|
|
151
|
+
if '::' in value:
|
|
152
|
+
key_value_parts = value.split('::', 1)
|
|
153
|
+
key = key_value_parts[0] or default_key
|
|
154
|
+
value = key_value_parts[1]
|
|
155
|
+
else:
|
|
156
|
+
key = override_key or default_key
|
|
157
|
+
|
|
158
|
+
return Neo4jProperty(key, value, format_value, match_labels=match_labels)
|
|
159
|
+
|
|
144
160
|
def get_property_values_list(self, row_number, column_numbers, default_key='', override_key='', allow_split=True, override_format=None):
|
|
145
161
|
this_row = self.data_list[row_number]
|
|
146
162
|
if allow_split:
|
|
147
|
-
|
|
163
|
+
this_list = [self.parse_property_value_with_labels(this_row[column], self.mapped_keys[column] or default_key, override_key or self.mapped_keys[column] if self.types[column] == '' else self.mapped_keys[column] or default_key, override_format or self.formats[column]) for column in column_numbers if this_row[column]]
|
|
148
164
|
else:
|
|
149
|
-
|
|
150
|
-
split_keys = [(value[0]+':').split(':') for value in split_values]
|
|
151
|
-
these_keys = [override_key or self.mapped_keys[column] if self.types[column] == '' else self.mapped_keys[column] or default_key for column in column_numbers]
|
|
152
|
-
this_list = [Neo4jProperty(these_keys[count], this_row[column], override_format or self.formats[column]) if len(split_values[count]) == 1 else Neo4jProperty(split_values[count][0] or default_key, split_values[count][1], override_format or split_keys[count][1] or self.formats[column]) for count, column in enumerate(column_numbers) if this_row[column]]
|
|
165
|
+
this_list = [Neo4jProperty(override_key or self.mapped_keys[column] if self.types[column] == '' else self.mapped_keys[column] or default_key, this_row[column], override_format or self.formats[column]) for column in column_numbers if this_row[column]]
|
|
153
166
|
return this_list
|
|
@@ -50,6 +50,16 @@ class NodeFileProcessor:
|
|
|
50
50
|
last_row = min(num_rows, self.last_row)
|
|
51
51
|
return last_row
|
|
52
52
|
|
|
53
|
+
def get_inline_merge_labels(self, label_string):
|
|
54
|
+
# For node MERGE, only colon-separated labels are directly supported.
|
|
55
|
+
# OR expressions (label1|label2) are ignored here because MERGE cannot express label OR.
|
|
56
|
+
if not label_string:
|
|
57
|
+
return []
|
|
58
|
+
if '|' in label_string:
|
|
59
|
+
messages.warning_message('Unsupported inline node label expression: ', f'{label_string} (ignoring OR labels for MERGE)')
|
|
60
|
+
return []
|
|
61
|
+
return lm.validate_label_string_to_list(label_string)
|
|
62
|
+
|
|
53
63
|
def process_node_file(self):
|
|
54
64
|
|
|
55
65
|
# For each line in the file, build a cypher query to MERGE a node
|
|
@@ -70,7 +80,6 @@ class NodeFileProcessor:
|
|
|
70
80
|
|
|
71
81
|
while this_row < last_row:
|
|
72
82
|
validated_csv_labels = lm.validate_labels(self.contents.get_column_values_list(this_row, label_columns))
|
|
73
|
-
merge_labels, new_labels, remove_labels = lm.sort_node_labels(self.required_labels, validated_csv_labels)
|
|
74
83
|
row_properties = self.contents.get_property_values_dict(this_row, property_columns, self.blank_property_list, blank_override=self.blank_property_override, allow_split=False)
|
|
75
84
|
properties = pm.combine_properties(self.required_properties, row_properties)
|
|
76
85
|
# Remove any properties we don't want
|
|
@@ -82,6 +91,8 @@ class NodeFileProcessor:
|
|
|
82
91
|
|
|
83
92
|
for primary_property in self.contents.get_property_values_list(this_row, node_columns, self.primary_property, allow_split=True, override_format='str'):
|
|
84
93
|
time_now = amu.get_formatted_time_now()
|
|
94
|
+
inline_merge_labels = self.get_inline_merge_labels(primary_property.match_labels)
|
|
95
|
+
merge_labels, new_labels, remove_labels = lm.sort_node_labels(self.required_labels, validated_csv_labels + inline_merge_labels)
|
|
85
96
|
|
|
86
97
|
# Build a simple MERGE query using queries
|
|
87
98
|
query_text = (QueryBuilder()
|
|
@@ -156,10 +167,11 @@ class NodeFileProcessor:
|
|
|
156
167
|
|
|
157
168
|
while this_row < last_row:
|
|
158
169
|
validated_csv_labels = lm.validate_labels(self.contents.get_column_values_list(this_row, label_columns))
|
|
159
|
-
merge_labels, new_labels, remove_labels = lm.sort_node_labels(self.required_labels, validated_csv_labels)
|
|
160
170
|
row_properties = self.contents.get_property_values_dict(this_row, property_columns, self.blank_property_list, blank_override=self.blank_property_override, allow_split=False)
|
|
161
171
|
|
|
162
172
|
for primary_property in self.contents.get_property_values_list(this_row, node_columns, self.primary_property, allow_split=True, override_format='str'):
|
|
173
|
+
inline_merge_labels = self.get_inline_merge_labels(primary_property.match_labels)
|
|
174
|
+
merge_labels, new_labels, remove_labels = lm.sort_node_labels(self.required_labels, validated_csv_labels + inline_merge_labels)
|
|
163
175
|
properties = pm.combine_properties(self.required_properties, row_properties)
|
|
164
176
|
# Remove any properties we don't want
|
|
165
177
|
for unwanted in self.unrequired_properties:
|
|
@@ -58,6 +58,45 @@ class RelationshipFileProcessor:
|
|
|
58
58
|
last_row = min(num_rows, self.last_row)
|
|
59
59
|
return last_row
|
|
60
60
|
|
|
61
|
+
def get_inline_match_labels(self, node_ref, label_string):
|
|
62
|
+
# Supports:
|
|
63
|
+
# label1 -> node_ref:label1
|
|
64
|
+
# label1:label2 -> node_ref:label1 AND node_ref:label2
|
|
65
|
+
# label1|label2 -> node_ref:label1 OR node_ref:label2
|
|
66
|
+
# label1:label2|label3 -> (node_ref:label1 AND node_ref:label2) OR node_ref:label3
|
|
67
|
+
if not label_string:
|
|
68
|
+
return [], ''
|
|
69
|
+
|
|
70
|
+
# Grouped expression support:
|
|
71
|
+
# prefix:(a|b) -> required label 'prefix' + WHERE (node_ref:a OR node_ref:b)
|
|
72
|
+
# prefix1:prefix2:(a|b) -> required labels 'prefix1' and 'prefix2' + grouped OR
|
|
73
|
+
if label_string.endswith(')') and ':(' in label_string:
|
|
74
|
+
prefix, grouped = label_string.rsplit(':(', 1)
|
|
75
|
+
grouped = grouped[:-1]
|
|
76
|
+
if grouped and '|' in grouped:
|
|
77
|
+
required_labels = lm.validate_label_string_to_list(prefix)
|
|
78
|
+
option_literals = []
|
|
79
|
+
for option in grouped.split('|'):
|
|
80
|
+
these_labels = lm.validate_label_string_to_list(option)
|
|
81
|
+
if these_labels:
|
|
82
|
+
option_literals.append('(' + ' AND '.join([f'{node_ref}:{label}' for label in these_labels]) + ')')
|
|
83
|
+
if option_literals:
|
|
84
|
+
return required_labels, '(' + ' OR '.join(option_literals) + ')'
|
|
85
|
+
|
|
86
|
+
if '|' not in label_string:
|
|
87
|
+
return lm.validate_label_string_to_list(label_string), ''
|
|
88
|
+
|
|
89
|
+
option_literals = []
|
|
90
|
+
for option in label_string.split('|'):
|
|
91
|
+
these_labels = lm.validate_label_string_to_list(option)
|
|
92
|
+
if these_labels:
|
|
93
|
+
option_literals.append('(' + ' AND '.join([f'{node_ref}:{label}' for label in these_labels]) + ')')
|
|
94
|
+
|
|
95
|
+
if not option_literals:
|
|
96
|
+
return [], ''
|
|
97
|
+
|
|
98
|
+
return [], '(' + ' OR '.join(option_literals) + ')'
|
|
99
|
+
|
|
61
100
|
def process_relationship_file(self):
|
|
62
101
|
|
|
63
102
|
# For each line in the file, build a cypher query to MERGE a relationship
|
|
@@ -97,10 +136,12 @@ class RelationshipFileProcessor:
|
|
|
97
136
|
# If there are multiple From or To nodes, create a relationship query for each combination
|
|
98
137
|
for from_node in self.contents.get_property_values_list(this_row, from_columns, self.primary_property, self.from_property, override_format='str'):
|
|
99
138
|
validated_csv_from_labels = lm.validate_labels(self.contents.get_column_values_list(this_row, from_label_columns))
|
|
100
|
-
|
|
139
|
+
inline_from_labels, inline_from_where = self.get_inline_match_labels(from_ref, from_node.match_labels)
|
|
140
|
+
from_labels = lm.sort_relationship_labels(self.required_labels + self.from_required_labels, validated_csv_from_labels + inline_from_labels)
|
|
101
141
|
for to_node in self.contents.get_property_values_list(this_row, to_columns, self.primary_property, self.to_property, override_format='str'):
|
|
102
142
|
validated_csv_to_labels = lm.validate_labels(self.contents.get_column_values_list(this_row, to_label_columns))
|
|
103
|
-
|
|
143
|
+
inline_to_labels, inline_to_where = self.get_inline_match_labels(to_ref, to_node.match_labels)
|
|
144
|
+
to_labels = lm.sort_relationship_labels(self.required_labels + self.to_required_labels, validated_csv_to_labels + inline_to_labels)
|
|
104
145
|
|
|
105
146
|
# Build a MERGE query for the relationship(s)
|
|
106
147
|
for relationship in relationships:
|
|
@@ -113,6 +154,13 @@ class RelationshipFileProcessor:
|
|
|
113
154
|
.node(labels=from_labels, ref_name=from_ref, properties=from_node)
|
|
114
155
|
.match()
|
|
115
156
|
.node(labels=to_labels, ref_name=to_ref, properties=to_node)
|
|
157
|
+
)
|
|
158
|
+
|
|
159
|
+
where_literals = [i for i in [inline_from_where, inline_to_where] if i]
|
|
160
|
+
if where_literals:
|
|
161
|
+
query_text = query_text.where_literal(' AND '.join(where_literals))
|
|
162
|
+
|
|
163
|
+
query_text = (query_text
|
|
116
164
|
.merge()
|
|
117
165
|
.node(ref_name=from_ref)
|
|
118
166
|
.related_to(label=relation, ref_name=relation_ref)
|
|
@@ -195,10 +243,12 @@ class RelationshipFileProcessor:
|
|
|
195
243
|
# If there are multiple From or To nodes, create a relationship query for each combination
|
|
196
244
|
for from_node in self.contents.get_property_values_list(this_row, from_columns, self.primary_property, self.from_property, override_format='str'):
|
|
197
245
|
validated_csv_from_labels = lm.validate_labels(self.contents.get_column_values_list(this_row, from_label_columns))
|
|
198
|
-
|
|
246
|
+
inline_from_labels, inline_from_where = self.get_inline_match_labels(from_ref, from_node.match_labels)
|
|
247
|
+
from_labels = lm.sort_relationship_labels(self.required_labels + self.from_required_labels, validated_csv_from_labels + inline_from_labels)
|
|
199
248
|
for to_node in self.contents.get_property_values_list(this_row, to_columns, self.primary_property, self.to_property, override_format='str'):
|
|
200
249
|
validated_csv_to_labels = lm.validate_labels(self.contents.get_column_values_list(this_row, to_label_columns))
|
|
201
|
-
|
|
250
|
+
inline_to_labels, inline_to_where = self.get_inline_match_labels(to_ref, to_node.match_labels)
|
|
251
|
+
to_labels = lm.sort_relationship_labels(self.required_labels + self.to_required_labels, validated_csv_to_labels + inline_to_labels)
|
|
202
252
|
|
|
203
253
|
# Build a MERGE query for the relationship(s)
|
|
204
254
|
for relationship in relationships:
|
|
@@ -214,7 +264,7 @@ class RelationshipFileProcessor:
|
|
|
214
264
|
|
|
215
265
|
query_data_list = []
|
|
216
266
|
for count in range(max(len(param_from_nodes), len(param_to_nodes), len(param_explicit_props), len(param_calc_props))):
|
|
217
|
-
new_labels_list = [[from_labels, to_labels, relation, from_node.key, to_node.key, param_calc_props[min(count, len(param_calc_props) - 1)]]]
|
|
267
|
+
new_labels_list = [[from_labels, to_labels, relation, from_node.key, to_node.key, inline_from_where, inline_to_where, param_calc_props[min(count, len(param_calc_props) - 1)]]]
|
|
218
268
|
query_data_list += [[param_from_nodes[min(count, len(param_from_nodes) - 1)].value.replace('\\\\n', '\n'), param_to_nodes[min(count, len(param_to_nodes) - 1)].value.replace('\\\\n', '\n'), param_explicit_props[min(count, len(param_explicit_props) - 1)], param_calc_props[min(count, len(param_calc_props) - 1)], time_now]]
|
|
219
269
|
|
|
220
270
|
# So now we know all about this particular update. Let's put it in the query dictionary
|
|
@@ -245,6 +295,8 @@ class RelationshipFileProcessor:
|
|
|
245
295
|
relationship = batch_keys[from_to_labels][2]
|
|
246
296
|
from_node = batch_keys[from_to_labels][3]
|
|
247
297
|
to_node = batch_keys[from_to_labels][4]
|
|
298
|
+
from_where = batch_keys[from_to_labels][5]
|
|
299
|
+
to_where = batch_keys[from_to_labels][6]
|
|
248
300
|
batch_num = 1
|
|
249
301
|
while batch_num <= num_batches:
|
|
250
302
|
if batch_num == num_batches:
|
|
@@ -285,6 +337,13 @@ class RelationshipFileProcessor:
|
|
|
285
337
|
.node(labels=from_labels, ref_name=from_ref, properties_literal=from_keys)
|
|
286
338
|
.match()
|
|
287
339
|
.node(labels=to_labels, ref_name=to_ref, properties_literal=to_keys)
|
|
340
|
+
)
|
|
341
|
+
|
|
342
|
+
where_literals = [i for i in [from_where, to_where] if i]
|
|
343
|
+
if where_literals:
|
|
344
|
+
query_text = query_text.where_literal(' AND '.join(where_literals))
|
|
345
|
+
|
|
346
|
+
query_text = (query_text
|
|
288
347
|
.merge()
|
|
289
348
|
.node(ref_name=from_ref)
|
|
290
349
|
.related_to(label=relationship, ref_name=relation_ref)
|
|
@@ -6,7 +6,7 @@ from querymanager import QueryManager
|
|
|
6
6
|
|
|
7
7
|
class Neo4jProperty():
|
|
8
8
|
|
|
9
|
-
def __init__(self, key, value = None, format = None, type = None, blank_override = False):
|
|
9
|
+
def __init__(self, key, value = None, format = None, type = None, blank_override = False, match_labels=''):
|
|
10
10
|
|
|
11
11
|
self.key = pm.validate_property(key)
|
|
12
12
|
# Sanitise the value
|
|
@@ -20,6 +20,8 @@ class Neo4jProperty():
|
|
|
20
20
|
self.format = format
|
|
21
21
|
# type is the kind of thing this is, such as ID, START_ID etc. See assetmodelutilities.py for the full list
|
|
22
22
|
self.type = type
|
|
23
|
+
# Optional inline label selector used when matching nodes from csv values such as key::value::labelA|labelB
|
|
24
|
+
self.match_labels = match_labels
|
|
23
25
|
|
|
24
26
|
# We'll format the value the first time someone wants it, so say it's not formatted yet
|
|
25
27
|
self.formatted_values = {}
|
|
File without changes
|
{python_eigen_ingenuity_nocli-0.5.29b1 → python_eigen_ingenuity_nocli-0.5.30b2}/README-nocli.md
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{python_eigen_ingenuity_nocli-0.5.29b1 → python_eigen_ingenuity_nocli-0.5.30b2}/local-tests/demo.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{python_eigen_ingenuity_nocli-0.5.29b1 → python_eigen_ingenuity_nocli-0.5.30b2}/pyproject.toml
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{python_eigen_ingenuity_nocli-0.5.29b1 → python_eigen_ingenuity_nocli-0.5.30b2}/requirements.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|