> Because of the "named queries", you can combine lower-level queries in higher-level ones, to create a hierarchy of "dynamically generated concepts", which I haven't seen any other technology be able to do.
This is the purpose of functions in most programming languages. A function is kind of like an HTML template, but for code. So rather than have `<h1 title="{{bar}}">{{foo}}</h1>` you have `function(foo, bar) { return h1({title: bar, text: foo}); }`. DOM tree, AST ("abstract syntax tree"), relational data, same thing: a graph, and most programming languages can represent raw graph nodes/edges easily as lists of strings. You can write a simple tuple-matching engine in Javascript: https://gist.github.com/notduncansmith/7858d27a2b875ff10b84
Obviously that's not a production-ready piece of software, but it highlights an important lack of distinction between "database" and "program" that wasn't readily apparent to me as a developer for a while.
HTML, source code, and user input are all the same thing (just data, really). One program's source code is another's input data, all the way down.
If you want to get existential, you can extend this even down to matter itself as simply a representation of information: imagine a physical machine in a factory that winds jack-in-the-box toys on their way out the door. Same thing as a higher-order function.
function wind(toy) {
return toy.lever.rotateByDegrees(360);
}
So basically, code is data is matter, your source code is just electricity in a machine and whether you look at it as "code" or "data" is simply a matter of perspective. This is what Lisp folks mean by "code is data".
Moving from the abstract to your concrete case:
> build up a model of your domain of interest that is always computed on-demand, leaving the raw data unchanged in it's default ("normal"?) form. [...] (While named queries are conceptually similar to views in SQL, they are so much more natural to work with.)
SQL views don't compose at the same level that Datalog expressions do, but that's because they aren't typically expressed as raw graph data (i.e. lists of strings where each list item is a node in the graph). If you could just name arbitrary chunks of SQL AST and mash them together, it would be just as composable (though perhaps more cumbersome due to boilerplate).
One final thing before this already-too-long comment comes to a close: you might give CouchDB a look. It's a document datastore that offers map/reduce views written in Javascript (use as much or as little composition/abstraction as you want). The distributed features are pretty cool (bidirectional sync, versioned documents) and writing apps with it is awesome, especially if you can leverage supporting projects like PouchDB or Couchbase Lite. Not sure if it fits your use-case but it sounds like you might find it personally interesting.
Hopefully this has been helpful!