7 ms·
Honestly I think people's assumption that graph databases must be better in representing binary relations might be a bit optimistic. After all there's no reason
by contravariant 5y ago
Honestly I think people's assumption that graph databases must be better in representing binary relations might be a bit optimistic. After all there's no reason relational databases (named after the n-ary relationships that tables represent) couldn't handle binary relations.
The one thing that's definite is that SQL is a bad choice for particular kinds of queries, though most graph databases don't seem to go much further than improving (?) the syntax a little bit and adding transitive closure (which is also present in several SQL databases). A few graph databases do allow for more complex (even arbitrary) inference, but this somehow never seems to make the headlines.
- zozbot234 5y agoModern SQL can express arbitrary queries (including transitive closure ofc.) since it allows for recursive table expressions.
- contravariant 5y agoThat's still some ways of from what I'd call "arbitrary" but yeah you can go quite far.
- zozbot234 5y ago> That's still some ways of from what I'd call "arbitrary" How so? What's practically missing?
- contravariant 5y agoWell the most useful way I've found of classifying stuff is by analogy with formal grammars. If you view the kind of paths you can query as the set of words in a language then you get something like: Basic (non-recursive) SQL: Finite paths Recursive SQL / Transitive closure (with negation): Regular paths However the hierarchy of languages doesn't end there. And some graph databases allow you to add arbitrary grammar rules, which make it possible to add some complex rules like: - If condition X,Y and Z is satisfied then person A and B are the same person - Equality is transitive - If two people are equal then each property of one is also a property of the other. The part that makes this tricky is that figuring out two people are equal can cause other people to now suddenly satisfy the condition for equality. You could also construct some examples by creating conditions which aren't "regular" (e.g. person A and B have an ancestor which is the same number of generations back for both of them).