eBay / akutan

A distributed knowledge graph store
Apache License 2.0
1.65k stars 107 forks source link

don't assume all predicates are transitive. #28

Open superfell opened 5 years ago

superfell commented 5 years ago

Currently the query engine assumes that all predicates are transitive, unless it knows the target object is a literal. This is a pretty expensive default. It would be better to only treat predicates explicitly declared as transitive as transitive. the owl:TransitiveProperty predicate seems like the best thing to use to indicate that. The query rewriter could be updated to fetch this property for all the predicates used in the query, and then pass this info along with the rest of the query structure.

darrengarvey commented 5 years ago

Agreed that's the ideal way to implement this.

The kleene star property path would also be useful for ad-hoc transitive queries. In general a user should have to be explicit about transitivity though so using owl:TransitiveProperty is more user-friendly.

One nice-to-have would be to ensure the matched edges are returned in the order that they are traversed. I don't see any mention in the SPARQL specs that this is an expected guarantee.