- From: Keean Schupke <keean@fry-it.com>
- Date: Mon, 4 Apr 2011 15:55:24 +0000
- To: Joran Greef <joran@ronomon.com>
- Cc: public-webapps@w3.org
- Message-ID: <BANLkTimV0i3a4QmxSS83UXWvjmozTm8dSA@mail.gmail.com>
Yes, it already has well defined set operations. Solid is a matter of testing by enough people (and if you wanted to try it and feed back that would be a start). Fast should not be a problem, as the SQL database does all the heavy lifting. In more detail, Codd's six primitive operators are project, restrict, cross-product, union and difference. Relations are an extension of Sets, so intersection and difference on compatible relations behave like they would on sets. RelationalDB already implements the following 5 methods making it relationally-complete. Meaning it can do anything you could possibly want to do with relations using combinations of these 5 methods. Relation.prototype.project = function(attributes) { // this implements rename as well. Relation.prototype.restrict = function(exp) Relation.prototype.join = function(relation, exp) { Relation.prototype.union = function() {}; Relation.prototype.difference = function() {}; Of course some things can be made easier, so the following methods, although they can be defined in terms of the above 5, will be provided (in future implementations) to keep user code concise and implementations thin and fast. // derived methods Relation.prototype.intersection = function() {}; Relation.prototype.thetajoin = function() {}; Relation.prototype.semijoin = function() {}; Relation.prototype.antijoin = function() {}; Relation.prototype.divide = function() {}; Relation.prototype.leftjoin = function() {}; Relation.prototype.rightjoin = function() {}; Relation.prototype.fulljoin = function() {}; We also hope to provide the lattice operators "meet" and "join": http://en.wikipedia.org/wiki/Lattice_(order) Just these two operators can replace all 5 of Codd's primitives (including all set operations). With just these two you can do anything that you can with _all_ the above. Meet is actually the same as Codd's natural-join (unfortunately terminology in different mathematical fields is not consistent here) and Join is a generalised union operator. See: http://www.arxiv.com/pdf/cs/0501053v2 To see how Meet and Join can be used to construct each of the above operators. Cheers, Keean. On 4 April 2011 15:36, Joran Greef <joran@ronomon.com> wrote: > On 04 Apr 2011, at 5:26 PM, Keean Schupke wrote: > > > This is ignoring the possibility that something like RelationalDB could > be used, where a well defined common subset of SQL can be used (and I use > well-defined in the formal sense). This would allow a relatively thin > wrapper on top of most SQL implementations and would allow SQLite (or BDB) > to be used as the backend. > > Yes, if an implementation of RelationalDB arrives which is solid and fast > with support for set operations that would be great. The important thing is > that we have two competing APIs (and preferably a strong API with a great > track record).
Received on Monday, 4 April 2011 15:56:00 UTC