Skip to content

Commit

Permalink
related entities histories bugfix
Browse files Browse the repository at this point in the history
  • Loading branch information
arcangelo7 committed Oct 21, 2024
1 parent 9b1f287 commit 5c59d70
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "time-agnostic-library"
version = "4.6.5"
version = "4.6.6"
description = "time-agnostic-library is a Python ≥3.7 library that allows performing time-travel queries on RDF datasets compliant with the OCDM v2.0.1 provenance specification."
authors = ["Arcangelo Massari <[email protected]>"]
readme = "README.md"
Expand Down
7 changes: 3 additions & 4 deletions src/time_agnostic_library/agnostic_entity.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ def _collect_related_entities_recursively(
processed_entities.add(entity_uri)

# Get the history of the entity and store it
agnostic_entity = AgnosticEntity(entity_uri, self.config, related_entities_history=self.related_entities_history)
agnostic_entity = AgnosticEntity(entity_uri, self.config, related_entities_history=False)
entity_history = agnostic_entity._get_entity_current_state(include_prov_metadata)
entity_history = agnostic_entity._get_old_graphs(entity_history)
histories[entity_uri] = (entity_history[0], entity_history[1]) # Store both history and metadata
Expand Down Expand Up @@ -153,8 +153,8 @@ def _get_merged_histories(
"""
# Prepare the histories and metadata dictionaries
entity_histories = {}
metadata = {}

metadata = {}
for entity_uri, (entity_history_dict, entity_metadata) in histories.items():
entity_histories[entity_uri] = entity_history_dict[entity_uri]
if include_prov_metadata and entity_metadata:
Expand Down Expand Up @@ -187,9 +187,8 @@ def _get_merged_histories(
relevant_time = etime
else:
break

if relevant_time:
for quad in entity_histories[entity_uri][relevant_time].quads((None, None, None, None)):
for quad in entity_histories[entity_uri][relevant_time].quads():
merged_graph.add(quad)

merged_histories[self.res][timestamp] = merged_graph
Expand Down

0 comments on commit 5c59d70

Please sign in to comment.