mirror of
https://github.com/trustgraph-ai/trustgraph.git
synced 2026-07-14 07:42:11 +02:00
fix: index literal objects in entity table for object-based graph queries (#1042)
Literal objects (e.g. rdfs:label values) were not being inserted into the quads_by_entity table with role='O', so queries like `tg-query-graph -o MIL-HDBK-516D` returned no results even though the triple existed. Removed the otype guard that skipped entity row insertion for literals in both insert() and async_insert(). Also updated delete_collection() and async_delete_collection() to include literal objects in entity partition cleanup. Existing data requires re-ingestion for old literal objects to become queryable by object value.
This commit is contained in:
parent
35fc8444ec
commit
f9f5a2318f
3 changed files with 141 additions and 27 deletions
|
|
@ -99,8 +99,8 @@ class TestEntityCentricKnowledgeGraph:
|
|||
# Verify batch was executed
|
||||
mock_session.execute.assert_called()
|
||||
|
||||
def test_insert_literal_object_creates_3_entity_rows(self, entity_kg):
|
||||
"""Test that inserting a quad with literal object creates 3 entity rows"""
|
||||
def test_insert_literal_object_creates_4_rows(self, entity_kg):
|
||||
"""Test that inserting a quad with literal object creates S+P+O entity rows + collection"""
|
||||
kg, mock_session = entity_kg
|
||||
|
||||
mock_session.reset_mock()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue