cognite-neat 0.85.5__py3-none-any.whl → 0.85.7__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.

Files changed (33) hide show
  1. cognite/neat/_version.py +1 -1
  2. cognite/neat/app/api/routers/data_exploration.py +2 -2
  3. cognite/neat/graph/extractors/_classic_cdf/_assets.py +26 -9
  4. cognite/neat/graph/extractors/_mock_graph_generator.py +6 -2
  5. cognite/neat/graph/loaders/_base.py +3 -3
  6. cognite/neat/graph/loaders/_rdf2dms.py +13 -11
  7. cognite/neat/graph/queries/_base.py +16 -6
  8. cognite/neat/graph/queries/_shared.py +2 -2
  9. cognite/neat/legacy/graph/extractors/_mock_graph_generator.py +4 -2
  10. cognite/neat/legacy/graph/loaders/_asset_loader.py +5 -5
  11. cognite/neat/legacy/graph/loaders/core/rdf_to_assets.py +4 -4
  12. cognite/neat/legacy/graph/loaders/core/rdf_to_relationships.py +2 -2
  13. cognite/neat/legacy/graph/transformations/query_generator/sparql.py +2 -2
  14. cognite/neat/legacy/graph/transformations/transformer.py +2 -2
  15. cognite/neat/legacy/rules/exporters/_rules2ontology.py +6 -6
  16. cognite/neat/legacy/rules/importers/_graph2rules.py +4 -4
  17. cognite/neat/legacy/rules/importers/_owl2rules/_owl2classes.py +3 -3
  18. cognite/neat/legacy/rules/importers/_owl2rules/_owl2properties.py +5 -5
  19. cognite/neat/rules/analysis/__init__.py +5 -2
  20. cognite/neat/rules/analysis/_base.py +0 -12
  21. cognite/neat/rules/analysis/_information_rules.py +116 -27
  22. cognite/neat/rules/exporters/_rules2ontology.py +6 -6
  23. cognite/neat/rules/importers/_base.py +8 -2
  24. cognite/neat/rules/importers/_inference2rules.py +4 -4
  25. cognite/neat/rules/importers/_owl2rules/_owl2classes.py +3 -3
  26. cognite/neat/rules/importers/_owl2rules/_owl2properties.py +5 -5
  27. cognite/neat/utils/__init__.py +2 -2
  28. cognite/neat/utils/utils.py +6 -6
  29. {cognite_neat-0.85.5.dist-info → cognite_neat-0.85.7.dist-info}/METADATA +1 -1
  30. {cognite_neat-0.85.5.dist-info → cognite_neat-0.85.7.dist-info}/RECORD +33 -33
  31. {cognite_neat-0.85.5.dist-info → cognite_neat-0.85.7.dist-info}/LICENSE +0 -0
  32. {cognite_neat-0.85.5.dist-info → cognite_neat-0.85.7.dist-info}/WHEEL +0 -0
  33. {cognite_neat-0.85.5.dist-info → cognite_neat-0.85.7.dist-info}/entry_points.txt +0 -0
cognite/neat/_version.py CHANGED
@@ -1 +1 @@
1
- __version__ = "0.85.5"
1
+ __version__ = "0.85.7"
@@ -17,7 +17,7 @@ from cognite.neat.app.api.data_classes.rest import (
17
17
  from cognite.neat.app.api.utils.data_mapping import rdf_result_to_api_response
18
18
  from cognite.neat.app.api.utils.query_templates import query_templates
19
19
  from cognite.neat.legacy.graph.transformations import query_generator
20
- from cognite.neat.utils.utils import remove_namespace
20
+ from cognite.neat.utils.utils import remove_namespace_from_uri
21
21
  from cognite.neat.workflows.steps.data_contracts import RulesData, SolutionGraph, SourceGraph
22
22
 
23
23
  router = APIRouter()
@@ -51,7 +51,7 @@ def get_datatype_properties(request: DatatypePropertyRequest):
51
51
  {
52
52
  "id": row[rdflib.Variable("property")],
53
53
  "count": int(row[rdflib.Variable("occurrence")]),
54
- "name": remove_namespace(row[rdflib.Variable("property")]),
54
+ "name": remove_namespace_from_uri(row[rdflib.Variable("property")]),
55
55
  }
56
56
  for row in results["rows"]
57
57
  ]
@@ -1,4 +1,4 @@
1
- from collections.abc import Iterable
1
+ from collections.abc import Callable, Iterable
2
2
  from datetime import datetime, timezone
3
3
  from pathlib import Path
4
4
  from typing import cast
@@ -19,15 +19,19 @@ class AssetsExtractor(BaseExtractor):
19
19
  Args:
20
20
  assets (Iterable[Asset]): An iterable of assets.
21
21
  namespace (Namespace, optional): The namespace to use. Defaults to DEFAULT_NAMESPACE.
22
+ to_type (Callable[[Asset], str | None], optional): A function to convert an asset to a type. Defaults to None.
23
+ If None or if the function returns None, the asset will be set to the default type "Asset".
22
24
  """
23
25
 
24
26
  def __init__(
25
27
  self,
26
28
  assets: Iterable[Asset],
27
29
  namespace: Namespace | None = None,
30
+ to_type: Callable[[Asset], str | None] | None = None,
28
31
  ):
29
32
  self.namespace = namespace or DEFAULT_NAMESPACE
30
33
  self.assets = assets
34
+ self.to_type = to_type
31
35
 
32
36
  @classmethod
33
37
  def from_dataset(
@@ -35,29 +39,42 @@ class AssetsExtractor(BaseExtractor):
35
39
  client: CogniteClient,
36
40
  data_set_external_id: str,
37
41
  namespace: Namespace | None = None,
42
+ to_type: Callable[[Asset], str | None] | None = None,
38
43
  ):
39
- return cls(cast(Iterable[Asset], client.assets(data_set_external_ids=data_set_external_id)), namespace)
44
+ return cls(cast(Iterable[Asset], client.assets(data_set_external_ids=data_set_external_id)), namespace, to_type)
40
45
 
41
46
  @classmethod
42
- def from_hierarchy(cls, client: CogniteClient, root_asset_external_id: str, namespace: Namespace | None = None):
43
- return cls(cast(Iterable[Asset], client.assets(asset_subtree_external_ids=root_asset_external_id)), namespace)
47
+ def from_hierarchy(
48
+ cls,
49
+ client: CogniteClient,
50
+ root_asset_external_id: str,
51
+ namespace: Namespace | None = None,
52
+ to_type: Callable[[Asset], str | None] | None = None,
53
+ ):
54
+ return cls(
55
+ cast(Iterable[Asset], client.assets(asset_subtree_external_ids=root_asset_external_id)), namespace, to_type
56
+ )
44
57
 
45
58
  @classmethod
46
- def from_file(cls, file_path: str, namespace: Namespace | None = None):
47
- return cls(AssetList.load(Path(file_path).read_text()), namespace)
59
+ def from_file(
60
+ cls, file_path: str, namespace: Namespace | None = None, to_type: Callable[[Asset], str] | None = None
61
+ ):
62
+ return cls(AssetList.load(Path(file_path).read_text()), namespace, to_type)
48
63
 
49
64
  def extract(self) -> Iterable[Triple]:
50
65
  """Extracts an asset with the given asset_id."""
51
66
  for asset in self.assets:
52
67
  yield from self._asset2triples(asset, self.namespace)
53
68
 
54
- @classmethod
55
- def _asset2triples(cls, asset: Asset, namespace: Namespace) -> list[Triple]:
69
+ def _asset2triples(self, asset: Asset, namespace: Namespace) -> list[Triple]:
56
70
  """Converts an asset to triples."""
57
71
  id_ = namespace[f"Asset_{asset.id}"]
58
72
 
59
73
  # Set rdf type
60
- triples: list[Triple] = [(id_, RDF.type, namespace["Asset"])]
74
+ type_ = "Asset"
75
+ if self.to_type:
76
+ type_ = self.to_type(asset) or type_
77
+ triples: list[Triple] = [(id_, RDF.type, namespace[type_])]
61
78
 
62
79
  # Create attributes
63
80
  if asset.name:
@@ -17,7 +17,7 @@ from cognite.neat.rules.models import DMSRules, InformationRules
17
17
  from cognite.neat.rules.models.data_types import DataType
18
18
  from cognite.neat.rules.models.entities import ClassEntity, EntityTypes
19
19
  from cognite.neat.rules.models.information import InformationProperty
20
- from cognite.neat.utils.utils import remove_namespace
20
+ from cognite.neat.utils.utils import remove_namespace_from_uri
21
21
 
22
22
  from ._base import BaseExtractor
23
23
 
@@ -258,7 +258,11 @@ def _generate_mock_data_property_triples(
258
258
  # generate string
259
259
  else:
260
260
  triples.append(
261
- (id_, URIRef(namespace[property_]), Literal(f"{property_}-{remove_namespace(id_).split('-')[-1]}"))
261
+ (
262
+ id_,
263
+ URIRef(namespace[property_]),
264
+ Literal(f"{property_}-{remove_namespace_from_uri(id_).split('-')[-1]}"),
265
+ )
262
266
  )
263
267
  return triples
264
268
 
@@ -65,11 +65,11 @@ class CDFLoader(BaseLoader[T_Output]):
65
65
  items.append(result)
66
66
 
67
67
  if len(items) >= self._UPLOAD_BATCH_SIZE:
68
- yield self._upload_to_cdf(client, items, dry_run, issues)
68
+ yield from self._upload_to_cdf(client, items, dry_run, issues)
69
69
  issues = NeatIssueList[NeatIssue]()
70
70
  items = []
71
71
  if items:
72
- yield self._upload_to_cdf(client, items, dry_run, issues)
72
+ yield from self._upload_to_cdf(client, items, dry_run, issues)
73
73
 
74
74
  @abstractmethod
75
75
  def _get_required_capabilities(self) -> list[Capability]:
@@ -82,5 +82,5 @@ class CDFLoader(BaseLoader[T_Output]):
82
82
  items: list[T_Output],
83
83
  dry_run: bool,
84
84
  read_issues: NeatIssueList,
85
- ) -> UploadResult:
85
+ ) -> Iterable[UploadResult]:
86
86
  raise NotImplementedError
@@ -1,4 +1,3 @@
1
- import itertools
2
1
  import json
3
2
  from collections import defaultdict
4
3
  from collections.abc import Iterable, Sequence
@@ -263,8 +262,7 @@ class DMSLoader(CDFLoader[dm.InstanceApply]):
263
262
  items: list[dm.InstanceApply],
264
263
  dry_run: bool,
265
264
  read_issues: NeatIssueList,
266
- ) -> UploadResult:
267
- result = UploadResult[InstanceId](name=type(self).__name__, issues=read_issues)
265
+ ) -> Iterable[UploadResult]:
268
266
  try:
269
267
  nodes = [item for item in items if isinstance(item, dm.NodeApply)]
270
268
  edges = [item for item in items if isinstance(item, dm.EdgeApply)]
@@ -276,18 +274,22 @@ class DMSLoader(CDFLoader[dm.InstanceApply]):
276
274
  skip_on_version_conflict=True,
277
275
  )
278
276
  except CogniteAPIError as e:
277
+ result = UploadResult[InstanceId](name="Instances", issues=read_issues)
279
278
  result.error_messages.append(str(e))
280
279
  result.failed_upserted.update(item.as_id() for item in e.failed + e.unknown)
281
280
  result.created.update(item.as_id() for item in e.successful)
281
+ yield result
282
282
  else:
283
- for instance in itertools.chain(upserted.nodes, upserted.edges):
284
- if instance.was_modified and instance.created_time == instance.last_updated_time:
285
- result.created.add(instance.as_id())
286
- elif instance.was_modified:
287
- result.changed.add(instance.as_id())
288
- else:
289
- result.unchanged.add(instance.as_id())
290
- return result
283
+ for instance_type, instances in {"Nodes": upserted.nodes, "Edges": upserted.edges}.items():
284
+ result = UploadResult[InstanceId](name=instance_type, issues=read_issues)
285
+ for instance in instances: # type: ignore[attr-defined]
286
+ if instance.was_modified and instance.created_time == instance.last_updated_time:
287
+ result.created.add(instance.as_id())
288
+ elif instance.was_modified:
289
+ result.changed.add(instance.as_id())
290
+ else:
291
+ result.unchanged.add(instance.as_id())
292
+ yield result
291
293
 
292
294
 
293
295
  def _triples2dictionary(
@@ -1,12 +1,12 @@
1
1
  import warnings
2
- from typing import cast
2
+ from typing import Literal, cast, overload
3
3
 
4
4
  from rdflib import RDF, Graph, URIRef
5
5
  from rdflib.query import ResultRow
6
6
 
7
7
  from cognite.neat.rules.models.entities import ClassEntity
8
8
  from cognite.neat.rules.models.information import InformationRules
9
- from cognite.neat.utils.utils import remove_namespace
9
+ from cognite.neat.utils.utils import remove_namespace_from_uri
10
10
 
11
11
  from ._construct import build_construct_query
12
12
 
@@ -66,7 +66,7 @@ class Queries:
66
66
  result = self.graph.query(query)
67
67
 
68
68
  # We cannot include the RDF.type in case there is a neat:type property
69
- return [remove_namespace(*triple) for triple in result if triple[1] != RDF.type] # type: ignore[misc, index]
69
+ return [remove_namespace_from_uri(*triple) for triple in result if triple[1] != RDF.type] # type: ignore[misc, index]
70
70
  else:
71
71
  warnings.warn("No rules found for the graph store, returning empty list.", stacklevel=2)
72
72
  return []
@@ -93,7 +93,7 @@ class Queries:
93
93
  result = self.graph.query(query)
94
94
 
95
95
  # We cannot include the RDF.type in case there is a neat:type property
96
- return [remove_namespace(*triple) for triple in result if triple[1] != RDF.type] # type: ignore[misc, index]
96
+ return [remove_namespace_from_uri(*triple) for triple in result if triple[1] != RDF.type] # type: ignore[misc, index]
97
97
  else:
98
98
  warnings.warn("No rules found for the graph store, returning empty list.", stacklevel=2)
99
99
  return []
@@ -110,14 +110,24 @@ class Queries:
110
110
  query = f"SELECT ?subject ?predicate ?object WHERE {{ ?subject ?predicate ?object }} LIMIT {limit}"
111
111
  return cast(list[ResultRow], list(self.graph.query(query)))
112
112
 
113
- def list_types(self, limit: int = 25) -> list[ResultRow]:
113
+ @overload
114
+ def list_types(self, remove_namespace: Literal[False] = False, limit: int = 25) -> list[ResultRow]: ...
115
+
116
+ @overload
117
+ def list_types(self, remove_namespace: Literal[True], limit: int = 25) -> list[str]: ...
118
+
119
+ def list_types(self, remove_namespace: bool = False, limit: int = 25) -> list[ResultRow] | list[str]:
114
120
  """List types in the graph store
115
121
 
116
122
  Args:
117
123
  limit: Max number of types to return, by default 25
124
+ remove_namespace: Whether to remove the namespace from the type, by default False
118
125
 
119
126
  Returns:
120
127
  List of types
121
128
  """
122
129
  query = f"SELECT DISTINCT ?type WHERE {{ ?subject a ?type }} LIMIT {limit}"
123
- return cast(list[ResultRow], list(self.graph.query(query)))
130
+ result = cast(list[ResultRow], list(self.graph.query(query)))
131
+ if remove_namespace:
132
+ return [remove_namespace_from_uri(res[0]) for res in result]
133
+ return result
@@ -11,7 +11,7 @@ from cognite.neat.rules.models._rdfpath import (
11
11
  Hop,
12
12
  Step,
13
13
  )
14
- from cognite.neat.utils.utils import remove_namespace, uri_to_short_form
14
+ from cognite.neat.utils.utils import remove_namespace_from_uri, uri_to_short_form
15
15
 
16
16
  if sys.version_info >= (3, 11):
17
17
  from typing import Self
@@ -146,7 +146,7 @@ def triples2dictionary(triples: Iterable[tuple[URIRef, URIRef, str | URIRef]]) -
146
146
  value: str
147
147
  uri: URIRef
148
148
 
149
- id_, property_, value = remove_namespace(*triple) # type: ignore[misc]
149
+ id_, property_, value = remove_namespace_from_uri(*triple) # type: ignore[misc]
150
150
  uri = triple[0]
151
151
 
152
152
  if uri not in dictionary:
@@ -20,7 +20,7 @@ from cognite.neat.legacy.rules.analysis import (
20
20
  from cognite.neat.legacy.rules.exporters._rules2rules import subset_rules
21
21
  from cognite.neat.legacy.rules.models import Rules
22
22
  from cognite.neat.legacy.rules.models.value_types import XSD_VALUE_TYPE_MAPPINGS
23
- from cognite.neat.utils.utils import remove_namespace
23
+ from cognite.neat.utils.utils import remove_namespace_from_uri
24
24
 
25
25
  from ._base import BaseExtractor
26
26
 
@@ -247,7 +247,9 @@ def _generate_mock_data_property_triples(
247
247
  triples.append((id_, URIRef(namespace[property_]), Literal(numpy.float32(random.uniform(1, 1983)))))
248
248
  # generate string
249
249
  else:
250
- triples.append((id_, URIRef(namespace[property_]), Literal(remove_namespace(id_).replace("-", " "))))
250
+ triples.append(
251
+ (id_, URIRef(namespace[property_]), Literal(remove_namespace_from_uri(id_).replace("-", " ")))
252
+ )
251
253
  return triples
252
254
 
253
255
 
@@ -15,7 +15,7 @@ from rdflib.query import ResultRow
15
15
  from cognite.neat.legacy.graph.stores import NeatGraphStoreBase
16
16
  from cognite.neat.legacy.rules.models import Rules
17
17
  from cognite.neat.legacy.rules.models.rules import Property
18
- from cognite.neat.utils import remove_namespace
18
+ from cognite.neat.utils import remove_namespace_from_uri
19
19
  from cognite.neat.utils.utils import epoch_now_ms
20
20
 
21
21
  from ._base import CogniteLoader
@@ -166,7 +166,7 @@ class AssetLoader(CogniteLoader[AssetResource]):
166
166
  logging.debug(f"Class <{class_name}> has {len(result)} instances")
167
167
 
168
168
  for instance_uri, properties_values in groupby(result, lambda x: x[0]):
169
- instance_id = remove_namespace(instance_uri)
169
+ instance_id = remove_namespace_from_uri(instance_uri)
170
170
  values_by_property = self._prepare_instance_data(instance_id, properties_values)
171
171
  try:
172
172
  asset = self._load_asset(
@@ -195,7 +195,7 @@ class AssetLoader(CogniteLoader[AssetResource]):
195
195
  relationships = self._load_relationships(
196
196
  properties_by_class_name[class_name],
197
197
  values_by_property,
198
- remove_namespace(instance_id),
198
+ remove_namespace_from_uri(instance_id),
199
199
  class_name,
200
200
  )
201
201
  except Exception as e:
@@ -342,11 +342,11 @@ class AssetLoader(CogniteLoader[AssetResource]):
342
342
  A dictionary with property type as key and a list of values as value.
343
343
  """
344
344
  properties_value_tuples: list[tuple[str, str]] = [
345
- remove_namespace(prop, value) # type: ignore[misc]
345
+ remove_namespace_from_uri(prop, value) # type: ignore[misc]
346
346
  for _, prop, value in properties_values
347
347
  ]
348
348
  # We add an identifier which will be used as fallback for external_id
349
- properties_value_tuples.append((self._identifier, remove_namespace(instance_id)))
349
+ properties_value_tuples.append((self._identifier, remove_namespace_from_uri(instance_id)))
350
350
  values_by_property: dict[str, str | list[str]] = {}
351
351
  for prop, values in groupby(sorted(properties_value_tuples), lambda x: x[0]):
352
352
  values_list: list[str] = [value for _, value in values] # type: ignore[misc, has-type]
@@ -18,7 +18,7 @@ from rdflib.term import URIRef
18
18
  from cognite.neat.legacy.graph.loaders.core.models import AssetTemplate
19
19
  from cognite.neat.legacy.graph.stores import NeatGraphStoreBase
20
20
  from cognite.neat.legacy.rules.models.rules import Property, Rules
21
- from cognite.neat.utils.utils import chunker, datetime_utc_now, remove_namespace, retry_decorator
21
+ from cognite.neat.utils.utils import chunker, datetime_utc_now, remove_namespace_from_uri, retry_decorator
22
22
 
23
23
  if sys.version_info >= (3, 11):
24
24
  from datetime import UTC
@@ -320,13 +320,13 @@ def _list2dict(class_instance: list) -> dict[str, Any]:
320
320
 
321
321
  class_instance_dict: dict[str, Any] = {}
322
322
  for property_value_pair in class_instance:
323
- property_ = remove_namespace(property_value_pair[0])
323
+ property_ = remove_namespace_from_uri(property_value_pair[0])
324
324
 
325
325
  # Remove namespace from URIRef values, otherwise convert Literal to string
326
326
  # ideally this should react upon property type provided in sheet
327
327
  # however Assets only support string values
328
328
  value = (
329
- remove_namespace(property_value_pair[1])
329
+ remove_namespace_from_uri(property_value_pair[1])
330
330
  if isinstance(property_value_pair[1], URIRef)
331
331
  else str(property_value_pair[1])
332
332
  )
