Quoting Rickard Öberg <[email protected]>:
If you then instead make one table for X, and which has columns <id,X> where id can point to A or B, then you can query for it, but it becomes very tricky to assemble an A or B, because you have to look in so many tables, and RDBMS's are not really built for it. Graph databases do this much better because you always start with 'id' and look at "what has been associated with 'id'" which you can then trivially access.
Exactly. That's why I was thinking of my current work on RDBMS being indexing-only storage, with the primary storage being something else. I still think that actual querying can be done better using RDBMS, partly because most, even free, implementations of RDBMS are so highly optimized, unlike what I've seen in RDF world. Of course that is partly because RDBMS world is older than RDF.
Btw - it is possible to perform as many queries as entity has QNames - if all tables have id in them. Then you can just collect ALL data into chunks in one single loop in your code, close statement(s), and build entity after that. So if your entity has 10 QNames (including QNames of used ValueComposites), it takes 10 (very simple SELECT) queries to build it. I guess only actual performance tests will tell whether building entities out of indexing tables is feasible.
Speaking of that - how large you would estimate your entitites to be QName-wise? Ie, including value composites, how many QNames are there in your entities in your application on average? "You" here means anyone who is reading this and has some kind of Qi4j-app going on.
To me it seems like doing mapping from entities to tables is like trying to squeeze a square through a round hole. With a lot of effort and hacking it can be done, but what's the point?
I guess the point is to add RDBMS support to Qi4j to help it spread wider. That's how I remember it from some old mail I read which made me start doing work on this. I think it was near the time when Qi4j 1.0 was released. Plus - this has been extremely interesting learning process for me personally. :)
_______________________________________________ qi4j-dev mailing list [email protected] http://lists.ops4j.org/mailman/listinfo/qi4j-dev

