cognite-neat 0.123.9__py3-none-any.whl → 0.123.11__py3-none-any.whl

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.

Potentially problematic release.


This version of cognite-neat might be problematic. Click here for more details.

cognite/neat/_version.py CHANGED
@@ -1,2 +1,2 @@
1
- __version__ = "0.123.9"
1
+ __version__ = "0.123.11"
2
2
  __engine__ = "^2.0.4"
@@ -111,12 +111,8 @@ PHYSICAL_PROPERTY_ID_COMPLIANCE_REGEX = (
111
111
  rf"(?!^({'|'.join(get_reserved_words('property'))})$)"
112
112
  r"(^[a-zA-Z][a-zA-Z0-9_]{0,253}[a-zA-Z0-9]?$)"
113
113
  )
114
- CONCEPT_ID_COMPLIANCE_REGEX = (
115
- rf"(?!^({'|'.join(get_reserved_words('concept'))})$)"
116
- r"(^[a-zA-Z0-9._-]{0,253}[a-zA-Z0-9]?$)"
117
- )
114
+ CONCEPT_ID_COMPLIANCE_REGEX = r"^[a-zA-Z0-9._~?@!$&'*+,;=%-]+$"
118
115
 
119
- INFORMATION_PROPERTY_ID_COMPLIANCE_REGEX = r"^(\*)|(?!^(Property|property)$)(^[a-zA-Z0-9._-]{0,253}[a-zA-Z0-9]?$)"
120
116
  VERSION_COMPLIANCE_REGEX = r"^[a-zA-Z0-9]([.a-zA-Z0-9_-]{0,41}[a-zA-Z0-9])?$"
121
117
 
122
118
 
@@ -156,7 +152,7 @@ class _Patterns:
156
152
 
157
153
  @cached_property
158
154
  def conceptual_property_id_compliance(self) -> re.Pattern[str]:
159
- return re.compile(INFORMATION_PROPERTY_ID_COMPLIANCE_REGEX)
155
+ return re.compile(CONCEPT_ID_COMPLIANCE_REGEX)
160
156
 
161
157
  @cached_property
162
158
  def version_compliance(self) -> re.Pattern[str]:
@@ -1,4 +1,5 @@
1
1
  from typing import cast
2
+ from urllib.parse import quote
2
3
 
3
4
  from rdflib import BNode, Graph
4
5
  from rdflib.plugins.sparql import prepareQuery
@@ -33,6 +34,9 @@ def parse_concepts(graph: Graph, query: str, language: str, issue_list: IssueLis
33
34
  res: dict = convert_rdflib_content(cast(ResultRow, raw).asdict(), True)
34
35
  res = {key: res.get(key, None) for key in expected_keys}
35
36
 
37
+ # Quote the concept id to ensure it is web-safe
38
+ res["concept"] = quote(res["concept"], safe="")
39
+
36
40
  concept_id = res["concept"]
37
41
 
38
42
  # Safeguarding against incomplete semantic definitions
@@ -91,6 +95,8 @@ def parse_properties(graph: Graph, query: str, language: str, issue_list: IssueL
91
95
  res: dict = convert_rdflib_content(cast(ResultRow, raw).asdict(), True)
92
96
  res = {key: res.get(key, None) for key in expected_keys}
93
97
 
98
+ # Quote the concept id to ensure it is web-safe
99
+ res["property_"] = quote(res["property_"], safe="")
94
100
  property_id = res["property_"]
95
101
 
96
102
  # Safeguarding against incomplete semantic definitions
@@ -115,6 +121,10 @@ def parse_properties(graph: Graph, query: str, language: str, issue_list: IssueL
115
121
  )
116
122
  continue
117
123
 
124
+ # Quote the concept and value_type to ensure they are web-safe
125
+ res["concept"] = quote(res["concept"], safe="")
126
+ res["value_type"] = quote(res["value_type"], safe="")
127
+
118
128
  id_ = f"{res['concept']}.{res['property_']}"
119
129
 
120
130
  if id_ not in properties:
@@ -46,7 +46,7 @@ class ConceptualValidation:
46
46
  self._parent_concept_defined()
47
47
  self._referenced_classes_exist()
48
48
  self._referenced_value_types_exist()
49
- self._regex_compliance_with_dms()
49
+ self._regex_compliance_with_physical_data_model()
50
50
 
51
51
  return self.issue_list
52
52
 
@@ -180,7 +180,7 @@ class ConceptualValidation:
180
180
  )
181
181
  )
