fluree / core

Fluree releases and public bug reports
0 stars 0 forks source link

[BUG] Reverse queries using the predicate iri cache #98

Open zonotope opened 3 months ago

zonotope commented 3 months ago

Describe the bug Reverse queries involving the predicate iri cache return empty results

To Reproduce Run the fluree.db.query.property-test/subjects-as-predicates test (currently marked pending)

Expected behavior The test passes with a non-empty result set as indicated in the test.

Additional context This issue was discovered while refactoring the json-ld query response formatter to support federated queries. The test was only coincidentally passing before because the response formatter was reading the wrong key from a map so it always got nil, and nil matches everything in our index range scans, so the query returned everything in the ledger. It just so happens that there was nothing in the test ledger that should have been excluded from the results, so the test passed. When the query response code was fixed so that it read the correct key from the map, the result set was empty.

I think this has to do with the predicate iri cache not being set properly, or reverse queries not being handled properly, but I have not investigated.