cognite-neat 0.119.8__py3-none-any.whl → 0.120.0__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 (188) hide show
  1. cognite/neat/__init__.py +3 -2
  2. cognite/neat/_version.py +1 -1
  3. cognite/neat/{_client → core/_client}/_api/data_modeling_loaders.py +5 -5
  4. cognite/neat/{_client → core/_client}/_api/neat_instances.py +1 -1
  5. cognite/neat/{_client → core/_client}/_api/schema.py +9 -5
  6. cognite/neat/{_client → core/_client}/_api_client.py +1 -1
  7. cognite/neat/{_client → core/_client}/data_classes/schema.py +4 -4
  8. cognite/neat/{_client → core/_client}/testing.py +1 -1
  9. cognite/neat/{_constants.py → core/_constants.py} +27 -8
  10. cognite/neat/{_graph → core/_graph}/_tracking/base.py +1 -1
  11. cognite/neat/{_graph → core/_graph}/_tracking/log.py +1 -1
  12. cognite/neat/{_graph → core/_graph}/extractors/__init__.py +1 -1
  13. cognite/neat/{_graph → core/_graph}/extractors/_base.py +6 -6
  14. cognite/neat/{_graph → core/_graph}/extractors/_classic_cdf/_base.py +23 -7
  15. cognite/neat/{_graph → core/_graph}/extractors/_classic_cdf/_classic.py +16 -12
  16. cognite/neat/{_graph → core/_graph}/extractors/_classic_cdf/_relationships.py +5 -3
  17. cognite/neat/{_graph → core/_graph}/extractors/_classic_cdf/_sequences.py +7 -2
  18. cognite/neat/{_graph → core/_graph}/extractors/_classic_cdf/_timeseries.py +10 -3
  19. cognite/neat/{_graph → core/_graph}/extractors/_dict.py +2 -2
  20. cognite/neat/{_graph → core/_graph}/extractors/_dms.py +6 -6
  21. cognite/neat/{_graph → core/_graph}/extractors/_dms_graph.py +15 -11
  22. cognite/neat/{_graph → core/_graph}/extractors/_mock_graph_generator.py +10 -10
  23. cognite/neat/{_graph → core/_graph}/extractors/_raw.py +3 -3
  24. cognite/neat/{_graph → core/_graph}/extractors/_rdf_file.py +10 -7
  25. cognite/neat/{_graph → core/_graph}/loaders/_base.py +5 -5
  26. cognite/neat/{_graph → core/_graph}/loaders/_rdf2dms.py +31 -18
  27. cognite/neat/{_graph → core/_graph}/queries/_select.py +3 -3
  28. cognite/neat/{_graph → core/_graph}/queries/_update.py +1 -1
  29. cognite/neat/{_graph → core/_graph}/transformers/_base.py +8 -4
  30. cognite/neat/{_graph → core/_graph}/transformers/_classic_cdf.py +6 -6
  31. cognite/neat/{_graph → core/_graph}/transformers/_prune_graph.py +4 -4
  32. cognite/neat/{_graph → core/_graph}/transformers/_rdfpath.py +1 -1
  33. cognite/neat/{_graph → core/_graph}/transformers/_value_type.py +8 -4
  34. cognite/neat/{_issues → core/_issues}/_base.py +12 -5
  35. cognite/neat/{_issues → core/_issues}/_contextmanagers.py +1 -1
  36. cognite/neat/{_issues → core/_issues}/_factory.py +2 -2
  37. cognite/neat/{_issues → core/_issues}/errors/__init__.py +1 -1
  38. cognite/neat/{_issues → core/_issues}/errors/_external.py +1 -1
  39. cognite/neat/{_issues → core/_issues}/errors/_general.py +1 -1
  40. cognite/neat/{_issues → core/_issues}/errors/_properties.py +1 -1
  41. cognite/neat/{_issues → core/_issues}/errors/_resources.py +7 -2
  42. cognite/neat/{_issues → core/_issues}/errors/_wrapper.py +2 -2
  43. cognite/neat/{_issues → core/_issues}/warnings/__init__.py +1 -1
  44. cognite/neat/{_issues → core/_issues}/warnings/_external.py +1 -1
  45. cognite/neat/{_issues → core/_issues}/warnings/_general.py +1 -1
  46. cognite/neat/{_issues → core/_issues}/warnings/_models.py +2 -2
  47. cognite/neat/{_issues → core/_issues}/warnings/_properties.py +2 -2
  48. cognite/neat/{_issues → core/_issues}/warnings/_resources.py +6 -1
  49. cognite/neat/{_issues → core/_issues}/warnings/user_modeling.py +1 -1
  50. cognite/neat/{_rules → core/_rules}/_shared.py +6 -4
  51. cognite/neat/{_rules → core/_rules}/analysis/_base.py +15 -8
  52. cognite/neat/{_rules → core/_rules}/exporters/_base.py +7 -7
  53. cognite/neat/{_rules → core/_rules}/exporters/_rules2dms.py +15 -9
  54. cognite/neat/{_rules → core/_rules}/exporters/_rules2excel.py +219 -163
  55. cognite/neat/{_rules → core/_rules}/exporters/_rules2instance_template.py +4 -4
  56. cognite/neat/{_rules → core/_rules}/exporters/_rules2ontology.py +10 -10
  57. cognite/neat/{_rules → core/_rules}/exporters/_rules2yaml.py +1 -1
  58. cognite/neat/{_rules → core/_rules}/exporters/_validation.py +2 -2
  59. cognite/neat/{_rules → core/_rules}/importers/_base.py +5 -5
  60. cognite/neat/{_rules → core/_rules}/importers/_dms2rules.py +20 -12
  61. cognite/neat/{_rules → core/_rules}/importers/_dtdl2rules/dtdl_converter.py +15 -7
  62. cognite/neat/{_rules → core/_rules}/importers/_dtdl2rules/dtdl_importer.py +13 -9
  63. cognite/neat/{_rules → core/_rules}/importers/_dtdl2rules/spec.py +1 -1
  64. cognite/neat/{_rules → core/_rules}/importers/_rdf/_base.py +12 -12
  65. cognite/neat/{_rules → core/_rules}/importers/_rdf/_imf2rules.py +5 -2
  66. cognite/neat/{_rules → core/_rules}/importers/_rdf/_inference2rules.py +14 -14
  67. cognite/neat/{_rules → core/_rules}/importers/_rdf/_owl2rules.py +5 -2
  68. cognite/neat/{_rules → core/_rules}/importers/_rdf/_shared.py +4 -4
  69. cognite/neat/{_rules → core/_rules}/importers/_spreadsheet2rules.py +7 -7
  70. cognite/neat/{_rules → core/_rules}/importers/_yaml2rules.py +5 -5
  71. cognite/neat/{_rules → core/_rules}/models/__init__.py +5 -3
  72. cognite/neat/{_rules → core/_rules}/models/_base_rules.py +9 -6
  73. cognite/neat/{_rules → core/_rules}/models/_types.py +5 -5
  74. cognite/neat/{_rules → core/_rules}/models/data_types.py +9 -3
  75. cognite/neat/{_rules → core/_rules}/models/dms/__init__.py +1 -1
  76. cognite/neat/{_rules → core/_rules}/models/dms/_exporter.py +15 -8
  77. cognite/neat/{_rules → core/_rules}/models/dms/_rules.py +9 -9
  78. cognite/neat/{_rules → core/_rules}/models/dms/_rules_input.py +10 -7
  79. cognite/neat/{_rules → core/_rules}/models/dms/_validation.py +14 -14
  80. cognite/neat/{_rules → core/_rules}/models/entities/_loaders.py +2 -2
  81. cognite/neat/{_rules → core/_rules}/models/entities/_multi_value.py +2 -2
  82. cognite/neat/{_rules → core/_rules}/models/entities/_single_value.py +3 -3
  83. cognite/neat/{_rules → core/_rules}/models/entities/_wrapped.py +13 -5
  84. cognite/neat/{_rules → core/_rules}/models/information/_rules.py +11 -9
  85. cognite/neat/{_rules → core/_rules}/models/information/_rules_input.py +5 -5
  86. cognite/neat/{_rules → core/_rules}/models/information/_validation.py +10 -10
  87. cognite/neat/{_rules → core/_rules}/models/mapping/_classic2core.py +5 -5
  88. cognite/neat/{_rules → core/_rules}/transformers/_base.py +4 -4
  89. cognite/neat/{_rules → core/_rules}/transformers/_converters.py +52 -26
  90. cognite/neat/{_rules → core/_rules}/transformers/_mapping.py +15 -7
  91. cognite/neat/{_rules → core/_rules}/transformers/_verification.py +7 -7
  92. cognite/neat/{_store → core/_store}/_graph_store.py +13 -10
  93. cognite/neat/{_store → core/_store}/_provenance.py +3 -3
  94. cognite/neat/{_store → core/_store}/_rules_store.py +19 -12
  95. cognite/neat/{_store → core/_store}/exceptions.py +4 -4
  96. cognite/neat/core/_utils/__init__.py +0 -0
  97. cognite/neat/{_utils → core/_utils}/auth.py +1 -1
  98. cognite/neat/{_utils → core/_utils}/auxiliary.py +1 -1
  99. cognite/neat/{_utils → core/_utils}/collection_.py +2 -2
  100. cognite/neat/{_utils → core/_utils}/graph_transformations_report.py +1 -1
  101. cognite/neat/{_utils → core/_utils}/rdf_.py +1 -1
  102. cognite/neat/{_utils → core/_utils}/reader/_base.py +1 -1
  103. cognite/neat/{_utils → core/_utils}/spreadsheet.py +11 -4
  104. cognite/neat/{_utils → core/_utils}/text.py +1 -1
  105. cognite/neat/{_utils → core/_utils}/upload.py +3 -3
  106. cognite/neat/{_session → session}/_base.py +10 -10
  107. cognite/neat/{_session → session}/_collector.py +1 -1
  108. cognite/neat/{_session → session}/_drop.py +3 -3
  109. cognite/neat/{_session → session}/_explore.py +2 -2
  110. cognite/neat/{_session → session}/_fix.py +2 -2
  111. cognite/neat/{_session → session}/_inspect.py +7 -3
  112. cognite/neat/{_session → session}/_mapping.py +3 -3
  113. cognite/neat/{_session → session}/_prepare.py +8 -8
  114. cognite/neat/{_session → session}/_read.py +73 -16
  115. cognite/neat/{_session → session}/_set.py +8 -8
  116. cognite/neat/{_session → session}/_show.py +5 -5
  117. cognite/neat/{_session → session}/_state.py +8 -8
  118. cognite/neat/{_session → session}/_subset.py +7 -4
  119. cognite/neat/{_session → session}/_template.py +22 -14
  120. cognite/neat/{_session → session}/_to.py +12 -12
  121. cognite/neat/{_session → session}/_wizard.py +1 -1
  122. cognite/neat/{_session → session}/engine/_load.py +1 -1
  123. cognite/neat/{_session → session}/exceptions.py +4 -4
  124. {cognite_neat-0.119.8.dist-info → cognite_neat-0.120.0.dist-info}/METADATA +47 -54
  125. cognite_neat-0.120.0.dist-info/RECORD +187 -0
  126. {cognite_neat-0.119.8.dist-info → cognite_neat-0.120.0.dist-info}/WHEEL +1 -1
  127. cognite_neat-0.119.8.dist-info/RECORD +0 -187
  128. cognite_neat-0.119.8.dist-info/entry_points.txt +0 -3
  129. /cognite/neat/{_client/_api → core}/__init__.py +0 -0
  130. /cognite/neat/{_client → core/_client}/__init__.py +0 -0
  131. /cognite/neat/{_client/data_classes → core/_client/_api}/__init__.py +0 -0
  132. /cognite/neat/{_graph → core/_client/data_classes}/__init__.py +0 -0
  133. /cognite/neat/{_client → core/_client}/data_classes/data_modeling.py +0 -0
  134. /cognite/neat/{_client → core/_client}/data_classes/neat_sequence.py +0 -0
  135. /cognite/neat/{_config.py → core/_config.py} +0 -0
  136. /cognite/neat/{_graph/extractors/_classic_cdf → core/_graph}/__init__.py +0 -0
  137. /cognite/neat/{_graph → core/_graph}/_shared.py +0 -0
  138. /cognite/neat/{_graph → core/_graph}/_tracking/__init__.py +0 -0
  139. /cognite/neat/{_graph → core/_graph}/examples/Knowledge-Graph-Nordic44-dirty.xml +0 -0
  140. /cognite/neat/{_graph → core/_graph}/examples/Knowledge-Graph-Nordic44.xml +0 -0
  141. /cognite/neat/{_graph → core/_graph}/examples/__init__.py +0 -0
  142. /cognite/neat/{_graph → core/_graph}/examples/skos-capturing-sheet-wind-topics.xlsx +0 -0
  143. /cognite/neat/{_rules → core/_graph/extractors/_classic_cdf}/__init__.py +0 -0
  144. /cognite/neat/{_graph → core/_graph}/extractors/_classic_cdf/_assets.py +0 -0
  145. /cognite/neat/{_graph → core/_graph}/extractors/_classic_cdf/_data_sets.py +0 -0
  146. /cognite/neat/{_graph → core/_graph}/extractors/_classic_cdf/_events.py +0 -0
  147. /cognite/neat/{_graph → core/_graph}/extractors/_classic_cdf/_files.py +0 -0
  148. /cognite/neat/{_graph → core/_graph}/extractors/_classic_cdf/_labels.py +0 -0
  149. /cognite/neat/{_graph → core/_graph}/loaders/__init__.py +0 -0
  150. /cognite/neat/{_graph → core/_graph}/queries/__init__.py +0 -0
  151. /cognite/neat/{_graph → core/_graph}/queries/_base.py +0 -0
  152. /cognite/neat/{_graph → core/_graph}/queries/_queries.py +0 -0
  153. /cognite/neat/{_graph → core/_graph}/transformers/__init__.py +0 -0
  154. /cognite/neat/{_issues → core/_issues}/__init__.py +0 -0
  155. /cognite/neat/{_issues → core/_issues}/formatters.py +0 -0
  156. /cognite/neat/{_utils → core/_rules}/__init__.py +0 -0
  157. /cognite/neat/{_rules → core/_rules}/_constants.py +0 -0
  158. /cognite/neat/{_rules → core/_rules}/analysis/__init__.py +0 -0
  159. /cognite/neat/{_rules → core/_rules}/catalog/__init__.py +0 -0
  160. /cognite/neat/{_rules → core/_rules}/catalog/classic_model.xlsx +0 -0
  161. /cognite/neat/{_rules → core/_rules}/catalog/hello_world_pump.xlsx +0 -0
  162. /cognite/neat/{_rules → core/_rules}/catalog/info-rules-imf.xlsx +0 -0
  163. /cognite/neat/{_rules → core/_rules}/exporters/__init__.py +0 -0
  164. /cognite/neat/{_rules → core/_rules}/importers/__init__.py +0 -0
  165. /cognite/neat/{_rules → core/_rules}/importers/_dtdl2rules/__init__.py +0 -0
  166. /cognite/neat/{_rules → core/_rules}/importers/_dtdl2rules/_unit_lookup.py +0 -0
  167. /cognite/neat/{_rules → core/_rules}/importers/_rdf/__init__.py +0 -0
  168. /cognite/neat/{_rules → core/_rules}/models/_base_input.py +0 -0
  169. /cognite/neat/{_rules → core/_rules}/models/entities/__init__.py +0 -0
  170. /cognite/neat/{_rules → core/_rules}/models/entities/_constants.py +0 -0
  171. /cognite/neat/{_rules → core/_rules}/models/entities/_types.py +0 -0
  172. /cognite/neat/{_rules → core/_rules}/models/information/__init__.py +0 -0
  173. /cognite/neat/{_rules → core/_rules}/models/mapping/__init__.py +0 -0
  174. /cognite/neat/{_rules → core/_rules}/models/mapping/_classic2core.yaml +0 -0
  175. /cognite/neat/{_rules → core/_rules}/transformers/__init__.py +0 -0
  176. /cognite/neat/{_shared.py → core/_shared.py} +0 -0
  177. /cognite/neat/{_store → core/_store}/__init__.py +0 -0
  178. /cognite/neat/{_utils → core/_utils}/io_.py +0 -0
  179. /cognite/neat/{_utils → core/_utils}/reader/__init__.py +0 -0
  180. /cognite/neat/{_utils → core/_utils}/time_.py +0 -0
  181. /cognite/neat/{_utils → core/_utils}/xml_.py +0 -0
  182. /cognite/neat/{_session → session}/__init__.py +0 -0
  183. /cognite/neat/{_alpha.py → session/_experimental.py} +0 -0
  184. /cognite/neat/{_state → session/_state}/README.md +0 -0
  185. /cognite/neat/{_session → session}/engine/__init__.py +0 -0
  186. /cognite/neat/{_session → session}/engine/_import.py +0 -0
  187. /cognite/neat/{_session → session}/engine/_interface.py +0 -0
  188. {cognite_neat-0.119.8.dist-info → cognite_neat-0.120.0.dist-info/licenses}/LICENSE +0 -0
