Open Demirrr opened 6 days ago
KnowledgeBase implements the following computation in the initialization
self.ind_set = init_individuals_from_concepts(include_implicit_individuals,
reasoner=self.reasoner,
ontology=self.ontology,
individuals_per_concept=(self.individuals(i) for i in
self.get_concepts()))
see here This implies that we compute individuals for each concepts. This leads to a bottleneck on large knowledge graph. Since TripleStoreKnowledgeBase inherits from KnowledgeBase, we cannot use it as it is on large knowledge graphs. Yet, TripleStore works like charm but it does not implement few functions that KnowledgeBase implements.
We need to think about bringing them together @alkidbaci @LckyLke
Yes I do agree that a refactoring is needed here and we should have a single triple store KB class. The suggested combined class should ideally still inherit from KnowledgeBase
so that we can use our CEL algos without any extra changes and it needs to be fast like TripleStore
. Its been a while since we implemented this but there are some clear differences in their structure. I suggest evaluating the possible merging points first and try to come up with a merging solution that satisfies all objectives. I can have a better look on this after I finish some other tasks but @LckyLke please feel free to take this one if you think of a solution before me.
Should consider finding a solution for #446 also
Is there any reason why the ind_set is not just simply initialized like this?:
self.ind_set = frozenset(self.ontology.individuals_in_signature())
Is there any reason why the ind_set is not just simply initialized like this?:
self.ind_set = frozenset(self.ontology.individuals_in_signature())
Not that I am aware of 😀
Shall we combine these classes into one ?