Skip to content

Commit

Permalink
measure_merge_performance_with_distributions
Browse files Browse the repository at this point in the history
  • Loading branch information
arcangelo7 committed Nov 29, 2024
1 parent 682825a commit 9d895d3
Show file tree
Hide file tree
Showing 3 changed files with 211 additions and 159 deletions.
3 changes: 0 additions & 3 deletions oc_meta/plugins/editor.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,6 @@ def merge(self, g_set: GraphSet, res: URIRef, other: URIRef) -> None:
"""
# First get all related entities with a single SPARQL query
related_entities = set()

if other in self.relationship_cache:
related_entities.update(self.relationship_cache[other])
else:
Expand All @@ -201,7 +200,6 @@ def merge(self, g_set: GraphSet, res: URIRef, other: URIRef) -> None:

self.relationship_cache[other] = other_related
related_entities.update(other_related)

if res in self.relationship_cache:
related_entities.update(self.relationship_cache[res])
else:
Expand Down Expand Up @@ -230,7 +228,6 @@ def merge(self, g_set: GraphSet, res: URIRef, other: URIRef) -> None:
entities_to_import.update(related_entities)
entities_to_import = {e for e in entities_to_import
if not self.entity_cache.is_cached(e)}

# Import only non-cached entities if there are any
if entities_to_import:
try:
Expand Down
1 change: 1 addition & 0 deletions oc_meta/run/merge/entities.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ def fetch_related_entities_batch(self, meta_editor: MetaEditor, merged_entities:
print(f"Error fetching related entities for surviving batch {i}-{i+batch_size}: {e}")

return all_related_entities

def process_file(self, csv_file: str) -> str:
"""Process a single CSV file with cross-row batch processing"""
data = self.read_csv(csv_file)
Expand Down
Loading

0 comments on commit 9d895d3

Please sign in to comment.