@@ -3,8 +3,8 @@ from typing import cast
3
3
  import pandas as pd
4
4
  from rdflib import URIRef
5
5
 
6
- from cognite.neat._utils.rdf_ import remove_namespace_from_uri
7
- from cognite.neat._utils.text import humanize_collection
6
+ from cognite.neat.core._utils.rdf_ import remove_namespace_from_uri
7
+ from cognite.neat.core._utils.text import humanize_collection
8
8
 
9
9
  from ._state import SessionState
10
10
  from .exceptions import NeatSessionError, session_class_wrapper
@@ -1,5 +1,5 @@
1
- from cognite.neat._issues._base import IssueList
2
- from cognite.neat._rules.transformers import (
1
+ from cognite.neat.core._issues._base import IssueList
2
+ from cognite.neat.core._rules.transformers import (
3
3
  ToCompliantEntities,
4
4
  )
5
5
 
@@ -4,9 +4,13 @@ from typing import Literal, overload
4
4
 
5
5
  import pandas as pd
6
6
 
7
- from cognite.neat._constants import IN_NOTEBOOK
8
- from cognite.neat._issues import IssueList
9
- from cognite.neat._utils.upload import UploadResult, UploadResultCore, UploadResultList
7
+ from cognite.neat.core._constants import IN_NOTEBOOK
8
+ from cognite.neat.core._issues import IssueList
9
+ from cognite.neat.core._utils.upload import (
10
+ UploadResult,
11
+ UploadResultCore,
12
+ UploadResultList,
13
+ )
10
14
 
11
15
  from ._state import SessionState
12
16
  from .exceptions import session_class_wrapper
@@ -1,6 +1,6 @@
1
- from cognite.neat._issues import IssueList
2
- from cognite.neat._rules.models.mapping import load_classic_to_core_mapping
3
- from cognite.neat._rules.transformers import (
1
+ from cognite.neat.core._issues import IssueList
2
+ from cognite.neat.core._rules.models.mapping import load_classic_to_core_mapping
3
+ from cognite.neat.core._rules.transformers import (
4
4
  AsParentPropertyId,
5
5
  ChangeViewPrefix,
6
6
  IncludeReferenced,
@@ -4,19 +4,19 @@ from typing import Any
4
4
 
5
5
  from rdflib import URIRef
6
6
 
7
- from cognite.neat._alpha import ExperimentalFlags
8
- from cognite.neat._graph.transformers import (
7
+ from cognite.neat.core._graph.transformers import (
9
8
  ConnectionToLiteral,
10
9
  ConvertLiteral,
11
10
  LiteralToEntity,
12
11
  RelationshipAsEdgeTransformer,
13
12
  )
14
- from cognite.neat._graph.transformers._rdfpath import MakeConnectionOnExactMatch
15
- from cognite.neat._issues import IssueList
16
- from cognite.neat._issues.errors import NeatValueError
17
- from cognite.neat._rules.transformers import PrefixEntities, StandardizeNaming
18
- from cognite.neat._rules.transformers._converters import StandardizeSpaceAndVersion
19
- from cognite.neat._utils.text import humanize_collection
13
+ from cognite.neat.core._graph.transformers._rdfpath import MakeConnectionOnExactMatch
14
+ from cognite.neat.core._issues import IssueList
15
+ from cognite.neat.core._issues.errors import NeatValueError
16
+ from cognite.neat.core._rules.transformers import PrefixEntities, StandardizeNaming
17
+ from cognite.neat.core._rules.transformers._converters import StandardizeSpaceAndVersion
18
+ from cognite.neat.core._utils.text import humanize_collection
19
+ from cognite.neat.session._experimental import ExperimentalFlags
20
20
 
21
21
  from ._state import SessionState
22
22
  from .exceptions import NeatSessionError, session_class_wrapper
@@ -4,37 +4,38 @@ from typing import Any, Literal, cast
4
4
  from cognite.client.data_classes.data_modeling import DataModelId, DataModelIdentifier
5
5
  from cognite.client.utils.useful_types import SequenceNotStr
6
6
 
7
- from cognite.neat._alpha import ExperimentalFlags
8
- from cognite.neat._client import NeatClient
9
- from cognite.neat._constants import (
7
+ from cognite.neat.core._client import NeatClient
8
+ from cognite.neat.core._constants import (
10
9
  CLASSIC_CDF_NAMESPACE,
11
10
  get_default_prefixes_and_namespaces,
12
11
  )
13
- from cognite.neat._graph import examples as instances_examples
14
- from cognite.neat._graph import extractors
15
- from cognite.neat._graph.transformers import (
12
+ from cognite.neat.core._graph import examples as instances_examples
13
+ from cognite.neat.core._graph import extractors
14
+ from cognite.neat.core._graph.extractors._classic_cdf._base import InstanceIdPrefix
15
+ from cognite.neat.core._graph.transformers import (
16
16
  ConvertLiteral,
17
17
  LiteralToEntity,
18
18
  Transformers,
19
19
  )
20
- from cognite.neat._graph.transformers._prune_graph import (
20
+ from cognite.neat.core._graph.transformers._prune_graph import (
21
21
  AttachPropertyFromTargetToSource,
22
22
  PruneDeadEndEdges,
23
23
  PruneInstancesOfUnknownType,
24
24
  PruneTypes,
25
25
  )
26
- from cognite.neat._issues import IssueList
27
- from cognite.neat._issues.errors import NeatValueError
28
- from cognite.neat._issues.warnings import MissingCogniteClientWarning
29
- from cognite.neat._rules import catalog, importers
30
- from cognite.neat._rules.importers import BaseImporter
31
- from cognite.neat._rules.models.entities._single_value import ViewEntity
32
- from cognite.neat._rules.transformers import ClassicPrepareCore
33
- from cognite.neat._rules.transformers._converters import (
26
+ from cognite.neat.core._issues import IssueList
27
+ from cognite.neat.core._issues.errors import NeatValueError
28
+ from cognite.neat.core._issues.warnings import MissingCogniteClientWarning
29
+ from cognite.neat.core._rules import catalog, importers
30
+ from cognite.neat.core._rules.importers import BaseImporter
31
+ from cognite.neat.core._rules.models.entities._single_value import ViewEntity
32
+ from cognite.neat.core._rules.transformers import ClassicPrepareCore
33
+ from cognite.neat.core._rules.transformers._converters import (
34
34
  ToEnterpriseModel,
35
35
  _SubsetEditableCDMRules,
36
36
  )
37
- from cognite.neat._utils.reader import NeatReader
37
+ from cognite.neat.core._utils.reader import NeatReader
38
+ from cognite.neat.session._experimental import ExperimentalFlags
38
39
 
39
40
  from ._state import SessionState
40
41
  from ._wizard import NeatObjectType, RDFFileType, XMLFileType, object_wizard, rdf_dm_wizard, xml_format_wizard
@@ -411,6 +412,62 @@ class CDFClassicAPI(BaseReadAPI):
411
412
 
412
413
  return all_issues
413
414
 
415
+ def time_series(self, data_set_external_id: str, identifier: Literal["id", "externalId"] = "id") -> IssueList:
416
+ """Read the time series from CDF into NEAT.
417
+
418
+ Args:
419
+ data_set_external_id: The external id of the data set
420
+ identifier: The identifier to use for the time series. Note selecting "id" can cause issues if the external
421
+ ID of the time series is missing. Default is "id".
422
+
423
+ Returns:
424
+ IssueList: A list of issues that occurred during the extraction.
425
+
426
+ Example:
427
+ ```python
428
+ neat.read.cdf.time_series("data_set_external_id")
429
+ ```
430
+
431
+ """
432
+ namespace = CLASSIC_CDF_NAMESPACE
433
+ self._state._raise_exception_if_condition_not_met(
434
+ "Read time series",
435
+ empty_rules_store_required=True,
436
+ empty_instances_store_required=True,
437
+ client_required=True,
438
+ )
439
+ extractor = extractors.TimeSeriesExtractor.from_dataset(
440
+ cast(NeatClient, self._state.client),
441
+ data_set_external_id=data_set_external_id,
442
+ namespace=namespace,
443
+ identifier=identifier,
444
+ prefix="Classic",
445
+ skip_connections=True,
446
+ )
447
+ self._state.instances.neat_prefix_by_predicate_uri.update(
448
+ {
449
+ namespace["dataSetId"]: InstanceIdPrefix.data_set,
450
+ namespace["assetId"]: InstanceIdPrefix.asset,
451
+ }
452
+ )
453
+ self._state.instances.neat_prefix_by_type_uri.update(
454
+ {namespace[f"Classic{extractor._default_rdf_type}"]: InstanceIdPrefix.time_series}
455
+ )
456
+ extract_issues = self._state.instances.store.write(extractor)
457
+
458
+ if identifier == "externalId":
459
+ self._state.quoted_source_identifiers = True
460
+
461
+ self._state.instances.store.transform(
462
+ ConvertLiteral(
463
+ namespace["ClassicTimeSeries"],
464
+ namespace["isString"],
465
+ lambda is_string: "string" if is_string else "numeric",
466
+ )
467
+ )
468
+
469
+ return extract_issues
470
+
414
471
 
415
472
  @session_class_wrapper
416
473
  class ExcelReadAPI(BaseReadAPI):
@@ -1,14 +1,14 @@
1
1
  from cognite.client import CogniteClient
2
2
  from cognite.client import data_modeling as dm
3
3
 
4
- from cognite.neat._client import NeatClient
5
- from cognite.neat._constants import COGNITE_MODELS
6
- from cognite.neat._graph.transformers import SetType
7
- from cognite.neat._issues import IssueList
8
- from cognite.neat._issues.errors import NeatValueError
9
- from cognite.neat._rules.models import DMSRules
10
- from cognite.neat._rules.transformers import SetIDDMSModel
11
- from cognite.neat._utils.text import humanize_collection
4
+ from cognite.neat.core._client import NeatClient
5
+ from cognite.neat.core._constants import COGNITE_MODELS
6
+ from cognite.neat.core._graph.transformers import SetType
7
+ from cognite.neat.core._issues import IssueList
8
+ from cognite.neat.core._issues.errors import NeatValueError
9
+ from cognite.neat.core._rules.models import DMSRules
10
+ from cognite.neat.core._rules.transformers import SetIDDMSModel
11
+ from cognite.neat.core._utils.text import humanize_collection
12
12
 
13
13
  from ._state import SessionState
14
14
  from .exceptions import NeatSessionError, session_class_wrapper
@@ -6,11 +6,11 @@ import networkx as nx
6
6
  from IPython.display import HTML, display
7
7
  from pyvis.network import Network as PyVisNetwork # type: ignore
8
8
 
9
- from cognite.neat._constants import IN_NOTEBOOK, IN_PYODIDE
10
- from cognite.neat._rules.analysis._base import RulesAnalysis
11
- from cognite.neat._session.exceptions import NeatSessionError
12
- from cognite.neat._utils.io_ import to_directory_compatible
13
- from cognite.neat._utils.rdf_ import remove_namespace_from_uri, uri_display_name
9
+ from cognite.neat.core._constants import IN_NOTEBOOK, IN_PYODIDE
10
+ from cognite.neat.core._rules.analysis._base import RulesAnalysis
11
+ from cognite.neat.core._utils.io_ import to_directory_compatible
12
+ from cognite.neat.core._utils.rdf_ import remove_namespace_from_uri, uri_display_name
13
+ from cognite.neat.session.exceptions import NeatSessionError
14
14
 
15
15
  from ._state import SessionState
16
16
  from .exceptions import session_class_wrapper
@@ -3,16 +3,16 @@ from typing import Literal, cast
3
3
 
4
4
  from rdflib import URIRef
5
5
 
6
- from cognite.neat._client import NeatClient
7
- from cognite.neat._graph.extractors import KnowledgeGraphExtractor
8
- from cognite.neat._issues import IssueList
9
- from cognite.neat._rules.importers import BaseImporter, InferenceImporter
10
- from cognite.neat._rules.models import DMSRules, InformationRules
11
- from cognite.neat._rules.transformers import (
6
+ from cognite.neat.core._client import NeatClient
7
+ from cognite.neat.core._graph.extractors import KnowledgeGraphExtractor
8
+ from cognite.neat.core._issues import IssueList
9
+ from cognite.neat.core._rules.importers import BaseImporter, InferenceImporter
10
+ from cognite.neat.core._rules.models import DMSRules, InformationRules
11
+ from cognite.neat.core._rules.transformers import (
12
12
  VerifiedRulesTransformer,
13
13
  )
14
- from cognite.neat._store import NeatGraphStore, NeatRulesStore
15
- from cognite.neat._utils.upload import UploadResultList
14
+ from cognite.neat.core._store import NeatGraphStore, NeatRulesStore
15
+ from cognite.neat.core._utils.upload import UploadResultList
16
16
 
17
17
  from .exceptions import NeatSessionError, _session_method_wrapper
18
18
 
@@ -1,9 +1,12 @@
1
1
  import warnings
2
2
 
3
- from cognite.neat._alpha import ExperimentalFlags
4
- from cognite.neat._issues._base import IssueList
5
- from cognite.neat._rules.models.entities._single_value import ClassEntity, ViewEntity
6
- from cognite.neat._rules.transformers import SubsetDMSRules, SubsetInformationRules
3
+ from cognite.neat.core._issues._base import IssueList
4
+ from cognite.neat.core._rules.models.entities._single_value import (
5
+ ClassEntity,
6
+ ViewEntity,
7
+ )
8
+ from cognite.neat.core._rules.transformers import SubsetDMSRules, SubsetInformationRules
9
+ from cognite.neat.session._experimental import ExperimentalFlags
7
10
 
8
11
  from ._state import SessionState
9
12
  from .exceptions import NeatSessionError, session_class_wrapper
@@ -3,22 +3,23 @@ from typing import Any, Literal
3
3
 
4
4
  from cognite.client.data_classes.data_modeling import DataModelIdentifier
5
5
 
6
- from cognite.neat._alpha import ExperimentalFlags
7
- from cognite.neat._issues import IssueList, catch_issues
8
- from cognite.neat._rules._shared import ReadRules
9
- from cognite.neat._rules.exporters import ExcelExporter
10
- from cognite.neat._rules.importers import ExcelImporter
11
- from cognite.neat._rules.models import InformationInputRules
12
- from cognite.neat._rules.models._base_rules import RoleTypes
13
- from cognite.neat._rules.models.dms import DMSValidation
14
- from cognite.neat._rules.transformers import (
6
+ from cognite.neat.core._constants import BASE_MODEL
7
+ from cognite.neat.core._issues import IssueList, catch_issues
8
+ from cognite.neat.core._rules._shared import ReadRules
9
+ from cognite.neat.core._rules.exporters import ExcelExporter
10
+ from cognite.neat.core._rules.importers import ExcelImporter
11
+ from cognite.neat.core._rules.models import InformationInputRules
12
+ from cognite.neat.core._rules.models._base_rules import RoleTypes
13
+ from cognite.neat.core._rules.models.dms import DMSValidation
14
+ from cognite.neat.core._rules.transformers import (
15
15
  AddCogniteProperties,
16
16
  IncludeReferenced,
17
17
  ToDataProductModel,
18
18
  ToEnterpriseModel,
19
19
  VerifiedRulesTransformer,
20
20
  )
21
- from cognite.neat._utils.reader import NeatReader, PathReader
21
+ from cognite.neat.core._utils.reader import NeatReader, PathReader
22
+ from cognite.neat.session._experimental import ExperimentalFlags
22
23
 
23
24
  from ._state import SessionState
24
25
  from .exceptions import NeatSessionError, session_class_wrapper
@@ -126,19 +127,26 @@ class TemplateAPI:
126
127
  self._state.last_reference = last_rules
127
128
  return issues
128
129
 
129
- def conceptual_model(self, io: Any) -> None:
130
+ def conceptual_model(
131
+ self,
132
+ io: Any,
133
+ base_model: BASE_MODEL = "CogniteCore",
134
+ total_concepts: int | None = None,
135
+ ) -> None:
130
136
  """This method will create a template for a conceptual data modeling
131
137
 
132
138
  Args:
133
139
  io: file path to the Excel sheet
140
+ base_model: The base model to use for implements in the conceptual data model.
141
+ Currently only supporting CogniteCore.
142
+ total_concepts: The total number of concepts to provide in implements for selection.
143
+ Default is None, meaning all concepts will be provided.
134
144
 
135
145
  """
136
146
  reader = NeatReader.create(io)
137
147
  path = reader.materialize_path()
138
148
 
139
- ExcelExporter().template(RoleTypes.information, path)
140
-
141
- return None
149
+ ExcelExporter(base_model=base_model, total_concepts=total_concepts).template(RoleTypes.information, path)
142
150
 
143
151
  def expand(self, io: Any, output: str | Path | None = None, dummy_property: str = "GUID") -> IssueList:
144
152
  """Creates a template for an extension of a Cognite model by expanding properties from CDM.
@@ -6,18 +6,18 @@ from typing import Any, Literal, cast, overload
6
6
  from cognite.client import data_modeling as dm
7
7
  from cognite.client.data_classes.data_modeling import DataModelIdentifier
8
8
 
9
- from cognite.neat._alpha import ExperimentalFlags
10
- from cognite.neat._client._api_client import NeatClient
11
- from cognite.neat._constants import COGNITE_MODELS
12
- from cognite.neat._graph import loaders
13
- from cognite.neat._issues import IssueList, NeatIssue, catch_issues
14
- from cognite.neat._rules import exporters
15
- from cognite.neat._rules._constants import PATTERNS
16
- from cognite.neat._rules._shared import VerifiedRules
17
- from cognite.neat._rules.importers import DMSImporter
18
- from cognite.neat._rules.models import DMSRules, InformationRules
19
- from cognite.neat._rules.models.dms import DMSMetadata
20
- from cognite.neat._utils.upload import UploadResultList
9
+ from cognite.neat.core._client._api_client import NeatClient
10
+ from cognite.neat.core._constants import COGNITE_MODELS
11
+ from cognite.neat.core._graph import loaders
12
+ from cognite.neat.core._issues import IssueList, NeatIssue, catch_issues
13
+ from cognite.neat.core._rules import exporters
14
+ from cognite.neat.core._rules._constants import PATTERNS
15
+ from cognite.neat.core._rules._shared import VerifiedRules
16
+ from cognite.neat.core._rules.importers import DMSImporter
17
+ from cognite.neat.core._rules.models import DMSRules, InformationRules
18
+ from cognite.neat.core._rules.models.dms import DMSMetadata
19
+ from cognite.neat.core._utils.upload import UploadResultList
20
+ from cognite.neat.session._experimental import ExperimentalFlags
21
21
 
22
22
  from ._state import SessionState
23
23
  from .exceptions import NeatSessionError, session_class_wrapper
@@ -3,7 +3,7 @@ from typing import Literal, TypeVar, get_args
3
3
 
4
4
  from rich.prompt import IntPrompt, Prompt
5
5
 
6
- from cognite.neat._rules._constants import PATTERNS
6
+ from cognite.neat.core._rules._constants import PATTERNS
7
7
 
8
8
  RDFFileType = Literal["Ontology", "IMF Types", "Inference"]
9
9
  NeatObjectType = Literal["Data Model", "Instances"]
@@ -12,8 +12,8 @@ from cognite.client import CogniteClient
12
12
  from packaging.version import Version
13
13
  from packaging.version import parse as parse_version
14
14
 
15
- from cognite.neat._issues.errors import NeatValueError
16
15
  from cognite.neat._version import __engine__
16
+ from cognite.neat.core._issues.errors import NeatValueError
17
17
 
18
18
  ENVIRONMENT_VARIABLE = "NEATENGINE"
19
19
  PACKAGE_NAME = "neatengine"
@@ -3,10 +3,10 @@ import warnings
3
3
  from collections.abc import Callable
4
4
  from typing import Any
5
5
 
6
- from cognite.neat._alpha import ExperimentalFeatureWarning
7
- from cognite.neat._issues.errors import CDFMissingClientError, NeatImportError
8
- from cognite.neat._issues.errors._external import OxigraphStorageLockedError
9
- from cognite.neat._issues.errors._general import NeatValueError
6
+ from cognite.neat.core._issues.errors import CDFMissingClientError, NeatImportError
7
+ from cognite.neat.core._issues.errors._external import OxigraphStorageLockedError
8
+ from cognite.neat.core._issues.errors._general import NeatValueError
9
+ from cognite.neat.session._experimental import ExperimentalFeatureWarning
10
10
 
11
11
  from ._collector import _COLLECTOR
12
12
 
@@ -1,61 +1,55 @@
1
- Metadata-Version: 2.3
1
+ Metadata-Version: 2.4
2
2
  Name: cognite-neat
3
- Version: 0.119.8
3
+ Version: 0.120.0
4
4
  Summary: Knowledge graph transformation
5
- License: Apache-2.0
6
- Author: Nikola Vasiljevic
7
- Author-email: nikola.vasiljevic@cognite.com
5
+ Project-URL: Documentation, https://cognite-neat.readthedocs-hosted.com/
6
+ Project-URL: Homepage, https://cognite-neat.readthedocs-hosted.com/
7
+ Project-URL: GitHub, https://github.com/cognitedata/neat
8
+ Project-URL: Changelog, https://github.com/cognitedata/neat/releases
9
+ Author-email: Nikola Vasiljevic <nikola.vasiljevic@cognite.com>, Anders Albert <anders.albert@cognite.com>, Rogerio Júnior <rogerio.junior@cognite.com>
10
+ License-Expression: Apache-2.0
11
+ License-File: LICENSE
8
12
  Requires-Python: >=3.10
9
- Classifier: License :: OSI Approved :: Apache Software License
10
- Classifier: Programming Language :: Python :: 3
11
- Classifier: Programming Language :: Python :: 3.10
12
- Classifier: Programming Language :: Python :: 3.11
13
- Classifier: Programming Language :: Python :: 3.12
14
- Classifier: Programming Language :: Python :: 3.13
15
- Provides-Extra: all
13
+ Requires-Dist: backports-strenum<2.0.0,>=1.2; python_version < '3.11'
14
+ Requires-Dist: cognite-sdk<8.0.0,>=7.73.4
15
+ Requires-Dist: elementpath<5.0.0,>=4.0.0
16
+ Requires-Dist: exceptiongroup<2.0.0,>=1.1.3; python_version < '3.11'
17
+ Requires-Dist: jsonpath-python<2.0.0,>=1.0.6
18
+ Requires-Dist: mixpanel<5.0.0,>=4.10.1
19
+ Requires-Dist: networkx<4.0.0,>=3.4.2
20
+ Requires-Dist: openpyxl<4.0.0,>=3.0.10
21
+ Requires-Dist: packaging<25.0,>=22.0
22
+ Requires-Dist: pandas<3.0.0,>=1.5.3
23
+ Requires-Dist: pydantic<3.0.0,>=2.0.0
24
+ Requires-Dist: pyvis<1.0.0,>=0.3.2
25
+ Requires-Dist: pyyaml<7.0.0,>=6.0.1
26
+ Requires-Dist: rdflib<8.0.0,>=7.0.0
27
+ Requires-Dist: requests<3.0.0,>=2.28.1
28
+ Requires-Dist: rich[jupyter]<14.0.0,>=13.7.1
29
+ Requires-Dist: tomli<3.0.0,>=2.0.1; python_version < '3.11'
30
+ Requires-Dist: typing-extensions<5.0.0,>=4.8.0; python_version < '3.11'
31
+ Requires-Dist: urllib3<3.0.0,>=1.26.15
16
32
  Provides-Extra: docs
33
+ Requires-Dist: mistune==3.0.2; extra == 'docs'
34
+ Requires-Dist: mkdocs-autorefs<1.0.0,>=0.5.0; extra == 'docs'
35
+ Requires-Dist: mkdocs-git-authors-plugin<1.0.0,>=0.9.4; extra == 'docs'
36
+ Requires-Dist: mkdocs-git-revision-date-localized-plugin; extra == 'docs'
37
+ Requires-Dist: mkdocs-gitbook<1.0.0,>=0.0.1; extra == 'docs'
38
+ Requires-Dist: mkdocs-glightbox<1.0.0,>=0.4.0; extra == 'docs'
39
+ Requires-Dist: mkdocs-jupyter<1.0.0,>=0.25.1; extra == 'docs'
40
+ Requires-Dist: mkdocs-material-extensions<2.0.0,>=1.3.1; extra == 'docs'
41
+ Requires-Dist: mkdocs<2.0.0,>=1.4.0; extra == 'docs'
42
+ Requires-Dist: mkdocstrings[python]<1.0.0,>=0.25.2; extra == 'docs'
43
+ Requires-Dist: pymdown-extensions<11.0.0,>=10.14.3; extra == 'docs'
17
44
  Provides-Extra: google
18
- Provides-Extra: oxi
19
- Requires-Dist: PyYAML
20
- Requires-Dist: backports.strenum (>=1.2,<2.0) ; python_version < "3.11"
21
- Requires-Dist: cognite-sdk (>=7.73.4,<8.0.0)
22
- Requires-Dist: elementpath (>=4.0.0,<5.0.0)
23
- Requires-Dist: exceptiongroup (>=1.1.3,<2.0.0) ; python_version < "3.11"
24
- Requires-Dist: google-api-python-client ; extra == "google"
25
- Requires-Dist: google-auth-oauthlib ; extra == "google"
26
- Requires-Dist: gspread ; extra == "google"
27
- Requires-Dist: jsonpath-python (>=1.0.6,<2.0.0)
28
- Requires-Dist: lxml (>=5.3.0,<6.0.0) ; extra == "all"
29
- Requires-Dist: mistune (==3.0.2) ; extra == "docs"
30
- Requires-Dist: mixpanel (>=4.10.1,<5.0.0)
31
- Requires-Dist: mkdocs ; extra == "docs"
32
- Requires-Dist: mkdocs-autorefs (>=0.5.0,<0.6.0) ; extra == "docs"
33
- Requires-Dist: mkdocs-git-authors-plugin ; extra == "docs"
34
- Requires-Dist: mkdocs-git-revision-date-localized-plugin ; extra == "docs"
35
- Requires-Dist: mkdocs-gitbook ; extra == "docs"
36
- Requires-Dist: mkdocs-glightbox ; extra == "docs"
37
- Requires-Dist: mkdocs-jupyter ; extra == "docs"
38
- Requires-Dist: mkdocs-material-extensions ; extra == "docs"
39
- Requires-Dist: mkdocstrings[python] ; extra == "docs"
40
- Requires-Dist: networkx (>=3.4.2,<4.0.0)
41
- Requires-Dist: openpyxl
42
- Requires-Dist: oxrdflib[oxigraph] (>=0.4.0,<0.5.0) ; extra == "oxi" or extra == "all"
43
- Requires-Dist: packaging (>=22.0,<25.0)
44
- Requires-Dist: pandas
45
- Requires-Dist: pydantic (>=2,<3)
46
- Requires-Dist: pymdown-extensions ; extra == "docs"
47
- Requires-Dist: pyoxigraph (==0.4.3) ; extra == "oxi" or extra == "all"
48
- Requires-Dist: pyvis (>=0.3.2,<0.4.0)
49
- Requires-Dist: rdflib
50
- Requires-Dist: requests
51
- Requires-Dist: rich[jupyter] (>=13.7.1,<14.0.0)
52
- Requires-Dist: tomli (>=2.0.1,<3.0.0) ; python_version < "3.11"
53
- Requires-Dist: typing_extensions (>=4.8,<5.0) ; python_version < "3.11"
54
- Requires-Dist: urllib3 (>=2,<3)
55
- Project-URL: Changelog, https://github.com/cognitedata/neat/releases
56
- Project-URL: Documentation, https://cognite-neat.readthedocs-hosted.com/
57
- Project-URL: GitHub, https://github.com/cognitedata/neat
58
- Project-URL: Homepage, https://cognite-neat.readthedocs-hosted.com/
45
+ Requires-Dist: google-api-python-client<3.0.0,>=2.70.0; extra == 'google'
46
+ Requires-Dist: google-auth-oauthlib<2.0.0,>=1.0.0; extra == 'google'
47
+ Requires-Dist: gspread<6.0.0,>=5.0.0; extra == 'google'
48
+ Provides-Extra: lxml
49
+ Requires-Dist: lxml<6.0.0,>=5.3.0; extra == 'lxml'
50
+ Provides-Extra: pyoxigraph
51
+ Requires-Dist: oxrdflib<0.5.0,>=0.4.0; extra == 'pyoxigraph'
52
+ Requires-Dist: pyoxigraph<0.5.0,>=0.4.3; extra == 'pyoxigraph'
59
53
  Description-Content-Type: text/markdown
60
54
 
61
55
  # kNowlEdge grAph Transformer (NEAT)
@@ -141,4 +135,3 @@ neat.read.cdf.data_model(("my_space", "MyDataModel", "v1"))
141
135
  ## Documentation
142
136
 
143
137
  For more information, see the [documentation](https://cognite-neat.readthedocs-hosted.com/en/latest/)
144
-