Discussion Forum

TypeDB vs Stardog

I’m evaluating knowledge graphs for a project that will require the reasoning functionality. I notice that Stardog has this also. Besides being open source, what sets TypeDB apart from Stardog?

First, we should note that TypeDB implements its own language and doesn’t follow Semantic Web standards. The result is that TypeDB offers a higher level database language which eliminates the complexity of, for example, working with OWL, while maintaining a high degree of expressivity.
If you want to learn about how TypeDB compare to Semantic Web standards in general, you can read here: Semantic Web Standards and TypeDB | Vaticle

Specifically about reasoning, we have some differences:

Stardog cons:

  • limited support for recursive rules - you can have a cycle in a rule but you cannot have a cycle among mutliple rules:
IF 
{ ?x :hasFather ?y . ?y :hasBrother ?z } 
THEN 
{ ?x :hasUncle ?z } 
   
IF 
{ ?x :hasChild ?y . ?y :hasUncle ?z } 
THEN 
{ ?x :hasBrother ?z }

this is an example that is banned

  • no support for negations in rules, eg. “NOT EXISTS” is not allowed in the rule condition

Stardog pros:

  • supports functions in rule conditions
IF {
     ?c a :Circle ;
        :radius ?r
     BIND (math:pi() * math:pow(?r, 2) AS ?area)
}
THEN {
    ?c :area ?area
}

note: we also plan on adding arithmetic to TypeDB to allow this functionality

  • support for multiple conclusions in a rule
IF {
      ?x a :SuperUser.
      ?y a :Resource.
      ?z a <http://www.w3.org/ns/sparql#UUID>.
}
THEN {
      ?z a :Role.
      ?x :hasRole ?z; :readPermission ?y.
}

note: this can be achieved with multiple rules in TypeDB, with some performance penalty. We will also support this natively in the future.

  • rules can conclude new/multiple types for a fact
IF {
      ?x a :Person; :hasAge ?age.
      FILTER (?age >= 13 && ?age <= 19)
}
THEN {
      ?x a :Teenager.
}

note: we do not plan on supporting this

1 Like

brilliant answer. Question, what is the TypeQL approach to solve the third classification problem?

probably a classification relation that can be inferred? Or an attribute!