3 ms·
> "items in group A which are linked to group C via linkages to items in group B" Relational databases are actually quite convenient for such cases because you
by zozbot234 6y ago
> "items in group A which are linked to group C via linkages to items in group B"
Relational databases are actually quite convenient for such cases because you can model each "group" of items via a database table, including potentially an associative table which provides "linkage" between items in the database. Graph-based models are generally more limited than that, e.g. RDF and SPARQL are limited to simple triples which link a "source" and a "target" entity (both of which are essentially non-typed) according to a fixed "predicate". You can sort of materialize triples and endow them with extra information, but it gets clunky.
- zimpenfish 6y ago> Relational databases are actually quite convenient for such cases I believe that someone may have done this in a nice way but every time I've encountered it (3 times thus far), it's always ended with complex SQL and tables being bent out of shape to try and keep performance. > RDF and SPARQL are limited to simple triples which link a "source" and a "target" entity according to a fixed "predicate" But can also infer transitive relations based on those predicates - `A canSee B`, `B canSee C` => `A canSee C` - which is handy when you're trying to discover those relationships in your data.
- zozbot234 6y ago> But can also infer transitive relations based on those predicates - `A canSee B`, `B canSee C` => `A canSee C` - which is handy when you're trying to discover those relationships in your data. You can do this sort of inference in a view if you use relational databases. (A view is a sort of "virtual" table based on the result of some database query. Many databases can also materialize views for improved performance, though this can make it a bit challenging to manage updates.)
- zimpenfish 6y ago> You can do this sort of inference in a view if you use relational databases. You'd need to use recursive queries though, I think, and there be dragons. > [materialized views] can make it a bit challenging to manage updates We're not using them with Postgres because refreshing materialized views is very much a blunt hammer and it'd cause more hassle than it would solve. Which is annoying because they've been great when I've used them previously.