@@ -440,7 +440,7 @@ def rdf2assets(
440
440
  progress_counter += 1
441
441
  except Exception as ValidationError:
442
442
  logging.error(
443
- f"Skipping class <{class_}> instance <{remove_namespace(str(instance_id))}>, "
443
+ f"Skipping class <{class_}> instance <{remove_namespace_from_uri(str(instance_id))}>, "
444
444
  f"reason:\n{ValidationError}\n"
445
445
  )
446
446
  if stop_on_exception:
@@ -14,7 +14,7 @@ from cognite.neat.legacy.graph.loaders.core.models import RelationshipDefinition
14
14
  from cognite.neat.legacy.graph.loaders.core.rdf_to_assets import _categorize_cdf_assets
15
15
  from cognite.neat.legacy.graph.stores import NeatGraphStoreBase
16
16
  from cognite.neat.legacy.rules.models.rules import Rules
17
- from cognite.neat.utils.utils import chunker, datetime_utc_now, epoch_now_ms, remove_namespace, retry_decorator
17
+ from cognite.neat.utils.utils import chunker, datetime_utc_now, epoch_now_ms, remove_namespace_from_uri, retry_decorator
18
18
 
19
19
 
20
20
  def define_relationships(rules: Rules, data_set_id: int, stop_on_exception: bool = False) -> RelationshipDefinitions:
@@ -150,7 +150,7 @@ def rdf2relationships(
150
150
  relationship_data_frame.rename(columns={0: "source_external_id", 1: "target_external_id"}, inplace=True)
151
151
 
152
152
  # removes namespace
153
- relationship_data_frame = relationship_data_frame.map(remove_namespace) # type: ignore[operator]
153
+ relationship_data_frame = relationship_data_frame.map(remove_namespace_from_uri) # type: ignore[operator]
154
154
 
155
155
  # adding prefix
156
156
  if relationship_external_id_prefix:
@@ -21,7 +21,7 @@ from cognite.neat.legacy.rules.models.rdfpath import (
21
21
  parse_traversal,
22
22
  )
23
23
  from cognite.neat.legacy.rules.models.rules import Rules
24
- from cognite.neat.utils.utils import remove_namespace
24
+ from cognite.neat.utils.utils import remove_namespace_from_uri
25
25
 
26
26
 
27
27
  def _generate_prefix_header(prefixes: dict[str, Namespace] = PREFIXES) -> str:
@@ -529,7 +529,7 @@ def triples2dictionary(triples: Iterable[tuple[URIRef, URIRef, str | URIRef]]) -
529
529
  property_: str
530
530
  value: str
531
531
  uri: URIRef
532
- id_, property_, value = remove_namespace(*triple) # type: ignore[misc]
532
+ id_, property_, value = remove_namespace_from_uri(*triple) # type: ignore[misc]
533
533
  uri = triple[0]
534
534
 
535
535
  if uri not in dictionary:
@@ -24,7 +24,7 @@ from cognite.neat.legacy.rules.models.rdfpath import (
24
24
  parse_rule,
25
25
  )
26
26
  from cognite.neat.legacy.rules.models.rules import Rules
27
- from cognite.neat.utils.utils import remove_namespace
27
+ from cognite.neat.utils.utils import remove_namespace_from_uri
28
28
 
29
29
  prom_total_proc_rules_g = Gauge("neat_total_processed_rules", "Number of processed rules", ["state"])
30
30
  rules_processing_timing_metric = Gauge(
@@ -228,7 +228,7 @@ def domain2app_knowledge_graph(
228
228
  # in the target graph then we should remove namespace from the object URI and store it as literal
229
229
  if isinstance(rule.traversal, AllReferences) and rule_definition.property_type == "DatatypeProperty":
230
230
  instance_df[EntityTypes.object] = instance_df[EntityTypes.object].apply(
231
- lambda x: Literal(remove_namespace(x))
231
+ lambda x: Literal(remove_namespace_from_uri(x))
232
232
  )
233
233
 
234
234
  if isinstance(rule, RawLookup):
@@ -14,7 +14,7 @@ from cognite.neat.legacy.rules.exporters._base import BaseExporter
14
14
  from cognite.neat.legacy.rules.exporters._validation import are_properties_redefined
15
15
  from cognite.neat.legacy.rules.models.rules import Class, Metadata, Property, Rules
16
16
  from cognite.neat.legacy.rules.models.value_types import XSD_VALUE_TYPE_MAPPINGS
17
- from cognite.neat.utils.utils import generate_exception_report, remove_namespace
17
+ from cognite.neat.utils.utils import generate_exception_report, remove_namespace_from_uri
18
18
 
19
19
  if sys.version_info >= (3, 11):
20
20
  from typing import Self
@@ -322,7 +322,7 @@ class OWLProperty(OntologyModel):
322
322
  if len(v) > 1:
323
323
  warnings.warn(
324
324
  exceptions.OntologyMultiTypeProperty(
325
- remove_namespace(info.data["id_"]), [remove_namespace(t) for t in v]
325
+ remove_namespace_from_uri(info.data["id_"]), [remove_namespace_from_uri(t) for t in v]
326
326
  ).message,
327
327
  category=exceptions.OntologyMultiTypeProperty,
328
328
  stacklevel=2,
@@ -334,7 +334,7 @@ class OWLProperty(OntologyModel):
334
334
  if len(v) > 1:
335
335
  warnings.warn(
336
336
  exceptions.OntologyMultiRangeProperty(
337
- remove_namespace(info.data["id_"]), [remove_namespace(t) for t in v]
337
+ remove_namespace_from_uri(info.data["id_"]), [remove_namespace_from_uri(t) for t in v]
338
338
  ).message,
339
339
  category=exceptions.OntologyMultiRangeProperty,
340
340
  stacklevel=2,
@@ -346,7 +346,7 @@ class OWLProperty(OntologyModel):
346
346
  if len(v) > 1:
347
347
  warnings.warn(
348
348
  exceptions.OntologyMultiDomainProperty(
349
- remove_namespace(info.data["id_"]), [remove_namespace(t) for t in v]
349
+ remove_namespace_from_uri(info.data["id_"]), [remove_namespace_from_uri(t) for t in v]
350
350
  ).message,
351
351
  category=exceptions.OntologyMultiDomainProperty,
352
352
  stacklevel=2,
@@ -357,7 +357,7 @@ class OWLProperty(OntologyModel):
357
357
  def has_multi_name(cls, v, info: ValidationInfo):
358
358
  if len(v) > 1:
359
359
  warnings.warn(
360
- exceptions.OntologyMultiLabeledProperty(remove_namespace(info.data["id_"]), v).message,
360
+ exceptions.OntologyMultiLabeledProperty(remove_namespace_from_uri(info.data["id_"]), v).message,
361
361
  category=exceptions.OntologyMultiLabeledProperty,
362
362
  stacklevel=2,
363
363
  )
@@ -367,7 +367,7 @@ class OWLProperty(OntologyModel):
367
367
  def has_multi_comment(cls, v, info: ValidationInfo):
368
368
  if len(v) > 1:
369
369
  warnings.warn(
370
- exceptions.OntologyMultiDefinitionProperty(remove_namespace(info.data["id_"])).message,
370
+ exceptions.OntologyMultiDefinitionProperty(remove_namespace_from_uri(info.data["id_"])).message,
371
371
  category=exceptions.OntologyMultiDefinitionProperty,
372
372
  stacklevel=2,
373
373
  )
@@ -14,7 +14,7 @@ from cognite.neat.constants import PREFIXES
14
14
  from cognite.neat.legacy.rules import exceptions
15
15
  from cognite.neat.legacy.rules.exporters._rules2rules import to_dms_name
16
16
  from cognite.neat.legacy.rules.models.tables import Tables
17
- from cognite.neat.utils.utils import get_namespace, remove_namespace, uri_to_short_form
17
+ from cognite.neat.utils.utils import get_namespace, remove_namespace_from_uri, uri_to_short_form
18
18
 
19
19
  from ._base import BaseImporter
20
20
 
@@ -173,7 +173,7 @@ def _graph_to_data_model_dict(graph: Graph, max_number_of_instance: int = -1) ->
173
173
 
174
174
  for class_ in _get_class_ids(graph):
175
175
  _add_uri_namespace_to_prefixes(class_, prefixes)
176
- class_name = remove_namespace(class_)
176
+ class_name = remove_namespace_from_uri(class_)
177
177
 
178
178
  if class_name in data_model:
179
179
  warnings.warn(
@@ -187,7 +187,7 @@ def _graph_to_data_model_dict(graph: Graph, max_number_of_instance: int = -1) ->
187
187
 
188
188
  for instance in _get_class_instance_ids(graph, class_, max_number_of_instance):
189
189
  for property_, occurrence, data_type, object_type in _define_instance_properties(graph, instance):
190
- property_name = remove_namespace(property_)
190
+ property_name = remove_namespace_from_uri(property_)
191
191
  _add_uri_namespace_to_prefixes(property_, prefixes)
192
192
 
193
193
  type_ = data_type if data_type else object_type
@@ -196,7 +196,7 @@ def _graph_to_data_model_dict(graph: Graph, max_number_of_instance: int = -1) ->
196
196
  if not type_:
197
197
  continue
198
198
 
199
- type_name = remove_namespace(type_)
199
+ type_name = remove_namespace_from_uri(type_)
200
200
  _add_uri_namespace_to_prefixes(type_, prefixes)
201
201
 
202
202
  if property_name not in data_model[class_name]["properties"]:
@@ -4,7 +4,7 @@ import numpy as np
4
4
  import pandas as pd
5
5
  from rdflib import OWL, Graph
6
6
 
7
- from cognite.neat.utils.utils import remove_namespace
7
+ from cognite.neat.utils.utils import remove_namespace_from_uri
8
8
 
9
9
 
10
10
  def parse_owl_classes(graph: Graph, make_compliant: bool = False, language: str = "en") -> pd.DataFrame:
@@ -84,10 +84,10 @@ def _parse_raw_dataframe(query_results: list[tuple]) -> pd.DataFrame:
84
84
  df.replace(np.nan, "", regex=True, inplace=True)
85
85
 
86
86
  df.Source = df.Class
87
- df.Class = df.Class.apply(lambda x: remove_namespace(x))
87
+ df.Class = df.Class.apply(lambda x: remove_namespace_from_uri(x))
88
88
  df["Source Entity Name"] = df.Class
89
89
  df["Match"] = len(df) * ["exact"]
90
- df["Parent Class"] = df["Parent Class"].apply(lambda x: remove_namespace(x))
90
+ df["Parent Class"] = df["Parent Class"].apply(lambda x: remove_namespace_from_uri(x))
91
91
 
92
92
  return df
93
93
 
@@ -4,7 +4,7 @@ import numpy as np
4
4
  import pandas as pd
5
5
  from rdflib import Graph
6
6
 
7
- from cognite.neat.utils.utils import remove_namespace
7
+ from cognite.neat.utils.utils import remove_namespace_from_uri
8
8
 
9
9
  from ._owl2classes import _data_type_property_class, _object_property_class, _thing_class
10
10
 
@@ -92,12 +92,12 @@ def _parse_raw_dataframe(query_results: list[tuple]) -> pd.DataFrame:
92
92
  df.replace(np.nan, "", regex=True, inplace=True)
93
93
 
94
94
  df.Source = df.Property
95
- df.Class = df.Class.apply(lambda x: remove_namespace(x))
96
- df.Property = df.Property.apply(lambda x: remove_namespace(x))
97
- df.Type = df.Type.apply(lambda x: remove_namespace(x))
95
+ df.Class = df.Class.apply(lambda x: remove_namespace_from_uri(x))
96
+ df.Property = df.Property.apply(lambda x: remove_namespace_from_uri(x))
97
+ df.Type = df.Type.apply(lambda x: remove_namespace_from_uri(x))
98
98
  df["Source Entity Name"] = df.Property
99
99
  df["Match Type"] = len(df) * ["exact"]
100
- df["_property_type"] = df["_property_type"].apply(lambda x: remove_namespace(x))
100
+ df["_property_type"] = df["_property_type"].apply(lambda x: remove_namespace_from_uri(x))
101
101
 
102
102
  return df
103
103
 
@@ -1,3 +1,6 @@
1
- from ._information_rules import InformationArchitectRulesAnalysis
1
+ from ._information_rules import (
2
+ AssetArchitectRulesAnalysis,
3
+ InformationArchitectRulesAnalysis,
4
+ )
2
5
 
3
- __all__ = ["InformationArchitectRulesAnalysis"]
6
+ __all__ = ["InformationArchitectRulesAnalysis", "AssetArchitectRulesAnalysis"]
@@ -1,15 +1,9 @@
1
- import sys
2
1
  from abc import ABC, abstractmethod
3
2
  from typing import Generic, TypeVar
4
3
 
5
4
  from cognite.neat.rules._shared import Rules
6
5
  from cognite.neat.rules.models.entities import ClassEntity
7
6
 
8
- if sys.version_info >= (3, 11):
9
- from enum import StrEnum
10
- else:
11
- from backports.strenum import StrEnum
12
-
13
7
  T_Rules = TypeVar("T_Rules", bound=Rules)
14
8
 
15
9
 
@@ -17,9 +11,3 @@ class BaseAnalysis(ABC, Generic[T_Rules]):
17
11
  @abstractmethod
18
12
  def subset_rules(self, desired_classes: set[ClassEntity]) -> T_Rules:
19
13
  raise NotImplementedError()
20
-
21
-
22
- class DataModelingScenario(StrEnum):
23
- from_scratch = "from scratch"
24
- build_solution = "build solution"
25
- extend_reference = "extend reference"
@@ -2,25 +2,37 @@ import itertools
2
2
  import logging
3
3
  import warnings
4
4
  from collections import defaultdict
5
- from typing import Any
5
+ from typing import Any, Generic, TypeVar
6
6
 
7
7
  import pandas as pd
8
8
  from pydantic import ValidationError
9
9
 
10
10
  from cognite.neat.rules.models import SchemaCompleteness
11
11
  from cognite.neat.rules.models._rdfpath import RDFPath
12
- from cognite.neat.rules.models.entities import ClassEntity, EntityTypes, ParentClassEntity, ReferenceEntity
13
- from cognite.neat.rules.models.information import InformationClass, InformationProperty, InformationRules
12
+ from cognite.neat.rules.models.asset import AssetClass, AssetProperty, AssetRules
13
+ from cognite.neat.rules.models.entities import (
14
+ AssetEntity,
15
+ ClassEntity,
16
+ EntityTypes,
17
+ ParentClassEntity,
18
+ ReferenceEntity,
19
+ RelationshipEntity,
20
+ )
21
+ from cognite.neat.rules.models.information import (
22
+ InformationClass,
23
+ InformationProperty,
24
+ InformationRules,
25
+ )
14
26
  from cognite.neat.utils.utils import get_inheritance_path
15
27
 
16
- from ._base import BaseAnalysis
28
+ T_Rules = TypeVar("T_Rules", InformationRules, AssetRules)
29
+ T_Property = TypeVar("T_Property", InformationProperty, AssetProperty)
30
+ T_Class = TypeVar("T_Class", InformationClass, AssetClass)
17
31
 
18
32
 
19
- class InformationArchitectRulesAnalysis(BaseAnalysis):
20
- """Assumes analysis over only the complete schema"""
21
-
22
- def __init__(self, rules: InformationRules):
23
- self.rules = rules
33
+ class _SharedAnalysis(Generic[T_Rules, T_Property, T_Class]):
34
+ def __init__(self, rules: T_Rules):
35
+ self.rules: T_Rules = rules
24
36
 
25
37
  @property
26
38
  def directly_referred_classes(self) -> set[ClassEntity]:
@@ -65,9 +77,7 @@ class InformationArchitectRulesAnalysis(BaseAnalysis):
65
77
 
66
78
  return class_subclass_pairs
67
79
 
68
- def classes_with_properties(
69
- self, consider_inheritance: bool = False
70
- ) -> dict[ClassEntity, list[InformationProperty]]:
80
+ def classes_with_properties(self, consider_inheritance: bool = False) -> dict[ClassEntity, list[T_Property]]:
71
81
  """Returns classes that have been defined in the data model.
72
82
 
73
83
  Args:
@@ -85,10 +95,10 @@ class InformationArchitectRulesAnalysis(BaseAnalysis):
85
95
  it will not be included in the returned dictionary.
86
96
  """
87
97
 
88
- class_property_pairs: dict[ClassEntity, list[InformationProperty]] = defaultdict(list)
98
+ class_property_pairs: dict[ClassEntity, list[T_Property]] = defaultdict(list)
89
99
 
90
100
  for property_ in self.rules.properties:
91
- class_property_pairs[property_.class_].append(property_)
101
+ class_property_pairs[property_.class_].append(property_) # type: ignore
92
102
 
93
103
  if consider_inheritance:
94
104
  class_parent_pairs = self.class_parent_pairs()
@@ -106,7 +116,7 @@ class InformationArchitectRulesAnalysis(BaseAnalysis):
106
116
  def _add_inherited_properties(
107
117
  cls,
108
118
  class_: ClassEntity,
109
- class_property_pairs: dict[ClassEntity, list[InformationProperty]],
119
+ class_property_pairs: dict[ClassEntity, list[T_Property]],
110
120
  class_parent_pairs: dict[ClassEntity, list[ParentClassEntity]],
111
121
  ):
112
122
  inheritance_path = get_inheritance_path(class_, class_parent_pairs)
@@ -130,7 +140,7 @@ class InformationArchitectRulesAnalysis(BaseAnalysis):
130
140
 
131
141
  def class_property_pairs(
132
142
  self, only_rdfpath: bool = False, consider_inheritance: bool = False
133
- ) -> dict[ClassEntity, dict[str, InformationProperty]]:
143
+ ) -> dict[ClassEntity, dict[str, T_Property]]:
134
144
  """Returns a dictionary of classes with a dictionary of properties associated with them.
135
145
 
136
146
  Args:
@@ -193,7 +203,14 @@ class InformationArchitectRulesAnalysis(BaseAnalysis):
193
203
  Dataframe with the class linkage of the data model
194
204
  """
195
205
 
196
- class_linkage = pd.DataFrame(columns=["source_class", "target_class", "connecting_property", "max_occurrence"])
206
+ class_linkage = pd.DataFrame(
207
+ columns=[
208
+ "source_class",
209
+ "target_class",
210
+ "connecting_property",
211
+ "max_occurrence",
212
+ ]
213
+ )
197
214
 
198
215
  class_property_pairs = self.classes_with_properties(consider_inheritance)
199
216
  properties = list(itertools.chain.from_iterable(class_property_pairs.values()))
@@ -286,21 +303,21 @@ class InformationArchitectRulesAnalysis(BaseAnalysis):
286
303
 
287
304
  def as_property_dict(
288
305
  self,
289
- ) -> dict[str, list[InformationProperty]]:
306
+ ) -> dict[str, list[T_Property]]:
290
307
  """This is used to capture all definitions of a property in the data model."""
291
- property_dict: dict[str, list[InformationProperty]] = defaultdict(list)
308
+ property_dict: dict[str, list[T_Property]] = defaultdict(list)
292
309
  for definition in self.rules.properties:
293
- property_dict[definition.property_].append(definition)
310
+ property_dict[definition.property_].append(definition) # type: ignore
294
311
  return property_dict
295
312
 
296
- def as_class_dict(self) -> dict[str, InformationClass]:
313
+ def as_class_dict(self) -> dict[str, T_Class]:
297
314
  """This is to simplify access to classes through dict."""
298
- class_dict: dict[str, InformationClass] = {}
315
+ class_dict: dict[str, T_Class] = {}
299
316
  for definition in self.rules.classes:
300
- class_dict[str(definition.class_.suffix)] = definition
317
+ class_dict[str(definition.class_.suffix)] = definition # type: ignore
301
318
  return class_dict
302
319
 
303
- def subset_rules(self, desired_classes: set[ClassEntity]) -> InformationRules:
320
+ def subset_rules(self, desired_classes: set[ClassEntity]) -> T_Rules:
304
321
  """
305
322
  Subset rules to only include desired classes and their properties.
306
323
 
@@ -352,7 +369,8 @@ class InformationArchitectRulesAnalysis(BaseAnalysis):
352
369
  if impossible_classes:
353
370
  logging.warning(f"Could not find the following classes defined in the data model: {impossible_classes}")
354
371
  warnings.warn(
355
- f"Could not find the following classes defined in the data model: {impossible_classes}", stacklevel=2
372
+ f"Could not find the following classes defined in the data model: {impossible_classes}",
373
+ stacklevel=2,
356
374
  )
357
375
 
358
376
  reduced_data_model: dict[str, Any] = {
@@ -373,8 +391,79 @@ class InformationArchitectRulesAnalysis(BaseAnalysis):
373
391
  reduced_data_model["properties"].extend(properties)
374
392
 
375
393
  try:
376
- return InformationRules(**reduced_data_model)
394
+ return type(self.rules)(**reduced_data_model)
377
395
  except ValidationError as e:
378
396
  warnings.warn(f"Reduced data model is not complete: {e}", stacklevel=2)
379
397
  reduced_data_model["metadata"].schema_ = SchemaCompleteness.partial
380
- return InformationRules.model_construct(**reduced_data_model)
398
+ return type(self.rules).model_construct(**reduced_data_model)
399
+
400
+
401
+ class InformationArchitectRulesAnalysis(_SharedAnalysis[InformationRules, InformationProperty, InformationClass]):
402
+ """Assumes analysis over only the complete schema"""
403
+
404
+ ...
405
+
406
+
407
+ class AssetArchitectRulesAnalysis(_SharedAnalysis[AssetRules, AssetProperty, AssetClass]):
408
+ """Assumes analysis over only the complete schema"""
409
+
410
+ def class_property_pairs(
411
+ self,
412
+ only_rdfpath: bool = False,
413
+ consider_inheritance: bool = False,
414
+ implementation_type: EntityTypes = EntityTypes.asset,
415
+ ) -> dict[ClassEntity, dict[str, AssetProperty]]:
416
+ class_property_pairs = {}
417
+
418
+ T_implementation = AssetEntity if implementation_type == EntityTypes.asset else RelationshipEntity
419
+
420
+ for class_, properties in self.classes_with_properties(consider_inheritance).items():
421
+ processed_properties = {}
422
+ for property_ in properties:
423
+ if property_.property_ in processed_properties:
424
+ # TODO: use appropriate Warning class from _exceptions.py
425
+ # if missing make one !
426
+ warnings.warn(
427
+ f"Property {property_.property_} for {class_} has been defined more than once!"
428
+ " Only the first definition will be considered, skipping the rest..",
429
+ stacklevel=2,
430
+ )
431
+ continue
432
+
433
+ if (
434
+ property_.implementation
435
+ and any(isinstance(implementation, T_implementation) for implementation in property_.implementation)
436
+ and (not only_rdfpath or (only_rdfpath and isinstance(property_.transformation, RDFPath)))
437
+ ):
438
+ implementation = [
439
+ implementation
440
+ for implementation in property_.implementation
441
+ if isinstance(implementation, T_implementation)
442
+ ]
443
+
444
+ processed_properties[property_.property_] = property_.model_copy(
445
+ deep=True, update={"implementation": implementation}
446
+ )
447
+
448
+ if processed_properties:
449
+ class_property_pairs[class_] = processed_properties
450
+
451
+ return class_property_pairs
452
+
453
+ def asset_definition(
454
+ self, only_rdfpath: bool = False, consider_inheritance: bool = False
455
+ ) -> dict[ClassEntity, dict[str, AssetProperty]]:
456
+ return self.class_property_pairs(
457
+ consider_inheritance=consider_inheritance,
458
+ only_rdfpath=only_rdfpath,
459
+ implementation_type=EntityTypes.asset,
460
+ )
461
+
462
+ def relationship_definition(
463
+ self, only_rdfpath: bool = False, consider_inheritance: bool = False
464
+ ) -> dict[ClassEntity, dict[str, AssetProperty]]:
465
+ return self.class_property_pairs(
466
+ consider_inheritance=consider_inheritance,
467
+ only_rdfpath=only_rdfpath,
468
+ implementation_type=EntityTypes.relationship,
469
+ )
@@ -20,7 +20,7 @@ from cognite.neat.rules.models.information import (
20
20
  InformationProperty,
21
21
  InformationRules,
22
22
  )
23
- from cognite.neat.utils.utils import generate_exception_report, remove_namespace
23
+ from cognite.neat.utils.utils import generate_exception_report, remove_namespace_from_uri
24
24
 
25
25
  from ._base import BaseExporter
26
26
  from ._validation import are_properties_redefined
@@ -350,7 +350,7 @@ class OWLProperty(OntologyModel):
350
350
  if len(v) > 1:
351
351
  warnings.warn(
352
352
  exceptions.OntologyMultiTypeProperty(
353
- remove_namespace(info.data["id_"]), [remove_namespace(t) for t in v]
353
+ remove_namespace_from_uri(info.data["id_"]), [remove_namespace_from_uri(t) for t in v]
354
354
  ).message,
355
355
  category=exceptions.OntologyMultiTypeProperty,
356
356
  stacklevel=2,
@@ -362,7 +362,7 @@ class OWLProperty(OntologyModel):
362
362
  if len(v) > 1:
363
363
  warnings.warn(
364
364
  exceptions.OntologyMultiRangeProperty(
365
- remove_namespace(info.data["id_"]), [remove_namespace(t) for t in v]
365
+ remove_namespace_from_uri(info.data["id_"]), [remove_namespace_from_uri(t) for t in v]
366
366
  ).message,
367
367
  category=exceptions.OntologyMultiRangeProperty,
368
368
  stacklevel=2,
@@ -374,7 +374,7 @@ class OWLProperty(OntologyModel):
374
374
  if len(v) > 1:
375
375
  warnings.warn(
376
376
  exceptions.OntologyMultiDomainProperty(
377
- remove_namespace(info.data["id_"]), [remove_namespace(t) for t in v]
377
+ remove_namespace_from_uri(info.data["id_"]), [remove_namespace_from_uri(t) for t in v]
378
378
  ).message,
379
379
  category=exceptions.OntologyMultiDomainProperty,
380
380
  stacklevel=2,
@@ -385,7 +385,7 @@ class OWLProperty(OntologyModel):
385
385
  def has_multi_name(cls, v, info: ValidationInfo):
386
386
  if len(v) > 1:
387
387
  warnings.warn(
388
- exceptions.OntologyMultiLabeledProperty(remove_namespace(info.data["id_"]), v).message,
388
+ exceptions.OntologyMultiLabeledProperty(remove_namespace_from_uri(info.data["id_"]), v).message,
389
389
  category=exceptions.OntologyMultiLabeledProperty,
390
390
  stacklevel=2,
391
391
  )
@@ -395,7 +395,7 @@ class OWLProperty(OntologyModel):
395
395
  def has_multi_comment(cls, v, info: ValidationInfo):
396
396
  if len(v) > 1:
397
397
  warnings.warn(
398
- exceptions.OntologyMultiDefinitionProperty(remove_namespace(info.data["id_"])).message,
398
+ exceptions.OntologyMultiDefinitionProperty(remove_namespace_from_uri(info.data["id_"])).message,
399
399
  category=exceptions.OntologyMultiDefinitionProperty,
400
400
  stacklevel=2,
401
401
  )
@@ -10,7 +10,11 @@ from pydantic import ValidationError
10
10
  from rdflib import Namespace
11
11
 
12
12
  from cognite.neat.rules._shared import Rules
13
- from cognite.neat.rules.issues.base import IssueList, NeatValidationError, ValidationWarning
13
+ from cognite.neat.rules.issues.base import (
14
+ IssueList,
15
+ NeatValidationError,
16
+ ValidationWarning,
17
+ )
14
18
  from cognite.neat.rules.models import AssetRules, DMSRules, InformationRules, RoleTypes
15
19
  from cognite.neat.utils.auxiliary import class_html_doc
16
20
 
@@ -30,7 +34,9 @@ class BaseImporter(ABC):
30
34
 
31
35
  @abstractmethod
32
36
  def to_rules(
33
- self, errors: Literal["raise", "continue"] = "continue", role: RoleTypes | None = None
37
+ self,
38
+ errors: Literal["raise", "continue"] = "continue",
39
+ role: RoleTypes | None = None,
34
40
  ) -> tuple[Rules | None, IssueList] | Rules:
35
41
  """
36
42
  Creates `Rules` object from the data for target role.
@@ -17,7 +17,7 @@ from cognite.neat.rules.models.information import (
17
17
  InformationMetadata,
18
18
  InformationRulesInput,
19
19
  )
20
- from cognite.neat.utils.utils import get_namespace, remove_namespace, uri_to_short_form
20
+ from cognite.neat.utils.utils import get_namespace, remove_namespace_from_uri, uri_to_short_form
21
21
 
22
22
  ORDERED_CLASSES_QUERY = """SELECT ?class (count(?s) as ?instances )
23
23
  WHERE { ?s a ?class . }
@@ -142,7 +142,7 @@ class InferenceImporter(BaseImporter):
142
142
  for class_uri, no_instances in self.graph.query(ORDERED_CLASSES_QUERY): # type: ignore[misc]
143
143
  self._add_uri_namespace_to_prefixes(cast(URIRef, class_uri), prefixes)
144
144
 
145
- if (class_id := remove_namespace(class_uri)) in classes:
145
+ if (class_id := remove_namespace_from_uri(class_uri)) in classes:
146
146
  # handles cases when class id is already present in classes
147
147
  class_id = f"{class_id}_{len(classes)+1}"
148
148
 
@@ -164,7 +164,7 @@ class InferenceImporter(BaseImporter):
164
164
  for property_uri, occurrence, data_type_uri, object_type_uri in self.graph.query( # type: ignore[misc]
165
165
  INSTANCE_PROPERTIES_DEFINITION.replace("instance_id", instance)
166
166
  ): # type: ignore[misc]
167
- property_id = remove_namespace(property_uri)
167
+ property_id = remove_namespace_from_uri(property_uri)
168
168
  self._add_uri_namespace_to_prefixes(cast(URIRef, property_uri), prefixes)
169
169
  value_type_uri = data_type_uri if data_type_uri else object_type_uri
170
170
 
@@ -173,7 +173,7 @@ class InferenceImporter(BaseImporter):
173
173
  continue
174
174
 
175
175
  self._add_uri_namespace_to_prefixes(cast(URIRef, value_type_uri), prefixes)
176
- value_type_id = remove_namespace(value_type_uri)
176
+ value_type_id = remove_namespace_from_uri(value_type_uri)
177
177
  id_ = f"{class_id}:{property_id}"
178
178
 
179
179
  definition = {
@@ -5,7 +5,7 @@ import pandas as pd
5
5
  from rdflib import OWL, Graph
6
6
 
7
7
  from cognite.neat.rules.models._base import MatchType
8
- from cognite.neat.utils.utils import remove_namespace
8
+ from cognite.neat.utils.utils import remove_namespace_from_uri
9
9
 
10
10
 
11
11
  def parse_owl_classes(graph: Graph, language: str = "en") -> list[dict]:
@@ -68,10 +68,10 @@ def _parse_raw_dataframe(query_results: list[tuple]) -> pd.DataFrame:
68
68
  df.replace(np.nan, "", regex=True, inplace=True)
69
69
 
70
70
  df.Reference = df.Class
71
- df.Class = df.Class.apply(lambda x: remove_namespace(x))
71
+ df.Class = df.Class.apply(lambda x: remove_namespace_from_uri(x))
72
72
  df["Match Type"] = len(df) * [MatchType.exact]
73
73
  df["Comment"] = len(df) * [None]
74
- df["Parent Class"] = df["Parent Class"].apply(lambda x: remove_namespace(x))
74
+ df["Parent Class"] = df["Parent Class"].apply(lambda x: remove_namespace_from_uri(x))
75
75
 
76
76
  return df
77
77
 
@@ -5,7 +5,7 @@ import pandas as pd
5
5
  from rdflib import Graph
6
6
 
7
7
  from cognite.neat.rules.models._base import MatchType
8
- from cognite.neat.utils.utils import remove_namespace
8
+ from cognite.neat.utils.utils import remove_namespace_from_uri
9
9
 
10
10
  from ._owl2classes import _data_type_property_class, _object_property_class, _thing_class
11
11
 
@@ -82,12 +82,12 @@ def _parse_raw_dataframe(query_results: list[tuple]) -> pd.DataFrame:
82
82
  df.replace(np.nan, "", regex=True, inplace=True)
83
83
 
84
84
  df.Reference = df.Property
85
- df.Class = df.Class.apply(lambda x: remove_namespace(x))
86
- df.Property = df.Property.apply(lambda x: remove_namespace(x))
87
- df["Value Type"] = df["Value Type"].apply(lambda x: remove_namespace(x))
85
+ df.Class = df.Class.apply(lambda x: remove_namespace_from_uri(x))
86
+ df.Property = df.Property.apply(lambda x: remove_namespace_from_uri(x))
87
+ df["Value Type"] = df["Value Type"].apply(lambda x: remove_namespace_from_uri(x))
88
88
  df["Match Type"] = len(df) * [MatchType.exact]
89
89
  df["Comment"] = len(df) * [None]
90
- df["_property_type"] = df["_property_type"].apply(lambda x: remove_namespace(x))
90
+ df["_property_type"] = df["_property_type"].apply(lambda x: remove_namespace_from_uri(x))
91
91
 
92
92
  return df
93
93
 
@@ -1,3 +1,3 @@
1
- from .utils import remove_namespace
1
+ from .utils import remove_namespace_from_uri
2
2
 
3
- __all__ = ["remove_namespace"]
3
+ __all__ = ["remove_namespace_from_uri"]
@@ -75,14 +75,14 @@ def _get_cognite_client(config: CogniteClientConfig, credentials: CredentialProv
75
75
 
76
76
 
77
77
  @overload
78
- def remove_namespace(*URI: URIRef | str, special_separator: str = "#_") -> str: ...
78
+ def remove_namespace_from_uri(*URI: URIRef | str, special_separator: str = "#_") -> str: ...
79
79
 
80
80
 
81
81
  @overload
82
- def remove_namespace(*URI: tuple[URIRef | str, ...], special_separator: str = "#_") -> tuple[str, ...]: ...
82
+ def remove_namespace_from_uri(*URI: tuple[URIRef | str, ...], special_separator: str = "#_") -> tuple[str, ...]: ...
83
83
 
84
84
 
85
- def remove_namespace(
85
+ def remove_namespace_from_uri(
86
86
  *URI: URIRef | str | tuple[URIRef | str, ...], special_separator: str = "#_"
87
87
  ) -> tuple[str, ...] | str:
88
88
  """Removes namespace from URI
@@ -99,9 +99,9 @@ def remove_namespace(
99
99
 
100
100
  Examples:
101
101
 
102
- >>> remove_namespace("http://www.example.org/index.html#section2")
102
+ >>> remove_namespace_from_uri("http://www.example.org/index.html#section2")
103
103
  'section2'
104
- >>> remove_namespace("http://www.example.org/index.html#section2", "http://www.example.org/index.html#section3")
104
+ >>> remove_namespace_from_uri("http://www.example.org/index.html#section2", "http://www.example.org/index.html#section3")
105
105
  ('section2', 'section3')
106
106
  """
107
107
  if isinstance(URI, str | URIRef):
@@ -149,7 +149,7 @@ def get_namespace(URI: URIRef, special_separator: str = "#_") -> str:
149
149
 
150
150
  def as_neat_compliant_uri(uri: URIRef) -> URIRef:
151
151
  namespace = get_namespace(uri)
152
- id_ = remove_namespace(uri)
152
+ id_ = remove_namespace_from_uri(uri)
153
153
  compliant_uri = re.sub(r"[^a-zA-Z0-9-_.]", "", id_)
154
154
  return URIRef(f"{namespace}{compliant_uri}")
155
155
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: cognite-neat
3
- Version: 0.85.5
3
+ Version: 0.85.7
4
4
  Summary: Knowledge graph transformation
5
5
  Home-page: https://cognite-neat.readthedocs-hosted.com/
6
6
  License: Apache-2.0
@@ -1,6 +1,6 @@
1
1
  cognite/neat/__init__.py,sha256=AiexNcHdAHFbrrbo9c65gtil1dqx_SGraDH1PSsXjKE,126
2
2
  cognite/neat/_shared.py,sha256=RSaHm2eJceTlvb-hMMe4nHgoHdPYDfN3XcxDXo24k3A,1530
3
- cognite/neat/_version.py,sha256=Tr9RYWtVRguPKI4me4ekNXumFuIg46vts7VTq9NDVzw,23
3
+ cognite/neat/_version.py,sha256=hVJ3xHshW3ChykiL5r0Maacil2KmJncrUYZGRzPoqic,23
4
4
  cognite/neat/app/api/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
5
5
  cognite/neat/app/api/asgi/metrics.py,sha256=nxFy7L5cChTI0a-zkCiJ59Aq8yLuIJp5c9Dg0wRXtV0,152
6
6
  cognite/neat/app/api/configuration.py,sha256=2U5M6M252swvQPQyooA1EBzFUZNtcTmuSaywfJDgckM,4232
@@ -12,7 +12,7 @@ cognite/neat/app/api/explorer.py,sha256=OlLI-RbQGjXEuDgtmFfBuTXfnRVemTJDKbL9VvXL
12
12
  cognite/neat/app/api/routers/configuration.py,sha256=rg9GihPPYjgNj1n_wWqfASO4iMXWh_US5sgNJCwejCE,585
13
13
  cognite/neat/app/api/routers/core.py,sha256=cHMX0JoxFHQB65VkFCvOprSkO8tFydECYtVFfRq9yfE,3523
14
14
  cognite/neat/app/api/routers/crud.py,sha256=VCQMjvcLosELkmMZRiunyd-RK5sltQFjcCSrGk5kwXc,4597
15
- cognite/neat/app/api/routers/data_exploration.py,sha256=j2dEg9Hng5-wg5C_7O2Mym8pVkKJBuflshTaBGmj6Mo,13686
15
+ cognite/neat/app/api/routers/data_exploration.py,sha256=243dZcMJU-ZE-pSu2oIJMbQQmpyo-74i4Vtd7d1mgbg,13704
16
16
  cognite/neat/app/api/routers/metrics.py,sha256=S_bUQk_GjfQq7WbEhSVdow4MUYBZ_bZNafzgcKogXK8,210
17
17
  cognite/neat/app/api/routers/rules.py,sha256=MECSzurNe7y07-GfsggBDmfNtYkFuLdAm9ogSjLbzzk,8121
18
18
  cognite/neat/app/api/routers/workflows.py,sha256=fPqNT0swH-sfcjD8PLK5NzKY1sVSU7GaCMkHfH78gxw,12393
@@ -57,7 +57,7 @@ cognite/neat/graph/exceptions.py,sha256=R6pyOH774n9w2x_X_nrUr8OMAdjJMf_XPIqAvxIQ
57
57
  cognite/neat/graph/extractors/__init__.py,sha256=nXcNp6i3-1HteIkr8Ujxk4b09W5jk27Q3eWuwjcnGnM,1647
58
58
  cognite/neat/graph/extractors/_base.py,sha256=8IWygpkQTwo0UOmbbwWVI7540_klTVdUVX2JjVPFRIs,498
59
59
  cognite/neat/graph/extractors/_classic_cdf/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
60
- cognite/neat/graph/extractors/_classic_cdf/_assets.py,sha256=Hu-RoTBhn4LFm38G51L5tc0MVy4-zr1POHWyrIB-vUc,4130
60
+ cognite/neat/graph/extractors/_classic_cdf/_assets.py,sha256=xrinx9SF9WMrrbbsYr2eSi7ZGOmlia3ltPq573fAoVg,4809
61
61
  cognite/neat/graph/extractors/_classic_cdf/_events.py,sha256=SGZWKCxppECIQkwQs5M2e_SoF-eGilCW2KiyXk2PmzM,4230
62
62
  cognite/neat/graph/extractors/_classic_cdf/_files.py,sha256=o35K0_ouq7hjR_lAVRjWbuRsuAzlS78S_97am5TFU5A,5129
63
63
  cognite/neat/graph/extractors/_classic_cdf/_labels.py,sha256=4JxQHPDciMjbk7F6GxMa-HfhOgAv8LT3VO3mRfEgQ0E,2832
@@ -65,19 +65,19 @@ cognite/neat/graph/extractors/_classic_cdf/_relationships.py,sha256=jgIN__nztlhL
65
65
  cognite/neat/graph/extractors/_classic_cdf/_sequences.py,sha256=5FuhwpgDiGG51C0bQacQ4LD6KkutUaU1cX2NSy_krhU,3652
66
66
  cognite/neat/graph/extractors/_classic_cdf/_timeseries.py,sha256=Ui7WRAvot3KJFwpzqmEYvRs3cN0qh93ocJjYaNLfH30,4811
67
67
  cognite/neat/graph/extractors/_dexpi.py,sha256=xIw3kSaQ17k_bAuecvrVRic70PUhFHtcyy-ReLt36Q4,9385
68
- cognite/neat/graph/extractors/_mock_graph_generator.py,sha256=1TjgbxDVwgZjivIqx1lLKwggn_zHqWLiYM26esgDAMs,14694
68
+ cognite/neat/graph/extractors/_mock_graph_generator.py,sha256=w6lIgwvVwkvK725S9MLFZU8lLxjxXt_621_nChupAkQ,14791
69
69
  cognite/neat/graph/extractors/_rdf_file.py,sha256=ialMCLv9WH5k6v1YMfozfcmAYhz8OVo9jVhsKMyQkDA,763
70
70
  cognite/neat/graph/issues/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
71
71
  cognite/neat/graph/issues/loader.py,sha256=v8YDsehkUT1QUG61JM9BDV_lqowMUnDmGmbay0aFzN4,3085
72
72
  cognite/neat/graph/loaders/__init__.py,sha256=BteVkTklPVUB2W-bbzZug-cEUrx8ZFA-YcQPSxWVpTI,678
73
- cognite/neat/graph/loaders/_base.py,sha256=t33I-Olw0xYz3Icf2RJZq9cs5_dEKeY87npxsA597Sw,3012
73
+ cognite/neat/graph/loaders/_base.py,sha256=yIXJ7H5VeVb_mqMCM36BYyEOQMbIZcV60RxqD-Xrj-Y,3032
74
74
  cognite/neat/graph/loaders/_rdf2asset.py,sha256=aFby7BwIrW253LEJ4XqGeUuf4jG9VUe8Lg7OlUnXMlM,4493
75
- cognite/neat/graph/loaders/_rdf2dms.py,sha256=eIev7iiNCvzmLA18L6cZb3muGlCvP_t-4Rd48BQHmvY,13825
75
+ cognite/neat/graph/loaders/_rdf2dms.py,sha256=2PCL8De02xlEkTmgG299k5tiZcKPnoNzCQfI1AgS2Gg,14060
76
76
  cognite/neat/graph/models.py,sha256=AtLgZh2qyRP6NRetjQCy9qLMuTQB0CH52Zsev-qa2sk,149
77
77
  cognite/neat/graph/queries/__init__.py,sha256=BgDd-037kvtWwAoGAy8eORVNMiZ5-E9sIV0txIpeaN4,50
78
- cognite/neat/graph/queries/_base.py,sha256=pSc6nHpcDEStGtIeeboAI-QD2PbckWaaNMK3As04jOI,4658
78
+ cognite/neat/graph/queries/_base.py,sha256=RL6YQu4apWG-WM-b1TDu5IKqsvskE6Cvlmo8rr1Trhk,5199
79
79
  cognite/neat/graph/queries/_construct.py,sha256=FxzSQqzCpo7lKVYerlLAY03oqCeFM5L6MozfBUblzr4,7341
80
- cognite/neat/graph/queries/_shared.py,sha256=EwW2RbPttt7-z7QTgfKWlthA2Nq5d3bYyyewFkCA7R4,5043
80
+ cognite/neat/graph/queries/_shared.py,sha256=1-cBnoqyHQazOdNc7J5kk-_GrlHSSnYsBdNJcRD5QyI,5061
81
81
  cognite/neat/graph/stores/__init__.py,sha256=G-VG_YwfRt1kuPao07PDJyZ3w_0-eguzLUM13n-Z_RA,64
82
82
  cognite/neat/graph/stores/_base.py,sha256=z69uhzBhzl1JQJU9U-h9zAyySn25ZQTJRXam4BavnoY,10586
83
83
  cognite/neat/graph/stores/_oxrdflib.py,sha256=A5zeRm5_e8ui_ihGpgstRDg_N7qcLZ3QZBRGrOXSGI0,9569
@@ -97,16 +97,16 @@ cognite/neat/legacy/graph/extractors/__init__.py,sha256=wqCiqz-sXhUpTL5LRcrl_KFT
97
97
  cognite/neat/legacy/graph/extractors/_base.py,sha256=ohiuEzwZ1Fh9ers07MCbjGOGQ0HLb-ctwgEvGy7o_AQ,363
98
98
  cognite/neat/legacy/graph/extractors/_dexpi.py,sha256=KIGkMYFGRSp86DASARSk77z-qzHqf-MMZkgZjq3rRWw,1613
99
99
  cognite/neat/legacy/graph/extractors/_graph_capturing_sheet.py,sha256=sEV6P4a4OlFx_O-vtKoB1H-ex1RnD5VhqmBcazGfLwk,17695
100
- cognite/neat/legacy/graph/extractors/_mock_graph_generator.py,sha256=op4eN0-YNzBZoQUkU0OVmaqFNMMwzgpOEjoxqI4034U,14908
100
+ cognite/neat/legacy/graph/extractors/_mock_graph_generator.py,sha256=v_nEpNmrpUiA3SZpv37NFjKweS8DX4ahyy-9VCfg4Bc,14956
101
101
  cognite/neat/legacy/graph/loaders/__init__.py,sha256=Nap1LGaXA3AotL5U6pwY1Yc3J92Y7GC60qVPBhGl5LA,701
102
- cognite/neat/legacy/graph/loaders/_asset_loader.py,sha256=aYYD4Nb8TMLc4KKYDHD-wa5pswLyg2Vlhj6yZuTCLic,23823
102
+ cognite/neat/legacy/graph/loaders/_asset_loader.py,sha256=UqjUm7aU826pONywpUCbdGNYdpL0uUOKdOTXhvRHaZY,23868
103
103
  cognite/neat/legacy/graph/loaders/_base.py,sha256=oj1vo8dGPXxJORQXPa_kJa5G53VZBXOiIoWOngtMw5E,2383
104
104
  cognite/neat/legacy/graph/loaders/_exceptions.py,sha256=Ep59S5ExVG7phHpfcMEpHu82ApLbkIlvfQnWAt5p1sE,2835
105
105
  cognite/neat/legacy/graph/loaders/core/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
106
106
  cognite/neat/legacy/graph/loaders/core/labels.py,sha256=z_03w35RcAWtJFVV94jCobHlT1d2AfoJa8FgMSrHBeA,2321
107
107
  cognite/neat/legacy/graph/loaders/core/models.py,sha256=47KwgRuMAwTbDwPC_yRmyhhOVvqTiwgApQEPCFlmU24,5023
108
- cognite/neat/legacy/graph/loaders/core/rdf_to_assets.py,sha256=83S992R6CcK6f492bLrER2AkoUZYGu3oDZefrqXv6ek,40466
109
- cognite/neat/legacy/graph/loaders/core/rdf_to_relationships.py,sha256=hkjCKE7coNbNBbduzy1GCT2Lgt4dtfTrke2_Pl9S67I,22707
108
+ cognite/neat/legacy/graph/loaders/core/rdf_to_assets.py,sha256=6ZzXwFWSQt8TFDC8osvk8kY2nuIRgtTS60Q1Bb-9Kz0,40502
109
+ cognite/neat/legacy/graph/loaders/core/rdf_to_relationships.py,sha256=sc_a42LqANgxdVurjt-9jQll3hMr_xvDG8lfJ9-O6fA,22725
110
110
  cognite/neat/legacy/graph/loaders/rdf_to_dms.py,sha256=v1Fjsf69RCxDo_YdYNJBgsmxy5sbmjIYONQKiSUAstI,12979
111
111
  cognite/neat/legacy/graph/loaders/validator.py,sha256=JiEp3gJUzJ8JIbb2crFfFCZ_3cGviXbb31aGusXAM_Y,3328
112
112
  cognite/neat/legacy/graph/models.py,sha256=AtLgZh2qyRP6NRetjQCy9qLMuTQB0CH52Zsev-qa2sk,149
@@ -120,8 +120,8 @@ cognite/neat/legacy/graph/stores/_rdf_to_graph.py,sha256=1ezWHTPn9UkIsAlxZcYRlqW
120
120
  cognite/neat/legacy/graph/transformations/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
121
121
  cognite/neat/legacy/graph/transformations/entity_matcher.py,sha256=CakXdgGMYXnyaihE1fFGWNcXSDuOV5F454m8URt00Rw,4765
122
122
  cognite/neat/legacy/graph/transformations/query_generator/__init__.py,sha256=9N7RIlM8Pf-mJXzK8ulBe-eAa3yeHYBsBFQF7geTgWE,73
123
- cognite/neat/legacy/graph/transformations/query_generator/sparql.py,sha256=v-o1JJiMhaCLMVI1DP7Y8iEFHvkCMRSPZ1jTgNKqwZY,18719
124
- cognite/neat/legacy/graph/transformations/transformer.py,sha256=FnpjVpJ5Ud6Yho57s06GPKUrgTBm9e2y4XRf03FEzek,14737
123
+ cognite/neat/legacy/graph/transformations/query_generator/sparql.py,sha256=RtDdnqxB7-5qXHnMxYK18SeJ5-8JPwm8zALqrJjpQtc,18737
124
+ cognite/neat/legacy/graph/transformations/transformer.py,sha256=Xb6LjDsxT5SRUTs6RhZyiE1AlKplhUKkwIfmBxkcp8s,14755
125
125
  cognite/neat/legacy/rules/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
126
126
  cognite/neat/legacy/rules/analysis.py,sha256=-PWaFqzvMlUA6nrZissMvoQm8xwFqniIDApZSUWs9sA,8610
127
127
  cognite/neat/legacy/rules/examples/Rules-Nordic44-to-graphql.xlsx,sha256=KxiQxBdBWaXYvVAwUwVSazpDjHaG8CXamg24ZUf9Nqw,80404
@@ -143,7 +143,7 @@ cognite/neat/legacy/rules/exporters/_core/rules2labels.py,sha256=CDcSwR7TsUGEIsY
143
143
  cognite/neat/legacy/rules/exporters/_rules2dms.py,sha256=13CptTLvY9ghcrLPhumUOg6PeeIZHFDjXjNDSQPK5B8,36813
144
144
  cognite/neat/legacy/rules/exporters/_rules2excel.py,sha256=ytHsqw2j26T9yLNZHuUSItV8Jp3AvvpIwX8D5-L9GO8,8312
145
145
  cognite/neat/legacy/rules/exporters/_rules2graphql.py,sha256=oXBU5z-qFyxG7MW83HYlW-hazhDDNAPKAbJJcsZfcU4,6251
146
- cognite/neat/legacy/rules/exporters/_rules2ontology.py,sha256=m6adoKOP5EVVEjFX4Qi9yw7UflrDRVgNiBxQ9QVgz6g,18458
146
+ cognite/neat/legacy/rules/exporters/_rules2ontology.py,sha256=9rjVjLi6rbPhlRrIyJVzPBJ4piFnsEKaB4uVitokXaY,18539
147
147
  cognite/neat/legacy/rules/exporters/_rules2pydantic_models.py,sha256=YqiyTzAD0vEEhLbIPNTkK0AzKUG0yfBjz47Rg1mSTq8,28949
148
148
  cognite/neat/legacy/rules/exporters/_rules2rules.py,sha256=KlBm1hWkx4Ly5G-_gdcURUwADolMJFnueus02IW51uQ,3881
149
149
  cognite/neat/legacy/rules/exporters/_rules2triples.py,sha256=ItkLy6Rji4g5UqLtxaOeodGUvpQG-LVr_ss70PcCPZs,1085
@@ -152,12 +152,12 @@ cognite/neat/legacy/rules/importers/__init__.py,sha256=h1owL8pBPEtOmlIFAdkqAABH1
152
152
  cognite/neat/legacy/rules/importers/_base.py,sha256=L0eMYB-Lf5sssQmXAd9ZlUzT6vcAIMeEvM833bMYn0w,2273
153
153
  cognite/neat/legacy/rules/importers/_dict2rules.py,sha256=scUoMMZoc0CEfsbU999cPMyG1hMzNRDTovj8ff8Lrhk,6476
154
154
  cognite/neat/legacy/rules/importers/_dms2rules.py,sha256=0MbqBQT1oTm2ekxtPXYKHXbFGxVRWTIiufzodmFKOvw,7697
155
- cognite/neat/legacy/rules/importers/_graph2rules.py,sha256=RIRN7WGOH9i2sz75dPYOaXnbcHhhrRBBX5eTxLmuXLU,12179
155
+ cognite/neat/legacy/rules/importers/_graph2rules.py,sha256=FTP28hI3gbZyCxGBW9aJwW0SZnNG2HR5Skn-9dYAJI0,12215
156
156
  cognite/neat/legacy/rules/importers/_json2rules.py,sha256=ko0sC3-xO3ne_PQn5aF0L5SsA8m48SN2bnqmBgjkylc,1610
157
157
  cognite/neat/legacy/rules/importers/_owl2rules/__init__.py,sha256=tdGcrgtozdQyST-pTlxIa4cLBNTLvtk1nNYR4vOdFSw,63
158
- cognite/neat/legacy/rules/importers/_owl2rules/_owl2classes.py,sha256=5N3mCff3LumdPn8L6-5WRQD6Tk_nEie1CErD0QSu8to,8304
158
+ cognite/neat/legacy/rules/importers/_owl2rules/_owl2classes.py,sha256=OlOttWnmbez353_Oc6zgjZtgBC7zMrfoZqyUCtDiyx0,8331
159
159
  cognite/neat/legacy/rules/importers/_owl2rules/_owl2metadata.py,sha256=1glhaiJA0AuBxTgUQBgKPuFUqI-0fVmbVIZnxe8OrDY,9407
160
- cognite/neat/legacy/rules/importers/_owl2rules/_owl2properties.py,sha256=_3bpFi8322j-GiqXZUZI2MAjEFg9IKdWp4lYtgl3nTY,8019
160
+ cognite/neat/legacy/rules/importers/_owl2rules/_owl2properties.py,sha256=FLg2ICJiHr3HYIYuxUIopyzzcIGDkgUMgIL_vkSlOOI,8064
161
161
  cognite/neat/legacy/rules/importers/_owl2rules/_owl2rules.py,sha256=SnfR2ZuJlrnwWTuSNNu4cQTazj2DoYdTHSEZpax1QSg,10557
162
162
  cognite/neat/legacy/rules/importers/_spreadsheet2rules.py,sha256=gaDlCqB7M0j0rud-awjlunvBOQlgbK912wabsSBqpsc,1502
163
163
  cognite/neat/legacy/rules/importers/_xsd2rules.py,sha256=ZR_FAzZUgfZVEFLEVDDJIH4GIsxo7y7-KdozVeyYlS0,421
@@ -182,9 +182,9 @@ cognite/neat/legacy/workflows/examples/Visualize_Semantic_Data_Model/workflow.ya
182
182
  cognite/neat/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
183
183
  cognite/neat/rules/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
184
184
  cognite/neat/rules/_shared.py,sha256=Ak2K9YnLhvmp8womNI3bmjaooQZkY9E33-DJ97P9wZg,195
185
- cognite/neat/rules/analysis/__init__.py,sha256=J2yL0QWSvXOWLbaYPyA0HXHh3aqOWmkwobScdgVQpw8,115
186
- cognite/neat/rules/analysis/_base.py,sha256=PmN5NLgGsovsHtsnvUzc_zuarWl-Xwk1azWcYKKuWdA,669
187
- cognite/neat/rules/analysis/_information_rules.py,sha256=fdSMyInsPJdgLHKwSkj2N9bcEXld9ETxUIXWqeDH8L4,17478
185
+ cognite/neat/rules/analysis/__init__.py,sha256=ne6VlpFloufvxddDMbm7pLugnRpDv6ymaxB6_1XBxXw,188
186
+ cognite/neat/rules/analysis/_base.py,sha256=JLYWYM6ZOviH_Lfu-kMX8UYmGHKt2LHq2BMITL-Plrw,395
187
+ cognite/neat/rules/analysis/_information_rules.py,sha256=EW0hDTsYSaWgfdndLg299q4jlq1r0dZkP2Gmnj8R2Ew,20846
188
188
  cognite/neat/rules/examples/__init__.py,sha256=nxIwueAcHgZhkYriGxnDLQmIyiT8PByPHbScjYKDKe0,374
189
189
  cognite/neat/rules/examples/wind-energy.owl,sha256=NuomCA9FuuLF0JlSuG3OKqD4VBcHgSjDKFLV17G1zV8,65934
190
190
  cognite/neat/rules/exceptions.py,sha256=YLnsbXXJdDSr_szQoioEtOdqDV8PR7RdQjpMP2SWeCs,123868
@@ -192,22 +192,22 @@ cognite/neat/rules/exporters/__init__.py,sha256=nRMUBUf7yr1QPjyITeX2rTLtLLawHv24
192
192
  cognite/neat/rules/exporters/_base.py,sha256=qZt236sNKTbiM41sgVEYcEtuK5v8Pt14LMLBNiZrNWs,1936
193
193
  cognite/neat/rules/exporters/_rules2dms.py,sha256=xK9xXJ7lLQnzrRlBUJQVLlY4SC-vnnjGUXOzaWvOKmY,14553
194
194
  cognite/neat/rules/exporters/_rules2excel.py,sha256=bVYq0zmMLDEzSDD39_DQOL6rFGBgRMq5lE7xVMAg8i8,14328
195
- cognite/neat/rules/exporters/_rules2ontology.py,sha256=bt8IuxaAYFRyZc1AlS-gYw9Jf6jBr5CYFOaJ3qPeoaA,20527
195
+ cognite/neat/rules/exporters/_rules2ontology.py,sha256=h5akLKnhVxRfIiOredA3ILqD4qr-qizyP0gd6oNmswo,20608
196
196
  cognite/neat/rules/exporters/_rules2yaml.py,sha256=GA8eUYRxUfIU6IMvlyGO5JidkOD5eUKSbH3qAiFiaCg,3026
197
197
  cognite/neat/rules/exporters/_validation.py,sha256=OlKIyf4nhSDehJwFHDQ8Zdf6HpNfW7dSe2s67eywHu4,4078
198
198
  cognite/neat/rules/importers/__init__.py,sha256=Vxl2Iq1dMXUsI6Wb411xPI3rromdq50xZUci-S8faSw,1097
199
- cognite/neat/rules/importers/_base.py,sha256=3LmDfR-f0nlLGcioWB8IbeZJ6uW5dvnzxJlqaMWc-u0,4516
199
+ cognite/neat/rules/importers/_base.py,sha256=C8_Q99H3Sxds7HO_5aLkw8PItk3Zojxbz4uwx1xgxQM,4550
200
200
  cognite/neat/rules/importers/_dms2rules.py,sha256=Dqoh4qO5IVvjRpxLHZaqCgPC99_r4y7ncEo2WYMxwqU,19302
201
201
  cognite/neat/rules/importers/_dtdl2rules/__init__.py,sha256=CNR-sUihs2mnR1bPMKs3j3L4ds3vFTsrl6YycExZTfU,68
202
202
  cognite/neat/rules/importers/_dtdl2rules/_unit_lookup.py,sha256=wW4saKva61Q_i17guY0dc4OseJDQfqHy_QZBtm0OD6g,12134
203
203
  cognite/neat/rules/importers/_dtdl2rules/dtdl_converter.py,sha256=ysmWUxZ0npwrTB0uiH5jA0v37sfCwowGaYk17IyxPUU,12663
204
204
  cognite/neat/rules/importers/_dtdl2rules/dtdl_importer.py,sha256=Psj3C2jembY_Wu7WWJIFIwrMawvjISjeqfBnoRy_csw,6740
205
205
  cognite/neat/rules/importers/_dtdl2rules/spec.py,sha256=tim_MfN1J0F3Oeqk3BMgIA82d_MZvhRuRMsLK3B4PYc,11897
206
- cognite/neat/rules/importers/_inference2rules.py,sha256=YJl1xlPDH4lypCQedQh6uQwGwtWTQ466p63bEo_x8Rk,11765
206
+ cognite/neat/rules/importers/_inference2rules.py,sha256=TlzTpO1IUyeUjODuDLqnlC-LeLhT-S6V6OpL-5YSQRo,11801
207
207
  cognite/neat/rules/importers/_owl2rules/__init__.py,sha256=tdGcrgtozdQyST-pTlxIa4cLBNTLvtk1nNYR4vOdFSw,63
208
- cognite/neat/rules/importers/_owl2rules/_owl2classes.py,sha256=QpTxvrTGczIa48X8lgXGnMN1AWPhHK0DR6uNq175xak,7357
208
+ cognite/neat/rules/importers/_owl2rules/_owl2classes.py,sha256=dACjYeCa_OhpQgqccI4w478dEINbISUMzpVkCOoRRL8,7384
209
209
  cognite/neat/rules/importers/_owl2rules/_owl2metadata.py,sha256=nwnUaBNAAYMoBre2UmsnkJXUuaqGEpR3U3txDrH2w6g,7527
210
- cognite/neat/rules/importers/_owl2rules/_owl2properties.py,sha256=eKr-e-ZTTV54PJ9UXNVPTT_c9XxszNPraS4Y43AF7qQ,7297
210
+ cognite/neat/rules/importers/_owl2rules/_owl2properties.py,sha256=3-yiCyh5In7jLhIytEK7ktG9suuv6QMa5xCs2TQvHZM,7342
211
211
  cognite/neat/rules/importers/_owl2rules/_owl2rules.py,sha256=41_wZFvt0A6TI55zlT04oQkvU7V73li4aGLgc4T4Lxo,6358
212
212
  cognite/neat/rules/importers/_spreadsheet2rules.py,sha256=vyYXNvP64dBGTWRWfrg7wtUcs0PdPiGLAHwE8itItAA,13072
213
213
  cognite/neat/rules/importers/_yaml2rules.py,sha256=F0uksSz1A3po5OlRM2152_w5j8D9oYTLB9NFTkSMlWI,4275
@@ -250,7 +250,7 @@ cognite/neat/rules/models/information/_rules_input.py,sha256=1aVaF7VrqaLR-NOq4RR
250
250
  cognite/neat/rules/models/information/_serializer.py,sha256=yti9I_xJruxrib66YIBInhze___Io-oPTQH6uWDumPE,3503
251
251
  cognite/neat/rules/models/information/_validation.py,sha256=K4RTd1I8jrqTHUaPFtAQ8bvS8a4ES9efqXRqQX9wQ8I,8258
252
252
  cognite/neat/rules/models/wrapped_entities.py,sha256=ThhjnNNrpgz0HeORIQ8Q894trxP73P7T_TuZj6qH2CU,7157
253
- cognite/neat/utils/__init__.py,sha256=l5Nyqhqo25bcQXCOb_lk01cr-UXsG8cczz_y_I0u6bg,68
253
+ cognite/neat/utils/__init__.py,sha256=xVSUPJx1FWz3KJzcp6E1KQopKT0TrK3eAAzCw8S4r-0,86
254
254
  cognite/neat/utils/auth.py,sha256=rBzx92IN4xGj3UK95UExKlK2dCwQi3svTZ_YBMWaTVo,11739
255
255
  cognite/neat/utils/auxiliary.py,sha256=IOVbr6lPQulMJUyrrhfSsF6lIHch0Aw6KszMkBomprc,1248
256
256
  cognite/neat/utils/cdf.py,sha256=piRx-6GRz4cCfBZD5rU0OM6ixQ3cj5TMzI0yCYUveR8,2422
@@ -264,7 +264,7 @@ cognite/neat/utils/exceptions.py,sha256=-w4cAcvcoWLf-_ZwAl7QV_NysfqtQzIOd1Ti-mpx
264
264
  cognite/neat/utils/spreadsheet.py,sha256=LI0c7dlW0zXHkHw0NvB-gg6Df6cDcE3FbiaHBYLXdzQ,2714
265
265
  cognite/neat/utils/text.py,sha256=4bg1_Q0lg7KsoxaDOvXrVyeY78BJN8i-27BlyDzUCls,3082
266
266
  cognite/neat/utils/upload.py,sha256=nZEuDu22A1kTbl-ctzAJ2vx1cjiQtqdDdpC_mRRMvUI,3597
267
- cognite/neat/utils/utils.py,sha256=1LEwR8gpHw_6pvEeLkW_cDU_lUun4qSsw_Rr3JsKwgA,14172
267
+ cognite/neat/utils/utils.py,sha256=vtrBrjMqLIdPuIPEY9MwEEvzeu7vm-regFcU8y4pzeI,14226
268
268
  cognite/neat/utils/xml_.py,sha256=ppLT3lQKVp8wOP-m8-tFY8uB2P4R76l7R_-kUtsABng,992
269
269
  cognite/neat/workflows/__init__.py,sha256=oiKub_U9f5cA0I1nKl5dFkR4BD8_6Be9eMzQ_50PwP0,396
270
270
  cognite/neat/workflows/_exceptions.py,sha256=ugI_X1XNpikAiL8zIggBjcx6q7WvOpRIgvxHrj2Rhr4,1348
@@ -310,8 +310,8 @@ cognite/neat/workflows/steps_registry.py,sha256=fkTX14ZA7_gkUYfWIlx7A1XbCidvqR23
310
310
  cognite/neat/workflows/tasks.py,sha256=dqlJwKAb0jlkl7abbY8RRz3m7MT4SK8-7cntMWkOYjw,788
311
311
  cognite/neat/workflows/triggers.py,sha256=_BLNplzoz0iic367u1mhHMHiUrCwP-SLK6_CZzfODX0,7071
312
312
  cognite/neat/workflows/utils.py,sha256=gKdy3RLG7ctRhbCRwaDIWpL9Mi98zm56-d4jfHDqP1E,453
313
- cognite_neat-0.85.5.dist-info/LICENSE,sha256=W8VmvFia4WHa3Gqxq1Ygrq85McUNqIGDVgtdvzT-XqA,11351
314
- cognite_neat-0.85.5.dist-info/METADATA,sha256=aeXhhGATA7p_GWW8d1gcuJTSszg_CtwUrF0ORagIW0I,9493
315
- cognite_neat-0.85.5.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
316
- cognite_neat-0.85.5.dist-info/entry_points.txt,sha256=61FPqiWb25vbqB0KI7znG8nsg_ibLHBvTjYnkPvNFso,50
317
- cognite_neat-0.85.5.dist-info/RECORD,,
313
+ cognite_neat-0.85.7.dist-info/LICENSE,sha256=W8VmvFia4WHa3Gqxq1Ygrq85McUNqIGDVgtdvzT-XqA,11351
314
+ cognite_neat-0.85.7.dist-info/METADATA,sha256=FOumx12OP-CCVVbdM2preeoHr-pPzrxnLKzYbaGsETU,9493
315
+ cognite_neat-0.85.7.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
316
+ cognite_neat-0.85.7.dist-info/entry_points.txt,sha256=61FPqiWb25vbqB0KI7znG8nsg_ibLHBvTjYnkPvNFso,50
317
+ cognite_neat-0.85.7.dist-info/RECORD,,