python-eigen-ingenuity-nocli 0.5.32b3__tar.gz → 0.5.33b1__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.32b3/python_eigen_ingenuity_nocli.egg-info → python_eigen_ingenuity_nocli-0.5.33b1}/PKG-INFO +1 -1
- {python_eigen_ingenuity_nocli-0.5.32b3 → python_eigen_ingenuity_nocli-0.5.33b1}/modelbuilder/src/processors/nodefileprocessor.py +55 -37
- {python_eigen_ingenuity_nocli-0.5.32b3 → python_eigen_ingenuity_nocli-0.5.33b1}/modelbuilder/src/processors/relationshipfileprocessor.py +19 -13
- {python_eigen_ingenuity_nocli-0.5.32b3 → python_eigen_ingenuity_nocli-0.5.33b1}/modelbuilder/src/property.py +9 -11
- python_eigen_ingenuity_nocli-0.5.33b1/modelbuilder/src/querymanager.py +64 -0
- {python_eigen_ingenuity_nocli-0.5.32b3 → python_eigen_ingenuity_nocli-0.5.33b1/python_eigen_ingenuity_nocli.egg-info}/PKG-INFO +1 -1
- python_eigen_ingenuity_nocli-0.5.32b3/modelbuilder/src/querymanager.py +0 -98
- {python_eigen_ingenuity_nocli-0.5.32b3 → python_eigen_ingenuity_nocli-0.5.33b1}/MANIFEST.in +0 -0
- {python_eigen_ingenuity_nocli-0.5.32b3 → python_eigen_ingenuity_nocli-0.5.33b1}/README-nocli.md +0 -0
- {python_eigen_ingenuity_nocli-0.5.32b3 → python_eigen_ingenuity_nocli-0.5.33b1}/README.md +0 -0
- {python_eigen_ingenuity_nocli-0.5.32b3 → python_eigen_ingenuity_nocli-0.5.33b1}/eigeningenuity/__init__.py +0 -0
- {python_eigen_ingenuity_nocli-0.5.32b3 → python_eigen_ingenuity_nocli-0.5.33b1}/eigeningenuity/assetmodel.py +0 -0
- {python_eigen_ingenuity_nocli-0.5.32b3 → python_eigen_ingenuity_nocli-0.5.33b1}/eigeningenuity/auth.py +0 -0
- {python_eigen_ingenuity_nocli-0.5.32b3 → python_eigen_ingenuity_nocli-0.5.33b1}/eigeningenuity/commonmenu.py +0 -0
- {python_eigen_ingenuity_nocli-0.5.32b3 → python_eigen_ingenuity_nocli-0.5.33b1}/eigeningenuity/core/__init__.py +0 -0
- {python_eigen_ingenuity_nocli-0.5.32b3 → python_eigen_ingenuity_nocli-0.5.33b1}/eigeningenuity/elastic.py +0 -0
- {python_eigen_ingenuity_nocli-0.5.32b3 → python_eigen_ingenuity_nocli-0.5.33b1}/eigeningenuity/events.py +0 -0
- {python_eigen_ingenuity_nocli-0.5.32b3 → python_eigen_ingenuity_nocli-0.5.33b1}/eigeningenuity/historian.py +0 -0
- {python_eigen_ingenuity_nocli-0.5.32b3 → python_eigen_ingenuity_nocli-0.5.33b1}/eigeningenuity/historianmulti.py +0 -0
- {python_eigen_ingenuity_nocli-0.5.32b3 → python_eigen_ingenuity_nocli-0.5.33b1}/eigeningenuity/logformatter.py +0 -0
- {python_eigen_ingenuity_nocli-0.5.32b3 → python_eigen_ingenuity_nocli-0.5.33b1}/eigeningenuity/settings.py +0 -0
- {python_eigen_ingenuity_nocli-0.5.32b3 → python_eigen_ingenuity_nocli-0.5.33b1}/eigeningenuity/sql.py +0 -0
- {python_eigen_ingenuity_nocli-0.5.32b3 → python_eigen_ingenuity_nocli-0.5.33b1}/eigeningenuity/util.py +0 -0
- {python_eigen_ingenuity_nocli-0.5.32b3 → python_eigen_ingenuity_nocli-0.5.33b1}/local-tests/__init__.py +0 -0
- {python_eigen_ingenuity_nocli-0.5.32b3 → python_eigen_ingenuity_nocli-0.5.33b1}/local-tests/common.py +0 -0
- {python_eigen_ingenuity_nocli-0.5.32b3 → python_eigen_ingenuity_nocli-0.5.33b1}/local-tests/config.py +0 -0
- {python_eigen_ingenuity_nocli-0.5.32b3 → python_eigen_ingenuity_nocli-0.5.33b1}/local-tests/demo.py +0 -0
- {python_eigen_ingenuity_nocli-0.5.32b3 → python_eigen_ingenuity_nocli-0.5.33b1}/local-tests/historian/__init__.py +0 -0
- {python_eigen_ingenuity_nocli-0.5.32b3 → python_eigen_ingenuity_nocli-0.5.33b1}/local-tests/historian/test_getCurrentDataPoints.py +0 -0
- {python_eigen_ingenuity_nocli-0.5.32b3 → python_eigen_ingenuity_nocli-0.5.33b1}/local-tests/historian/test_getInterpolatedPoints.py +0 -0
- {python_eigen_ingenuity_nocli-0.5.32b3 → python_eigen_ingenuity_nocli-0.5.33b1}/local-tests/historian/test_getInterpolatedRange.py +0 -0
- {python_eigen_ingenuity_nocli-0.5.32b3 → python_eigen_ingenuity_nocli-0.5.33b1}/local-tests/historian/test_getMetaData.py +0 -0
- {python_eigen_ingenuity_nocli-0.5.32b3 → python_eigen_ingenuity_nocli-0.5.33b1}/local-tests/historian/test_getRawDataPoints.py +0 -0
- {python_eigen_ingenuity_nocli-0.5.32b3 → python_eigen_ingenuity_nocli-0.5.33b1}/local-tests/historian/test_listDataTags.py +0 -0
- {python_eigen_ingenuity_nocli-0.5.32b3 → python_eigen_ingenuity_nocli-0.5.33b1}/local-tests/historian/test_writePoints.py +0 -0
- {python_eigen_ingenuity_nocli-0.5.32b3 → python_eigen_ingenuity_nocli-0.5.33b1}/local-tests/historianmulti/__init__.py +0 -0
- {python_eigen_ingenuity_nocli-0.5.32b3 → python_eigen_ingenuity_nocli-0.5.33b1}/local-tests/historianmulti/common_multi.py +0 -0
- {python_eigen_ingenuity_nocli-0.5.32b3 → python_eigen_ingenuity_nocli-0.5.33b1}/local-tests/historianmulti/test_getClosestRawPoint.py +0 -0
- {python_eigen_ingenuity_nocli-0.5.32b3 → python_eigen_ingenuity_nocli-0.5.33b1}/local-tests/historianmulti/test_getCurrentDataPoints.py +0 -0
- {python_eigen_ingenuity_nocli-0.5.32b3 → python_eigen_ingenuity_nocli-0.5.33b1}/local-tests/historianmulti/test_getInterpolatedPoints.py +0 -0
- {python_eigen_ingenuity_nocli-0.5.32b3 → python_eigen_ingenuity_nocli-0.5.33b1}/local-tests/historianmulti/test_getInterpolatedRange.py +0 -0
- {python_eigen_ingenuity_nocli-0.5.32b3 → python_eigen_ingenuity_nocli-0.5.33b1}/local-tests/historianmulti/test_getMetaData.py +0 -0
- {python_eigen_ingenuity_nocli-0.5.32b3 → python_eigen_ingenuity_nocli-0.5.33b1}/local-tests/historianmulti/test_getRawDatapoints.py +0 -0
- {python_eigen_ingenuity_nocli-0.5.32b3 → python_eigen_ingenuity_nocli-0.5.33b1}/local-tests/historianmulti/test_listDataTags.py +0 -0
- {python_eigen_ingenuity_nocli-0.5.32b3 → python_eigen_ingenuity_nocli-0.5.33b1}/local-tests/historianmulti/test_tagManagement.py +0 -0
- {python_eigen_ingenuity_nocli-0.5.32b3 → python_eigen_ingenuity_nocli-0.5.33b1}/local-tests/historianmulti/test_writePoints.py +0 -0
- {python_eigen_ingenuity_nocli-0.5.32b3 → python_eigen_ingenuity_nocli-0.5.33b1}/local-tests/run_tests.py +0 -0
- {python_eigen_ingenuity_nocli-0.5.32b3 → python_eigen_ingenuity_nocli-0.5.33b1}/modelbuilder/__init__.py +0 -0
- {python_eigen_ingenuity_nocli-0.5.32b3 → python_eigen_ingenuity_nocli-0.5.33b1}/modelbuilder/src/__init__.py +0 -0
- {python_eigen_ingenuity_nocli-0.5.32b3 → python_eigen_ingenuity_nocli-0.5.33b1}/modelbuilder/src/assetmodelbuilder.py +0 -0
- {python_eigen_ingenuity_nocli-0.5.32b3 → python_eigen_ingenuity_nocli-0.5.33b1}/modelbuilder/src/assetmodelcsvwriter.py +0 -0
- {python_eigen_ingenuity_nocli-0.5.32b3 → python_eigen_ingenuity_nocli-0.5.33b1}/modelbuilder/src/assetmodelutilities.py +0 -0
- {python_eigen_ingenuity_nocli-0.5.32b3 → python_eigen_ingenuity_nocli-0.5.33b1}/modelbuilder/src/configmanager.py +0 -0
- {python_eigen_ingenuity_nocli-0.5.32b3 → python_eigen_ingenuity_nocli-0.5.33b1}/modelbuilder/src/connectors/__init__.py +0 -0
- {python_eigen_ingenuity_nocli-0.5.32b3 → python_eigen_ingenuity_nocli-0.5.33b1}/modelbuilder/src/connectors/boltconnector.py +0 -0
- {python_eigen_ingenuity_nocli-0.5.32b3 → python_eigen_ingenuity_nocli-0.5.33b1}/modelbuilder/src/connectors/dbconnectors.py +0 -0
- {python_eigen_ingenuity_nocli-0.5.32b3 → python_eigen_ingenuity_nocli-0.5.33b1}/modelbuilder/src/connectors/genericconnector.py +0 -0
- {python_eigen_ingenuity_nocli-0.5.32b3 → python_eigen_ingenuity_nocli-0.5.33b1}/modelbuilder/src/connectors/httpsconnector.py +0 -0
- {python_eigen_ingenuity_nocli-0.5.32b3 → python_eigen_ingenuity_nocli-0.5.33b1}/modelbuilder/src/csvcontentsmanager.py +0 -0
- {python_eigen_ingenuity_nocli-0.5.32b3 → python_eigen_ingenuity_nocli-0.5.33b1}/modelbuilder/src/csvwriter.py +0 -0
- {python_eigen_ingenuity_nocli-0.5.32b3 → python_eigen_ingenuity_nocli-0.5.33b1}/modelbuilder/src/fileanalyser.py +0 -0
- {python_eigen_ingenuity_nocli-0.5.32b3 → python_eigen_ingenuity_nocli-0.5.33b1}/modelbuilder/src/filemanager.py +0 -0
- {python_eigen_ingenuity_nocli-0.5.32b3 → python_eigen_ingenuity_nocli-0.5.33b1}/modelbuilder/src/messages.py +0 -0
- {python_eigen_ingenuity_nocli-0.5.32b3 → python_eigen_ingenuity_nocli-0.5.33b1}/modelbuilder/src/processors/__init__.py +0 -0
- {python_eigen_ingenuity_nocli-0.5.32b3 → python_eigen_ingenuity_nocli-0.5.33b1}/modelbuilder/src/processors/cypherfileprocessor.py +0 -0
- {python_eigen_ingenuity_nocli-0.5.32b3 → python_eigen_ingenuity_nocli-0.5.33b1}/modelbuilder/src/processors/labelmanager.py +0 -0
- {python_eigen_ingenuity_nocli-0.5.32b3 → python_eigen_ingenuity_nocli-0.5.33b1}/modelbuilder/src/processors/propertymanager.py +0 -0
- {python_eigen_ingenuity_nocli-0.5.32b3 → python_eigen_ingenuity_nocli-0.5.33b1}/modelbuilder/src/processors/relationshipmanager.py +0 -0
- {python_eigen_ingenuity_nocli-0.5.32b3 → python_eigen_ingenuity_nocli-0.5.33b1}/modelbuilder/src/queries/__init__.py +0 -0
- {python_eigen_ingenuity_nocli-0.5.32b3 → python_eigen_ingenuity_nocli-0.5.33b1}/modelbuilder/src/queries/cypherbuilder.py +0 -0
- {python_eigen_ingenuity_nocli-0.5.32b3 → python_eigen_ingenuity_nocli-0.5.33b1}/modelbuilder/src/queries/query.py +0 -0
- {python_eigen_ingenuity_nocli-0.5.32b3 → python_eigen_ingenuity_nocli-0.5.33b1}/modelbuilder/src/versionmanager.py +0 -0
- {python_eigen_ingenuity_nocli-0.5.32b3 → python_eigen_ingenuity_nocli-0.5.33b1}/pyproject.toml +0 -0
- {python_eigen_ingenuity_nocli-0.5.32b3 → python_eigen_ingenuity_nocli-0.5.33b1}/python_eigen_ingenuity_nocli.egg-info/SOURCES.txt +0 -0
- {python_eigen_ingenuity_nocli-0.5.32b3 → python_eigen_ingenuity_nocli-0.5.33b1}/python_eigen_ingenuity_nocli.egg-info/dependency_links.txt +0 -0
- {python_eigen_ingenuity_nocli-0.5.32b3 → python_eigen_ingenuity_nocli-0.5.33b1}/python_eigen_ingenuity_nocli.egg-info/requires.txt +0 -0
- {python_eigen_ingenuity_nocli-0.5.32b3 → python_eigen_ingenuity_nocli-0.5.33b1}/python_eigen_ingenuity_nocli.egg-info/top_level.txt +0 -0
- {python_eigen_ingenuity_nocli-0.5.32b3 → python_eigen_ingenuity_nocli-0.5.33b1}/regressiontests/__init__.py +0 -0
- {python_eigen_ingenuity_nocli-0.5.32b3 → python_eigen_ingenuity_nocli-0.5.33b1}/regressiontests/eigeningenuity/__init__.py +0 -0
- {python_eigen_ingenuity_nocli-0.5.32b3 → python_eigen_ingenuity_nocli-0.5.33b1}/regressiontests/eigeningenuity/common.py +0 -0
- {python_eigen_ingenuity_nocli-0.5.32b3 → python_eigen_ingenuity_nocli-0.5.33b1}/regressiontests/eigeningenuity/common_multi.py +0 -0
- {python_eigen_ingenuity_nocli-0.5.32b3 → python_eigen_ingenuity_nocli-0.5.33b1}/regressiontests/eigeningenuity/historian/__init__.py +0 -0
- {python_eigen_ingenuity_nocli-0.5.32b3 → python_eigen_ingenuity_nocli-0.5.33b1}/regressiontests/eigeningenuity/historian/common.py +0 -0
- {python_eigen_ingenuity_nocli-0.5.32b3 → python_eigen_ingenuity_nocli-0.5.33b1}/regressiontests/eigeningenuity/historian/test_getCurrentDataPoints.py +0 -0
- {python_eigen_ingenuity_nocli-0.5.32b3 → python_eigen_ingenuity_nocli-0.5.33b1}/regressiontests/eigeningenuity/historian/test_getInterpolatedPoints.py +0 -0
- {python_eigen_ingenuity_nocli-0.5.32b3 → python_eigen_ingenuity_nocli-0.5.33b1}/regressiontests/eigeningenuity/historian/test_getInterpolatedRange.py +0 -0
- {python_eigen_ingenuity_nocli-0.5.32b3 → python_eigen_ingenuity_nocli-0.5.33b1}/regressiontests/eigeningenuity/historian/test_getMetaData.py +0 -0
- {python_eigen_ingenuity_nocli-0.5.32b3 → python_eigen_ingenuity_nocli-0.5.33b1}/regressiontests/eigeningenuity/historian/test_getRawDataPoints.py +0 -0
- {python_eigen_ingenuity_nocli-0.5.32b3 → python_eigen_ingenuity_nocli-0.5.33b1}/regressiontests/eigeningenuity/historian/test_listDataTags.py +0 -0
- {python_eigen_ingenuity_nocli-0.5.32b3 → python_eigen_ingenuity_nocli-0.5.33b1}/regressiontests/eigeningenuity/historian/test_writePoints.py +0 -0
- {python_eigen_ingenuity_nocli-0.5.32b3 → python_eigen_ingenuity_nocli-0.5.33b1}/regressiontests/eigeningenuity/historian-multi/__init__.py +0 -0
- {python_eigen_ingenuity_nocli-0.5.32b3 → python_eigen_ingenuity_nocli-0.5.33b1}/regressiontests/eigeningenuity/historian-multi/common_multi.py +0 -0
- {python_eigen_ingenuity_nocli-0.5.32b3 → python_eigen_ingenuity_nocli-0.5.33b1}/regressiontests/eigeningenuity/historian-multi/test_getClosestRawPoint.py +0 -0
- {python_eigen_ingenuity_nocli-0.5.32b3 → python_eigen_ingenuity_nocli-0.5.33b1}/regressiontests/eigeningenuity/historian-multi/test_getCurrentDataPoints.py +0 -0
- {python_eigen_ingenuity_nocli-0.5.32b3 → python_eigen_ingenuity_nocli-0.5.33b1}/regressiontests/eigeningenuity/historian-multi/test_getInterpolatedPoints.py +0 -0
- {python_eigen_ingenuity_nocli-0.5.32b3 → python_eigen_ingenuity_nocli-0.5.33b1}/regressiontests/eigeningenuity/historian-multi/test_getInterpolatedRange.py +0 -0
- {python_eigen_ingenuity_nocli-0.5.32b3 → python_eigen_ingenuity_nocli-0.5.33b1}/regressiontests/eigeningenuity/historian-multi/test_getMetaData.py +0 -0
- {python_eigen_ingenuity_nocli-0.5.32b3 → python_eigen_ingenuity_nocli-0.5.33b1}/regressiontests/eigeningenuity/historian-multi/test_getRawDatapoints.py +0 -0
- {python_eigen_ingenuity_nocli-0.5.32b3 → python_eigen_ingenuity_nocli-0.5.33b1}/regressiontests/eigeningenuity/historian-multi/test_listDataTags.py +0 -0
- {python_eigen_ingenuity_nocli-0.5.32b3 → python_eigen_ingenuity_nocli-0.5.33b1}/regressiontests/eigeningenuity/historian-multi/test_tagManagement.py +0 -0
- {python_eigen_ingenuity_nocli-0.5.32b3 → python_eigen_ingenuity_nocli-0.5.33b1}/regressiontests/eigeningenuity/historian-multi/test_writePoints.py +0 -0
- {python_eigen_ingenuity_nocli-0.5.32b3 → python_eigen_ingenuity_nocli-0.5.33b1}/requirements.txt +0 -0
- {python_eigen_ingenuity_nocli-0.5.32b3 → python_eigen_ingenuity_nocli-0.5.33b1}/setup.cfg +0 -0
- {python_eigen_ingenuity_nocli-0.5.32b3 → python_eigen_ingenuity_nocli-0.5.33b1}/setup.py +0 -0
|
@@ -80,45 +80,61 @@ class NodeFileProcessor:
|
|
|
80
80
|
# Split out those properties that are dependent on others, so that we can add them in the right order
|
|
81
81
|
explicit_properties, calculated_properties = pm.split_out_functional_properties(properties)
|
|
82
82
|
|
|
83
|
-
param_explicit_props = self.query_manager.parameterise_dict(explicit_properties, self.section)
|
|
84
|
-
param_calc_props = self.query_manager.parameterise_dict(calculated_properties, self.section)
|
|
85
83
|
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
84
|
+
# Can put this code here (potentially faster) but with less error checking
|
|
85
|
+
# Or leave it inside the for loop
|
|
86
|
+
|
|
87
|
+
# param_explicit_props = self.query_manager.parameterise_property_dict(explicit_properties, self.section)
|
|
88
|
+
# param_calc_props = self.query_manager.parameterise_property_dict(calculated_properties, self.section)
|
|
89
|
+
# param_properties = []
|
|
90
|
+
# num_param_properties = max(len(param_explicit_props), len(param_calc_props))
|
|
91
|
+
# for count in range(num_param_properties):
|
|
92
|
+
# param_properties += [[param_explicit_props[min(count, len(param_explicit_props) - 1)], param_calc_props[min(count, len(param_calc_props) - 1)]]]
|
|
89
93
|
|
|
90
94
|
for primary_property in self.contents.get_property_values_list(this_row, node_columns, self.primary_property, allow_split=True, override_format='str'):
|
|
95
|
+
primary_property_dict = {primary_property.key: primary_property}
|
|
96
|
+
param_primary_props = self.query_manager.parameterise_property_dict(primary_property_dict, self.section)
|
|
97
|
+
|
|
98
|
+
# The next chunk could be moved outside the primary_property loop to be more performant if (a big if) there are multiple node columns (which is very unusual)
|
|
99
|
+
# The downside is that some parameter error checking is lost
|
|
100
|
+
# If the code is moved, remove the last parameter in the first two calls since we won't know it above
|
|
101
|
+
param_explicit_props = self.query_manager.parameterise_property_dict(explicit_properties, self.section, len(param_primary_props))
|
|
102
|
+
param_calc_props = self.query_manager.parameterise_property_dict(calculated_properties, self.section, len(param_primary_props))
|
|
103
|
+
param_properties = []
|
|
104
|
+
num_param_properties = max(len(param_explicit_props), len(param_calc_props))
|
|
105
|
+
for count in range(num_param_properties):
|
|
106
|
+
param_properties += [[param_explicit_props[min(count, len(param_explicit_props) - 1)], param_calc_props[min(count, len(param_calc_props) - 1)]]]
|
|
107
|
+
|
|
91
108
|
time_now = amu.get_formatted_time_now()
|
|
92
109
|
merge_labels, new_labels, remove_labels = lm.sort_node_labels(self.required_labels, validated_csv_labels)
|
|
93
110
|
node_labels = lm.merge_node_labels(merge_labels, primary_property.labels)
|
|
94
|
-
node_labels = lm.merge_node_labels(node_labels, new_labels)
|
|
95
|
-
|
|
111
|
+
# node_labels = lm.merge_node_labels(node_labels, new_labels)
|
|
112
|
+
for prop_counter in range(len(param_primary_props)):
|
|
96
113
|
# Build a simple MERGE query using queries
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
114
|
+
query_text = (QueryBuilder()
|
|
115
|
+
.merge()
|
|
116
|
+
.node(labels=node_labels, ref_name=property_ref, properties=param_primary_props[prop_counter])
|
|
117
|
+
)
|
|
101
118
|
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
if len(remove_labels) > 0:
|
|
114
|
-
query_text = query_text.remove_literal(f'{property_ref}:{":".join(remove_labels)}')
|
|
119
|
+
# Add in System properties if required
|
|
120
|
+
if self.add_system_properties:
|
|
121
|
+
new_uuid = str(uuid.uuid4())
|
|
122
|
+
create_time = property_ref_dot + self.creation_time_property + '=datetime("' + time_now + '")'
|
|
123
|
+
id_property = property_ref_dot + self.unique_id_property
|
|
124
|
+
update_id = id_property + '= CASE WHEN ' + id_property + ' IS null THEN "' + new_uuid + '" ELSE ' + id_property + ' END,' +\
|
|
125
|
+
property_ref_dot + self.update_time_property + '=datetime("' + time_now + '")'
|
|
126
|
+
query_text = query_text.on_create().set_literal(create_time).set_literal(update_id)
|
|
127
|
+
|
|
128
|
+
if len(remove_labels) > 0:
|
|
129
|
+
query_text = query_text.remove_literal(f'{property_ref}:{":".join(remove_labels)}')
|
|
115
130
|
|
|
116
|
-
for props in param_properties:
|
|
117
131
|
query_text_param = query_text
|
|
118
|
-
param_explicit =
|
|
132
|
+
param_explicit = param_properties[min(prop_counter, num_param_properties-1)][0]
|
|
133
|
+
if len(new_labels) > 0:
|
|
134
|
+
query_text_param = query_text.set_labels(ref_name=property_ref, labels=new_labels)
|
|
119
135
|
if len(param_explicit) > 0:
|
|
120
136
|
query_text_param = query_text_param.set(properties=param_explicit, property_ref=property_ref_dot)
|
|
121
|
-
param_calc =
|
|
137
|
+
param_calc = param_properties[min(prop_counter, num_param_properties-1)][1]
|
|
122
138
|
if len(param_calc) > 0:
|
|
123
139
|
query_text_param = query_text_param.set(properties=param_calc, property_ref=property_ref_dot)
|
|
124
140
|
|
|
@@ -180,15 +196,15 @@ class NodeFileProcessor:
|
|
|
180
196
|
temp = properties.pop(unwanted, None)
|
|
181
197
|
|
|
182
198
|
primary_property_dict = {primary_property.key: primary_property}
|
|
183
|
-
all_properties = pm.combine_properties(properties, primary_property_dict)
|
|
184
199
|
|
|
185
|
-
explicit_properties, calculated_properties = pm.split_out_functional_properties(
|
|
186
|
-
|
|
187
|
-
|
|
200
|
+
explicit_properties, calculated_properties = pm.split_out_functional_properties(properties)
|
|
201
|
+
param_primary_props = self.query_manager.parameterise_property_dict(primary_property_dict, self.section)
|
|
202
|
+
param_explicit_props = self.query_manager.parameterise_property_dict(explicit_properties, self.section, len(param_primary_props))
|
|
203
|
+
param_calc_props = self.query_manager.parameterise_property_dict(calculated_properties, self.section, len(param_primary_props))
|
|
188
204
|
|
|
189
205
|
query_data_list = []
|
|
190
|
-
for
|
|
191
|
-
query_data_list += [[param_explicit_props[min(
|
|
206
|
+
for node_count in range(len(param_primary_props)):
|
|
207
|
+
query_data_list += [[pm.combine_properties(param_explicit_props[min(node_count, len(param_explicit_props)-1)], param_primary_props[node_count]), param_calc_props[min(node_count, len(param_calc_props)-1)], time_now]]
|
|
192
208
|
|
|
193
209
|
# So now we know all about this particular update. Let's put it in the query dictionary
|
|
194
210
|
# We'll group these by unique combinations of labels and primary key type
|
|
@@ -243,18 +259,20 @@ class NodeFileProcessor:
|
|
|
243
259
|
property_count += len(a_payload)*len(formatted_pload)
|
|
244
260
|
|
|
245
261
|
# Build a MERGE query using queries
|
|
246
|
-
merge_labels =
|
|
262
|
+
merge_labels = batch_keys[new_labels][1]
|
|
263
|
+
# merge_labels = lm.merge_node_labels(batch_keys[new_labels][1], batch_keys[new_labels][0])
|
|
247
264
|
remove_labels = batch_keys[new_labels][2]
|
|
248
265
|
primary_property = batch_keys[new_labels][3][0]
|
|
249
266
|
query_text = (QueryBuilder()
|
|
250
267
|
.unwind_list_as(formatted_payload, payload_ref)
|
|
251
268
|
.merge()
|
|
252
|
-
.node_batch(labels=merge_labels, ref_name=property_ref, properties=primary_property+':'+payload_ref_dot+primary_property)
|
|
269
|
+
# .node_batch(labels=merge_labels, ref_name=property_ref, properties=primary_property+':'+payload_ref_dot+primary_property)
|
|
270
|
+
.node_batch(labels=list(set(merge_labels)), ref_name=property_ref, properties=primary_property + ':' + payload_ref_dot + primary_property)
|
|
253
271
|
.set_literal(property_ref + ' += ' + payload_ref)
|
|
254
272
|
)
|
|
255
273
|
|
|
256
|
-
|
|
257
|
-
|
|
274
|
+
if batch_keys[new_labels][0]:
|
|
275
|
+
query_text = query_text.set_labels(ref_name=property_ref, labels=batch_keys[new_labels][0])
|
|
258
276
|
if len(remove_labels) > 0:
|
|
259
277
|
query_text = query_text.remove_literal(f'{property_ref}:{":".join(remove_labels)}')
|
|
260
278
|
if func_properties:
|
|
@@ -94,17 +94,17 @@ class RelationshipFileProcessor:
|
|
|
94
94
|
|
|
95
95
|
# Split out those properties that are dependent on others, so that we can add them in the right order
|
|
96
96
|
explicit_properties, calculated_properties = pm.split_out_functional_properties(properties)
|
|
97
|
-
param_explicit_props = self.query_manager.
|
|
98
|
-
param_calc_props = self.query_manager.
|
|
97
|
+
param_explicit_props = self.query_manager.parameterise_property_dict(explicit_properties, self.section)
|
|
98
|
+
param_calc_props = self.query_manager.parameterise_property_dict(calculated_properties, self.section)
|
|
99
99
|
|
|
100
100
|
# If there are multiple From or To nodes, create a relationship query for each combination
|
|
101
101
|
for from_node in self.contents.get_property_values_list(this_row, from_columns, self.primary_property, self.from_property, override_format='str'):
|
|
102
|
-
param_from_nodes = self.query_manager.
|
|
102
|
+
param_from_nodes = self.query_manager.parameterise_property_dict({'from_node': from_node}, self.section)
|
|
103
103
|
validated_csv_from_labels = lm.validate_labels(self.contents.get_column_values_list(this_row, from_label_columns))
|
|
104
104
|
from_labels = lm.sort_relationship_labels(self.required_labels + self.from_required_labels, validated_csv_from_labels)
|
|
105
105
|
from_node_labels = lm.merge_node_labels(from_labels, from_node.labels)
|
|
106
106
|
for to_node in self.contents.get_property_values_list(this_row, to_columns, self.primary_property, self.to_property, override_format='str'):
|
|
107
|
-
param_to_nodes = self.query_manager.
|
|
107
|
+
param_to_nodes = self.query_manager.parameterise_property_dict({'to_node': to_node}, self.section)
|
|
108
108
|
validated_csv_to_labels = lm.validate_labels(self.contents.get_column_values_list(this_row, to_label_columns))
|
|
109
109
|
to_labels = lm.sort_relationship_labels(self.required_labels + self.to_required_labels, validated_csv_to_labels)
|
|
110
110
|
to_node_labels = lm.merge_node_labels(to_labels, to_node.labels)
|
|
@@ -115,8 +115,11 @@ class RelationshipFileProcessor:
|
|
|
115
115
|
if relation:
|
|
116
116
|
|
|
117
117
|
param_properties = []
|
|
118
|
-
for
|
|
119
|
-
|
|
118
|
+
for from_count in range(len(param_from_nodes)):
|
|
119
|
+
for to_count in range(len(param_to_nodes)):
|
|
120
|
+
for explicit_count in range(len(param_explicit_props)):
|
|
121
|
+
for calc_count in range(len(param_calc_props)):
|
|
122
|
+
param_properties += [[param_from_nodes[from_count], param_to_nodes[to_count], param_explicit_props[explicit_count], param_calc_props[calc_count]]]
|
|
120
123
|
|
|
121
124
|
time_now = amu.get_formatted_time_now()
|
|
122
125
|
for props in param_properties:
|
|
@@ -217,16 +220,19 @@ class RelationshipFileProcessor:
|
|
|
217
220
|
|
|
218
221
|
explicit_properties, calculated_properties = pm.split_out_functional_properties(properties)
|
|
219
222
|
|
|
220
|
-
param_from_nodes = self.query_manager.
|
|
221
|
-
param_to_nodes = self.query_manager.
|
|
222
|
-
param_explicit_props = self.query_manager.
|
|
223
|
-
param_calc_props = self.query_manager.
|
|
223
|
+
param_from_nodes = self.query_manager.parameterise_property_dict({'from_node': from_node}, self.section)
|
|
224
|
+
param_to_nodes = self.query_manager.parameterise_property_dict({'to_node': to_node}, self.section)
|
|
225
|
+
param_explicit_props = self.query_manager.parameterise_property_dict(explicit_properties, self.section)
|
|
226
|
+
param_calc_props = self.query_manager.parameterise_property_dict(calculated_properties, self.section)
|
|
224
227
|
|
|
225
228
|
new_labels_list = []
|
|
226
229
|
query_data_list = []
|
|
227
|
-
for
|
|
228
|
-
|
|
229
|
-
|
|
230
|
+
for from_count in range(len(param_from_nodes)):
|
|
231
|
+
for to_count in range(len(param_to_nodes)):
|
|
232
|
+
for explicit_count in range(len(param_explicit_props)):
|
|
233
|
+
for calc_count in range(len(param_calc_props)):
|
|
234
|
+
new_labels_list += [[from_node_labels, to_node_labels, relation, from_node.key, to_node.key, param_calc_props[calc_count]]]
|
|
235
|
+
query_data_list += [[param_from_nodes[from_count]['from_node'].value.replace('\\\\n', '\n'), param_to_nodes[to_count]['to_node'].value.replace('\\\\n', '\n'), param_explicit_props[explicit_count], param_calc_props[calc_count], time_now]]
|
|
230
236
|
|
|
231
237
|
# So now we know all about this particular update. Let's put it in the query dictionary
|
|
232
238
|
q_count = 0
|
|
@@ -7,9 +7,7 @@ import processors.propertymanager as pm
|
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
class Neo4jProperty:
|
|
10
|
-
def __init__(
|
|
11
|
-
self, key, value=None, format=None, type=None, blank_override=False, labels=[]
|
|
12
|
-
):
|
|
10
|
+
def __init__(self, key, value=None, format=None, type=None, blank_override=False, labels=[]):
|
|
13
11
|
|
|
14
12
|
self.key = pm.validate_property(key)
|
|
15
13
|
# Sanitise the value
|
|
@@ -35,11 +33,11 @@ class Neo4jProperty:
|
|
|
35
33
|
|
|
36
34
|
# Now check to see if the value might be a formula
|
|
37
35
|
if "{" in self.value or "}" in self.value:
|
|
38
|
-
self.formula, self.is_formula, self.
|
|
36
|
+
self.formula, self.is_formula, self.parameter_names = parse_value(value, "n.")
|
|
39
37
|
else:
|
|
40
38
|
self.formula = None
|
|
41
39
|
self.is_formula = False
|
|
42
|
-
self.
|
|
40
|
+
self.parameter_names = []
|
|
43
41
|
|
|
44
42
|
def set_format(self, new_format):
|
|
45
43
|
# If the format has changed, update it (otherwise, no need to do anything)
|
|
@@ -55,11 +53,11 @@ class Neo4jProperty:
|
|
|
55
53
|
# And say the value hasn't been formatted using the new format
|
|
56
54
|
self.formatted_values = {}
|
|
57
55
|
if "{" in self.value or "}" in self.value:
|
|
58
|
-
self.formula, self.is_formula, self.
|
|
56
|
+
self.formula, self.is_formula, self.parameter_names = parse_value(new_value, "n.")
|
|
59
57
|
else:
|
|
60
58
|
self.formula = None
|
|
61
59
|
self.is_formula = False
|
|
62
|
-
self.
|
|
60
|
+
self.parameter_names = []
|
|
63
61
|
|
|
64
62
|
def get_value(self, ref):
|
|
65
63
|
# Check to see if we have a formatted value, and if not do it now
|
|
@@ -122,7 +120,7 @@ def format_value(self, ref):
|
|
|
122
120
|
|
|
123
121
|
# Handle formulas
|
|
124
122
|
if self.is_formula and ref != "n.":
|
|
125
|
-
self.formula, self.is_formula, self.
|
|
123
|
+
self.formula, self.is_formula, self.parameter_names = parse_value(value, ref)
|
|
126
124
|
formula = self.formula
|
|
127
125
|
|
|
128
126
|
if self.is_formula and formula != "":
|
|
@@ -237,7 +235,7 @@ def parse_value(formula, ref):
|
|
|
237
235
|
parsed = ""
|
|
238
236
|
index = 0
|
|
239
237
|
open = False
|
|
240
|
-
|
|
238
|
+
param_name = []
|
|
241
239
|
property_name = ""
|
|
242
240
|
while index < len(formula):
|
|
243
241
|
this_char = formula[index]
|
|
@@ -257,7 +255,7 @@ def parse_value(formula, ref):
|
|
|
257
255
|
end_parm = formula[index + 1:].find("}")
|
|
258
256
|
if end_parm >= 0:
|
|
259
257
|
parsed += formula[index: index + end_parm + 2]
|
|
260
|
-
|
|
258
|
+
param_name += [formula[index + 2: index + end_parm + 1]]
|
|
261
259
|
index += end_parm + 1
|
|
262
260
|
else:
|
|
263
261
|
parsed += this_char
|
|
@@ -287,7 +285,7 @@ def parse_value(formula, ref):
|
|
|
287
285
|
|
|
288
286
|
is_formula = (num_open == num_close) and (num_open > 0)
|
|
289
287
|
|
|
290
|
-
return parsed.strip(), is_formula,
|
|
288
|
+
return parsed.strip(), is_formula, param_name
|
|
291
289
|
|
|
292
290
|
|
|
293
291
|
def try_date_format(date, date_format):
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import copy
|
|
2
|
+
import messages
|
|
3
|
+
|
|
4
|
+
class QueryManager():
|
|
5
|
+
|
|
6
|
+
def __init__(self, parameters):
|
|
7
|
+
self.parameters = parameters
|
|
8
|
+
|
|
9
|
+
def parameterise_property_dict(self, properties, section, num_nodes=0):
|
|
10
|
+
|
|
11
|
+
paramed_data = [properties]
|
|
12
|
+
if self.parameters:
|
|
13
|
+
|
|
14
|
+
params = self.parameters[section]
|
|
15
|
+
params_found = []
|
|
16
|
+
param_names = {}
|
|
17
|
+
param_count = []
|
|
18
|
+
max_params = 0
|
|
19
|
+
|
|
20
|
+
for property in properties:
|
|
21
|
+
for param_name in properties[property].parameter_names:
|
|
22
|
+
if param_name not in params_found:
|
|
23
|
+
params_found += [param_name]
|
|
24
|
+
num_values = len(params[param_name])
|
|
25
|
+
param_count += [num_values]
|
|
26
|
+
if num_nodes > 0 and num_values != 1:
|
|
27
|
+
if num_values != num_nodes:
|
|
28
|
+
messages.warning_message(f'{num_values} values found for ${{{param_name}}}, should have {num_nodes}')
|
|
29
|
+
max_params = max(max_params, len(params[param_name]))
|
|
30
|
+
if param_name in param_names:
|
|
31
|
+
param_names[param_name] += [property]
|
|
32
|
+
else:
|
|
33
|
+
param_names[param_name] = [property]
|
|
34
|
+
|
|
35
|
+
param_count_check = list(set(param_count + [1]))
|
|
36
|
+
if len(param_count_check) > 2:
|
|
37
|
+
messages.warning_message('Inconsistent parameter counts found')
|
|
38
|
+
|
|
39
|
+
if params_found:
|
|
40
|
+
next_list = []
|
|
41
|
+
for param_num in range(max_params):
|
|
42
|
+
this_list = [copy.deepcopy(properties)]
|
|
43
|
+
for param in param_names:
|
|
44
|
+
param_id = '${' + param + '}'
|
|
45
|
+
|
|
46
|
+
# If parameters aren't configured correctly, this can error so use nothing instead
|
|
47
|
+
try:
|
|
48
|
+
new_val = params[param][min(param_num, len(params[param])-1)]
|
|
49
|
+
except:
|
|
50
|
+
new_val = ""
|
|
51
|
+
|
|
52
|
+
for prop_list in this_list:
|
|
53
|
+
updated_data = prop_list
|
|
54
|
+
|
|
55
|
+
for prop in updated_data:
|
|
56
|
+
new_value = updated_data[prop].value.replace(param_id, new_val)
|
|
57
|
+
updated_data[prop].set_value(new_value)
|
|
58
|
+
|
|
59
|
+
next_list += [updated_data]
|
|
60
|
+
|
|
61
|
+
paramed_data = next_list
|
|
62
|
+
|
|
63
|
+
return paramed_data
|
|
64
|
+
|
|
@@ -1,98 +0,0 @@
|
|
|
1
|
-
import copy
|
|
2
|
-
|
|
3
|
-
class QueryManager():
|
|
4
|
-
|
|
5
|
-
def __init__(self, parameters):
|
|
6
|
-
self.parameters = parameters
|
|
7
|
-
|
|
8
|
-
def parameterise(self, query_text, section):
|
|
9
|
-
if self.parameters:
|
|
10
|
-
query_list = []
|
|
11
|
-
|
|
12
|
-
for parm, values in self.parameters[section].items():
|
|
13
|
-
parm_name = '${'+str(parm)+'}'
|
|
14
|
-
if parm_name in query_text:
|
|
15
|
-
for v in values:
|
|
16
|
-
new_query = query_text.replace(parm_name, v)
|
|
17
|
-
query_list.append(new_query)
|
|
18
|
-
|
|
19
|
-
if query_list == []:
|
|
20
|
-
query_list = [query_text]
|
|
21
|
-
|
|
22
|
-
else:
|
|
23
|
-
query_list = [query_text]
|
|
24
|
-
|
|
25
|
-
return query_list
|
|
26
|
-
|
|
27
|
-
def parameterise_dict(self, data, section):
|
|
28
|
-
if self.parameters:
|
|
29
|
-
|
|
30
|
-
params = self.parameters[section]
|
|
31
|
-
params_found = []
|
|
32
|
-
param_num = -1
|
|
33
|
-
|
|
34
|
-
for d in data:
|
|
35
|
-
if data[d].parameter_number != -1:
|
|
36
|
-
params_found.append(d)
|
|
37
|
-
param_num = data[d].parameter_number
|
|
38
|
-
|
|
39
|
-
if params_found and param_num in params:
|
|
40
|
-
params_to_use = params[param_num]
|
|
41
|
-
num_params = len(params_to_use)
|
|
42
|
-
param_id = '${'+param_num+'}'
|
|
43
|
-
|
|
44
|
-
new_data = []
|
|
45
|
-
for count in range(num_params):
|
|
46
|
-
this_one = {}
|
|
47
|
-
for k, v in data.items():
|
|
48
|
-
if k in params_found:
|
|
49
|
-
new_value = data[k].value.replace(param_id, params_to_use[count])
|
|
50
|
-
new_prop = copy.deepcopy(data[k])
|
|
51
|
-
new_prop.set_value(new_value)
|
|
52
|
-
this_one[k] = new_prop
|
|
53
|
-
else:
|
|
54
|
-
this_one[k] = copy.deepcopy(data[k])
|
|
55
|
-
new_data += [this_one]
|
|
56
|
-
else:
|
|
57
|
-
new_data = [data]
|
|
58
|
-
else:
|
|
59
|
-
new_data = [data]
|
|
60
|
-
|
|
61
|
-
return new_data
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
def parameterise_list(self, prop_data, section):
|
|
65
|
-
if self.parameters:
|
|
66
|
-
|
|
67
|
-
params = self.parameters[section]
|
|
68
|
-
params_found = []
|
|
69
|
-
param_num = -1
|
|
70
|
-
|
|
71
|
-
for prop in prop_data:
|
|
72
|
-
if prop.parameter_number != -1:
|
|
73
|
-
params_found.append(prop.key)
|
|
74
|
-
param_num = prop.parameter_number
|
|
75
|
-
|
|
76
|
-
if params_found:
|
|
77
|
-
params_to_use = params[param_num]
|
|
78
|
-
num_params = len(params_to_use)
|
|
79
|
-
param_id = '${' + param_num + '}'
|
|
80
|
-
|
|
81
|
-
new_data = []
|
|
82
|
-
for count in range(num_params):
|
|
83
|
-
this_one = []
|
|
84
|
-
for prop in prop_data:
|
|
85
|
-
if prop.key in params_found:
|
|
86
|
-
new_value = prop.value.replace(param_id, params_to_use[count])
|
|
87
|
-
new_prop = copy.deepcopy(prop)
|
|
88
|
-
new_prop.set_value(new_value)
|
|
89
|
-
this_one.append(new_prop)
|
|
90
|
-
else:
|
|
91
|
-
this_one.append(copy.deepcopy(prop))
|
|
92
|
-
new_data.append(this_one[0])
|
|
93
|
-
else:
|
|
94
|
-
new_data = prop_data
|
|
95
|
-
else:
|
|
96
|
-
new_data = prop_data
|
|
97
|
-
|
|
98
|
-
return new_data
|
|
File without changes
|
{python_eigen_ingenuity_nocli-0.5.32b3 → python_eigen_ingenuity_nocli-0.5.33b1}/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.32b3 → python_eigen_ingenuity_nocli-0.5.33b1}/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.32b3 → python_eigen_ingenuity_nocli-0.5.33b1}/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.32b3 → python_eigen_ingenuity_nocli-0.5.33b1}/requirements.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|