ranking-agent / aragorn

A Translator ARA combining asynchronous database querying, answer coalescence, and answer ranking.
MIT License
4 stars 3 forks source link

lookups are going into support #185

Closed cbizon closed 1 year ago

cbizon commented 1 year ago

We run rules and lookups and merge the results.

But we do the lookup by just adding the lookup predicate as one more rule. So the handling of lookups and rules is uniform.

Whatever comes back from strider or robokop in response to a rule gets shoved into a support_graph. But in the case of lookup results, those should be in the analysis edge_binding instead.

cbizon commented 1 year ago

I have a reasonable fix for this. However there is an interesting case that I'm unsure how to handle.

We have a rule: (a)-[ameliorates]->(b) ==> (a)-[treats]->(b).

So when we run an inferred query, we'll run both ends of this.

Because treats is a subproperty of ameliorates, any real treats edge will also be returned for the ameliorates query.

So the treats edge shows up with both a lookup and a creative query.

I guess somehow we need to check for this situation? What's the condition?

cbizon commented 1 year ago

I think we check to see if a set of creative edge id's are exactly the same as the edge id's of a lookup result

cbizon commented 1 year ago

In fact that filtering covers a lot of degenerate results, and works well. I think that we probably want to go over our rules and look for cases where one is a proper subset of another. If nothing else, it means we're double querying.