tag:blogger.com,1999:blog-3346090548501966296.post6814633873099539674..comments2024-03-16T04:52:03.568-07:00Comments on Perspectives on LedgerSMB: Object-Relational Algebra 3: The Series Join functionChris Travershttp://www.blogger.com/profile/06211762965865744803noreply@blogger.comBlogger4125tag:blogger.com,1999:blog-3346090548501966296.post-75558665165189545402013-01-07T01:17:19.117-08:002013-01-07T01:17:19.117-08:00One area where a functional notation might make a ...One area where a functional notation might make a difference might be if we are generating a hierarchy out of, say CIDR blocks which we might need to know if we were using a database to generate routing tables. We want to know how the blocks relate to eachother. <br /><br />Here the join condition is going to be only partially relational. Relational math itself is insufficient to tell us whether one CIDR block is contained in another. So we could build a hierarchy using a functional notation, where part of that function is expressed relationally.Chris Travershttps://www.blogger.com/profile/06211762965865744803noreply@blogger.comtag:blogger.com,1999:blog-3346090548501966296.post-6419377213880725812013-01-07T01:11:32.125-08:002013-01-07T01:11:32.125-08:00I am pretty sure you can show them to be equivalen...I am pretty sure you can show them to be equivalent provided that the operator is a series operator. In other words, what is important is not the join/rename/union/projection (that is effectively what goes on in the series join function) but rather the fact that it is a series.<br /><br />There is a second difference and that is that I express the output as functions of the relation that is output rather than as tuple members. This is primarily designed to abstract the actual storage output and allow expressive flexibility down the road. The reason has to do with non-relational functional dependencies though to be sure my guess is that these are probably most useful when being dependencies of the joining relations (I can't think of any cases where this would be necessary here), although I suppose if a key was sufficiently informative it might. For example, if you were joining IP addresses together based on routing tables, a non-relational functional dependency might be the broadcast address on any given segment (i.e. it is a functional dependency which can be calculated but not through relational math).<br /><br />Again anything relational you can do with a series join functional notation you can do with a series of join/rename/union/projection operations but in the end it is the series portion which is important.<br /><br />I do think they are substantively equivalent on the relational side. The only real difference is that a functional notation allows one to provide hooks for non-relational calculations, looking into the data.Chris Travershttps://www.blogger.com/profile/06211762965865744803noreply@blogger.comtag:blogger.com,1999:blog-3346090548501966296.post-77570921243258600592013-01-07T00:37:21.533-08:002013-01-07T00:37:21.533-08:00This "tclose" as Chris Date and Hugh Dar...This "tclose" as Chris Date and Hugh Darwen refer to is a convenient foundation on which to write hierarchical queries, such as regarding a bill of materials.Darren Duncanhttps://www.blogger.com/profile/14457831481137852460noreply@blogger.comtag:blogger.com,1999:blog-3346090548501966296.post-80559084178020908702013-01-07T00:30:11.772-08:002013-01-07T00:30:11.772-08:00What you talk about makes me think of a generic &q...What you talk about makes me think of a generic "transitive closure" operation that Date and Darwen talk about in their literature, which takes a binary relation representing nodes of a graph as input and results in another binary relation representing arcs of that graph. This operator is defined in terms of join plus rename plus union plus projection. See also my Perl module Set::Relation which implements this, calling it "tclose". Is your proposed operator the same or different than the "tclose" implemented at http://cpansearch.perl.org/src/DUNCAND/Set-Relation-0.12.7/lib/Set/Relation/V2.pm ? Darren Duncanhttps://www.blogger.com/profile/14457831481137852460noreply@blogger.com