cognite-neat 0.125.0__py3-none-any.whl → 0.125.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of cognite-neat might be problematic. Click here for more details.
- cognite/neat/_version.py +1 -1
- cognite/neat/v0/core/_instances/queries/_select.py +13 -29
- cognite/neat/v0/core/_store/_instance.py +2 -2
- {cognite_neat-0.125.0.dist-info → cognite_neat-0.125.1.dist-info}/METADATA +1 -1
- {cognite_neat-0.125.0.dist-info → cognite_neat-0.125.1.dist-info}/RECORD +7 -7
- {cognite_neat-0.125.0.dist-info → cognite_neat-0.125.1.dist-info}/WHEEL +0 -0
- {cognite_neat-0.125.0.dist-info → cognite_neat-0.125.1.dist-info}/licenses/LICENSE +0 -0
cognite/neat/_version.py
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
__version__ = "0.125.
|
|
1
|
+
__version__ = "0.125.1"
|
|
2
2
|
__engine__ = "^2.0.4"
|
|
@@ -451,9 +451,21 @@ class SelectQueries(BaseQuery):
|
|
|
451
451
|
else:
|
|
452
452
|
yield instance_id, str(space)
|
|
453
453
|
|
|
454
|
-
def
|
|
454
|
+
def get_graph_diff(
|
|
455
455
|
self, source_graph: URIRef, target_graph: URIRef
|
|
456
456
|
) -> Iterable[tuple[URIRef, URIRef, URIRef | RdfLiteral]]:
|
|
457
|
+
"""Return triples that exist in the source graph but not in the target graph.
|
|
458
|
+
|
|
459
|
+
This method compares two named graphs within the dataset and identifies all triples
|
|
460
|
+
that are present in the `source_graph` but are missing from the `target_graph`.
|
|
461
|
+
|
|
462
|
+
Args:
|
|
463
|
+
source_graph: URI of the graph to compare from.
|
|
464
|
+
target_graph: URI of the graph to compare against.
|
|
465
|
+
|
|
466
|
+
Returns:
|
|
467
|
+
Iterable of triples (subject, predicate, object)
|
|
468
|
+
"""
|
|
457
469
|
query = f"""
|
|
458
470
|
SELECT ?s ?p ?o
|
|
459
471
|
WHERE {{
|
|
@@ -464,31 +476,3 @@ class SelectQueries(BaseQuery):
|
|
|
464
476
|
}}
|
|
465
477
|
"""
|
|
466
478
|
return cast(Iterable[tuple[URIRef, URIRef, URIRef | RdfLiteral]], self.dataset.query(query))
|
|
467
|
-
|
|
468
|
-
def get_triples_to_delete(
|
|
469
|
-
self, old_graph: URIRef, new_graph: URIRef
|
|
470
|
-
) -> Iterable[tuple[URIRef, URIRef, URIRef | RdfLiteral]]:
|
|
471
|
-
"""Find triples that exist in old graph but not in new graph.
|
|
472
|
-
|
|
473
|
-
Args:
|
|
474
|
-
old_graph: URI of the old named graph
|
|
475
|
-
new_graph: URI of the new named graph
|
|
476
|
-
|
|
477
|
-
Returns:
|
|
478
|
-
List of triples (subject, predicate, object) to delete
|
|
479
|
-
"""
|
|
480
|
-
return self._get_graph_diff(old_graph, new_graph)
|
|
481
|
-
|
|
482
|
-
def get_triples_to_add(
|
|
483
|
-
self, old_graph: URIRef, new_graph: URIRef
|
|
484
|
-
) -> Iterable[tuple[URIRef, URIRef, URIRef | RdfLiteral]]:
|
|
485
|
-
"""Find triples that exist in new graph but not in old graph.
|
|
486
|
-
|
|
487
|
-
Args:
|
|
488
|
-
old_graph: URI of the old named graph
|
|
489
|
-
new_graph: URI of the new named graph
|
|
490
|
-
|
|
491
|
-
Returns:
|
|
492
|
-
List of triples (subject, predicate, object) to add
|
|
493
|
-
"""
|
|
494
|
-
return self._get_graph_diff(new_graph, old_graph)
|
|
@@ -476,10 +476,10 @@ class NeatInstanceStore:
|
|
|
476
476
|
|
|
477
477
|
# Store new diff results
|
|
478
478
|
self._add_triples(
|
|
479
|
-
self.queries.select.
|
|
479
|
+
self.queries.select.get_graph_diff(new_named_graph, current_named_graph),
|
|
480
480
|
named_graph=NAMED_GRAPH_NAMESPACE["DIFF_ADD"],
|
|
481
481
|
)
|
|
482
482
|
self._add_triples(
|
|
483
|
-
self.queries.select.
|
|
483
|
+
self.queries.select.get_graph_diff(current_named_graph, new_named_graph),
|
|
484
484
|
named_graph=NAMED_GRAPH_NAMESPACE["DIFF_DELETE"],
|
|
485
485
|
)
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
cognite/neat/__init__.py,sha256=Lo4DbjDOwnhCYUoAgPp5RG1fDdF7OlnomalTe7n1ydw,211
|
|
2
2
|
cognite/neat/_exceptions.py,sha256=IvDKO8kHk4dCkrmQU6z_svJcPqs2m7QYLosuOuM_iwE,473
|
|
3
3
|
cognite/neat/_issues.py,sha256=uv0fkkWwTKqNmTmHqyoBB3L6yMCh42EZpEkLGmIJYOY,812
|
|
4
|
-
cognite/neat/_version.py,sha256=
|
|
4
|
+
cognite/neat/_version.py,sha256=k3TmBF6CMgkswWZu29bzPsMlIaF0_l68eW4yW3matDY,46
|
|
5
5
|
cognite/neat/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
6
6
|
cognite/neat/_data_model/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
7
7
|
cognite/neat/_data_model/_constants.py,sha256=NGGvWHlQqhkkSBP_AqoofGYjNph3SiZX6QPINlMsy04,107
|
|
@@ -167,7 +167,7 @@ cognite/neat/v0/core/_instances/loaders/_rdf_to_instance_space.py,sha256=T1nNzhY
|
|
|
167
167
|
cognite/neat/v0/core/_instances/queries/__init__.py,sha256=W477LMyB4l6HIRbQhJoFgA_MUBwVCh2GBvtFeZu0AUA,53
|
|
168
168
|
cognite/neat/v0/core/_instances/queries/_base.py,sha256=APevHeeWQDEoOQ0MlBtVlPf9hbZukVkI5fOvt5oPJCE,543
|
|
169
169
|
cognite/neat/v0/core/_instances/queries/_queries.py,sha256=4BidSQXhdZYZ6_kyG7jMJ2iG0UtSrbQxfmwPM7V167A,466
|
|
170
|
-
cognite/neat/v0/core/_instances/queries/_select.py,sha256=
|
|
170
|
+
cognite/neat/v0/core/_instances/queries/_select.py,sha256=MoMCjRVeOhOPAJ6Tlc91ZSj8ibOIfEV5aoGg4kR1qS0,20068
|
|
171
171
|
cognite/neat/v0/core/_instances/queries/_update.py,sha256=WJmh0hGoKT4pbbWeED6udFAXiv_qFPd3v9tnZLORcNk,1293
|
|
172
172
|
cognite/neat/v0/core/_instances/transformers/__init__.py,sha256=YzC1Z8BuT77NwagWX4Z-F9R9BARLSS7zM4bCdxBbqKg,1761
|
|
173
173
|
cognite/neat/v0/core/_instances/transformers/_base.py,sha256=a8TVhgYGdt7Mj5-omT6gxOHeGvYnMd9vJCty6p7ctx4,4707
|
|
@@ -195,7 +195,7 @@ cognite/neat/v0/core/_issues/warnings/_resources.py,sha256=L4iTuVYgfwcaCRTbTCVoo
|
|
|
195
195
|
cognite/neat/v0/core/_issues/warnings/user_modeling.py,sha256=neM9IJzLGWFcBiuo5p5CLFglXjrUXR61FNqvupNw7Y0,4147
|
|
196
196
|
cognite/neat/v0/core/_store/__init__.py,sha256=wpsF8xjIQ5V21NOh45XQV813n_EzgyPOt0VVinYjnDI,140
|
|
197
197
|
cognite/neat/v0/core/_store/_data_model.py,sha256=09JlHEkJVEPHCju8ixRUUsvRcZb0UrDE7wevB7tq4PI,19682
|
|
198
|
-
cognite/neat/v0/core/_store/_instance.py,sha256=
|
|
198
|
+
cognite/neat/v0/core/_store/_instance.py,sha256=zt7pgYwgMbnAwz7Xn-_AiMsXhbBdwXWBRKu2MrgE3jI,18924
|
|
199
199
|
cognite/neat/v0/core/_store/_provenance.py,sha256=Q96wkVXRovO_uTlNvwCAOl6pAoWItTgFq1F79L_FqBk,7335
|
|
200
200
|
cognite/neat/v0/core/_store/exceptions.py,sha256=dTaBSt7IV7XWtS3EsE8lBX1Dv3tfWX1nIEgGHkluy3s,1668
|
|
201
201
|
cognite/neat/v0/core/_utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -244,7 +244,7 @@ cognite/neat/v0/session/engine/__init__.py,sha256=D3MxUorEs6-NtgoICqtZ8PISQrjrr4
|
|
|
244
244
|
cognite/neat/v0/session/engine/_import.py,sha256=1QxA2_EK613lXYAHKQbZyw2yjo5P9XuiX4Z6_6-WMNQ,169
|
|
245
245
|
cognite/neat/v0/session/engine/_interface.py,sha256=3W-cYr493c_mW3P5O6MKN1xEQg3cA7NHR_ev3zdF9Vk,533
|
|
246
246
|
cognite/neat/v0/session/engine/_load.py,sha256=u0x7vuQCRoNcPt25KJBJRn8sJabonYK4vtSZpiTdP4k,5201
|
|
247
|
-
cognite_neat-0.125.
|
|
248
|
-
cognite_neat-0.125.
|
|
249
|
-
cognite_neat-0.125.
|
|
250
|
-
cognite_neat-0.125.
|
|
247
|
+
cognite_neat-0.125.1.dist-info/METADATA,sha256=LLvRsl7t080WFH_4QDr-E-s7Ih0D0tzlxod801LiHI4,9147
|
|
248
|
+
cognite_neat-0.125.1.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
249
|
+
cognite_neat-0.125.1.dist-info/licenses/LICENSE,sha256=W8VmvFia4WHa3Gqxq1Ygrq85McUNqIGDVgtdvzT-XqA,11351
|
|
250
|
+
cognite_neat-0.125.1.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|