I’m using the TypeDB 2.11.1 and noticing that it will take ~1 second for 1 rule to write into the schema. Based on my situation and also the fact that the rule doesn’t support disjunction, eventually, it will have thousands of rules.
My questions are:
How many rules does TypeDB support? Is there any maximum number limit?
Any way to speed up the rule writing process? What kind of conditions relate to the speed?
The nature of my model is that the number of rules are much much bigger than the number of entities, because the model is based on heavy deductive logic. For exmaple, it will have 2000 rules based on 8 entities. Is TypeDB the right choice to this kind of certain job?
Just on Tuesday we released TypeDB 2.14.1, which improved the speed of rule validation. You can download it now from our download centre and try it out.
To answer your questions directly:
There’s no theoretical limit to how many rules TypeDB can support.
Providing additional constraints such as typing information to your rules speeds up validation time dramatically. For example, use $p isa person, has name "Zack" instead of $p has name "Zack". By keeping the scope of possible types $p could be as tight as possible, the rule validator only has to validate the necessary types.
TypeDB is definitely an excellent choice for any job that involves large amounts of deductive logic.
Just a helpful hint: adding new rules will only have to validate the new rules, but adding new types means all of the rules have to be re-validated according to these new types. The order of operations here matters greatly!
Let us know if you have any further questions or need assistance in getting up and running.
I tried 2.14.1, it’s 10 times faster than 2.11.1. Thanks for the info! Any suggestions on how to deal with the non-disjunction of rule? I’m using groups of rules to mimic the behavior now, which sounds not smart at all.
Ah, how interesting. It appears the latest TypeDB client-java is using the previous version of the language parser that does not allow rules to contain disjunctions, while the server is operating over disjunctions in rules correctly. We’ll have to think about how to address that gap in our testing.
Thanks for the heads up, we’ll release the fixed versions tomorrow!
Thanks, Joshua! Some feedback: Tried TypeDB 2.14.2 with TypeDB studio 2.14.1, the error is still showed up when importing to schema, however after clicking the check mark, it says being successfully commited. Then, when trying the match query, there is no ruled relations showed up, which are supposed to have. Do I need to use studio 2.14.2 to pair the new TypeDB? But I don’t have the release.
My apologies, Studio release is lagging by a few days while we work on some necessary fixes. I’ll drop you a message here once it’s released.
For now, your workaround sounds as though it should be working. Have you turned infererence on before running the query?
If it is somehow the case that your rules are being removed from your schema before committing, I’d advise committing your schema through another means such as Console (Release TypeDB Console 2.14.2 · vaticle/typedb-console · GitHub) and then using Studio normally from then on. Let us know if you encounter any issues in doing so.