vaticle / typedb

TypeDB: the polymorphic database powered by types
https://typedb.com
Mozilla Public License 2.0
3.72k stars 337 forks source link

Inferred relation ID should have a constant ID across multiple queries #7032

Open maydanw opened 2 months ago

maydanw commented 2 months ago

Problem to Solve

When making multiple queries with inferred relations it is hard to align, combine, and properly connect the results sets.

Current Workaround

It is possible to create an ID on the client side through hashing it's surrounding

Proposed Solution

Make the inferred relation ID a hash of the IDs it connects (or just the first two will suffice for 95% of the cases) and therefore if it connects the same entities (in the final conclusion) it will have the same ID

Additional Information

image An example of the same query ran twice. The ID is the key in the local repo so the duplicated relations is where the ID had changed.

maydanw commented 2 months ago

On a different/similar note, I also encountered relationships without any id (hadn't investigated why yet) printscreen