182
182
 
183
- def _regex_compliance_with_dms(self) -> None:
183
+ def _regex_compliance_with_physical_data_model(self) -> None:
184
184
  """Check regex compliance with DMS of properties, classes and value types."""
185
185
 
186
186
  for prop_ in self._properties:
@@ -239,7 +239,7 @@ class ConceptualValidation:
239
239
  ResourceRegexViolationWarning(
240
240
  concepts.concept,
241
241
  "Concept",
242
- "Concepts sheet, Class column",
242
+ "Concepts sheet, Concept column",
243
243
  PATTERNS.view_id_compliance.pattern,
244
244
  )
245
245
  )
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: cognite-neat
3
- Version: 0.123.9
3
+ Version: 0.123.11
4
4
  Summary: Knowledge graph transformation
5
5
  Project-URL: Documentation, https://cognite-neat.readthedocs-hosted.com/
6
6
  Project-URL: Homepage, https://cognite-neat.readthedocs-hosted.com/
@@ -1,5 +1,5 @@
1
1
  cognite/neat/__init__.py,sha256=12StS1dzH9_MElqxGvLWrNsxCJl9Hv8A2a9D0E5OD_U,193
2
- cognite/neat/_version.py,sha256=h32Sv1EmkYC85nKDtZr64pAxByiI51UB5Eq3OgONgVE,46
2
+ cognite/neat/_version.py,sha256=ozgwvgQNREIJNB1572G0X8P8ElNIjgvEBuwPMdpxGsY,47
3
3
  cognite/neat/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
4
4
  cognite/neat/core/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
5
5
  cognite/neat/core/_config.py,sha256=WT1BS8uADcFvGoUYOOfwFOVq_VBl472TisdoA3wLick,280
@@ -19,7 +19,7 @@ cognite/neat/core/_client/data_classes/neat_sequence.py,sha256=QZWSfWnwk6KlYJvsI
19
19
  cognite/neat/core/_client/data_classes/schema.py,sha256=SpkBGbC2SUJG38Ixf1vYJINI66i_OZaT03q4XKRtK54,25067
20
20
  cognite/neat/core/_client/data_classes/statistics.py,sha256=GU-u41cOTig0Y5pYhW5KqzCsuAUIX9tOmdizMEveYuw,4487
21
21
  cognite/neat/core/_data_model/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
22
- cognite/neat/core/_data_model/_constants.py,sha256=h6jfkE4tr-POO7C_L4SxcffbwHj53mb-CEo08l8RcwY,6058
22
+ cognite/neat/core/_data_model/_constants.py,sha256=ssiOprhd4bamglQnLTNjmqYn9mCBW-VOUbn08qDBbsM,5857
23
23
  cognite/neat/core/_data_model/_shared.py,sha256=gLEEMofI9prZLRNjHpwQe0uX9WoKd5qUt5pT1i_KAYo,2072
24
24
  cognite/neat/core/_data_model/analysis/__init__.py,sha256=v3hSfz7AEEqcmdjL71I09tP8Hl-gPZYOiDYMp_CW4vg,70
25
25
  cognite/neat/core/_data_model/analysis/_base.py,sha256=baqgY-66zOUxw8s-PA1KGAOs2R1gJDAo2UWWc8LlHGU,24257
@@ -44,7 +44,7 @@ cognite/neat/core/_data_model/importers/_rdf/__init__.py,sha256=1yOjV2PKCxwH7uCT
44
44
  cognite/neat/core/_data_model/importers/_rdf/_base.py,sha256=FKceKumKmhEGpMZvo1BwEewnUvfAsTF3Ax9fo1nxsGE,6020
45
45
  cognite/neat/core/_data_model/importers/_rdf/_inference2rdata_model.py,sha256=PCgM9-qGSLlupN7tYCFLHjivgICtMiahNry1ub8JCYk,28934
46
46
  cognite/neat/core/_data_model/importers/_rdf/_owl2data_model.py,sha256=WmncZNpELeZnt6mdw6X8yWnr7XsFXZGfoVe5wTd0HH4,3438
47
- cognite/neat/core/_data_model/importers/_rdf/_shared.py,sha256=yB4BkupiPhizWSHNKdaspj3xE_6pKDiNG-_IHtTN1gI,5961
47
+ cognite/neat/core/_data_model/importers/_rdf/_shared.py,sha256=KJz4HirSpWBXsOw8YGBJh-6Yj_pBjrMB9_K8UQ00sQg,6411
48
48
  cognite/neat/core/_data_model/models/__init__.py,sha256=hmF7MDR1XmpLxYdMkOEuPuHUqOQKE4AgsuUqdc-ySSQ,1249
49
49
  cognite/neat/core/_data_model/models/_base_unverified.py,sha256=1Wfbp-tJaEF6hd1bFdp2FhTgPkInf-1ZokuEoVJRPxQ,6842
50
50
  cognite/neat/core/_data_model/models/_base_verified.py,sha256=nzPrlj7ZvYull_Fdh2zeDXz98hux-eQOdTGy9jhUtYA,15127
@@ -52,7 +52,7 @@ cognite/neat/core/_data_model/models/_types.py,sha256=70E8fiLdZkVF2sDUGPuDhzXNA5
52
52
  cognite/neat/core/_data_model/models/data_types.py,sha256=uQ_u9KxCetLjxo-VtFzOXSxQuuf97Kg-9lfTTGzY6hc,10150
53
53
  cognite/neat/core/_data_model/models/conceptual/__init__.py,sha256=9A6myEV8s0-LqdXejaljqPj8S0pIpUL75rNdRDZzyR8,585
54
54
  cognite/neat/core/_data_model/models/conceptual/_unverified.py,sha256=apisgtXMb50dOs7rxZ-jcCW4JqxCdAWGtsYtRe3ssfs,6282
55
- cognite/neat/core/_data_model/models/conceptual/_validation.py,sha256=I55RJC3EfQjVkRSYzK6M3UK9aFT-TSIsaWD8JAVzwPo,13000
55
+ cognite/neat/core/_data_model/models/conceptual/_validation.py,sha256=ywWFkxhQvDvB-NCIjWNv7-aOouBCz7HoxtJ0aC_b6BY,13034
56
56
  cognite/neat/core/_data_model/models/conceptual/_verified.py,sha256=e5Qs7n1np4g6inHQwuLUk2rCwgLf129je54xLnzENpw,13659
57
57
  cognite/neat/core/_data_model/models/entities/__init__.py,sha256=UsW-_6fwd-TW0WcnShPKf40h75l1elVn80VurUwRAic,1567
58
58
  cognite/neat/core/_data_model/models/entities/_constants.py,sha256=GXRzVfArwxF3C67VCkzy0JWTZRkRJUYXBQaaecrqcWc,351
@@ -186,7 +186,7 @@ cognite/neat/session/engine/__init__.py,sha256=D3MxUorEs6-NtgoICqtZ8PISQrjrr4dvc
186
186
  cognite/neat/session/engine/_import.py,sha256=1QxA2_EK613lXYAHKQbZyw2yjo5P9XuiX4Z6_6-WMNQ,169
187
187
  cognite/neat/session/engine/_interface.py,sha256=3W-cYr493c_mW3P5O6MKN1xEQg3cA7NHR_ev3zdF9Vk,533
188
188
  cognite/neat/session/engine/_load.py,sha256=g52uYakQM03VqHt_RDHtpHso1-mFFifH5M4T2ScuH8A,5198
189
- cognite_neat-0.123.9.dist-info/METADATA,sha256=ukt3CsG70tKC8gcGdn_i7EIjXTEesFN-g2F5tAdlR44,9171
190
- cognite_neat-0.123.9.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
191
- cognite_neat-0.123.9.dist-info/licenses/LICENSE,sha256=W8VmvFia4WHa3Gqxq1Ygrq85McUNqIGDVgtdvzT-XqA,11351
192
- cognite_neat-0.123.9.dist-info/RECORD,,
189
+ cognite_neat-0.123.11.dist-info/METADATA,sha256=NH4ItRGVPjcqNg9VXVWVnJb_55REoG53v5xz598Giwg,9172
190
+ cognite_neat-0.123.11.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
191
+ cognite_neat-0.123.11.dist-info/licenses/LICENSE,sha256=W8VmvFia4WHa3Gqxq1Ygrq85McUNqIGDVgtdvzT-XqA,11351
192
+ cognite_neat-0.123.11.dist-info/RECORD,,