--- a/src/main/scala/Main.scala Tue Oct 12 14:01:46 2010 -0400
+++ b/src/main/scala/Main.scala Wed Oct 13 22:06:06 2010 -0400
@@ -3,14 +3,14 @@
import scala.collection.Set
// Relational structure
-object SQL {
+object RDB {
case class Database (m:Map[RelName, Relation]) {
def apply (rn:RelName) = m(rn)
def keySet () = m.keySet
}
- case class Relation (name:RelName, header:Header, body:Body, candidates:List[CandidateKey], pk:Option[CandidateKey], fks:ForeignKeys)
+ case class Relation (name:RelName, header:Header, body:Set[Tuple], candidates:List[CandidateKey], pk:Option[CandidateKey], fks:ForeignKeys)
case class Header (m:Map[AttrName, SQLDatatype]) {
def apply (a:AttrName) = m(a)
def keySet () = m.keySet
@@ -49,8 +49,6 @@
case class SQLVarchar () extends SQLDatatype
case class SQLString () extends SQLDatatype
- type Body = Set[Tuple]
-
case class Tuple (m:Map[AttrName, CellValue]) {
def apply (a:AttrName) = m(a)
def lexvalue (a:AttrName) : Option[LexicalValue] =
@@ -131,7 +129,7 @@
object Transformer {
import RDF._
- import SQL._
+ import RDB._
/** A KeyMap associates the candidate key and key values with the
* node for any tuple in a unique relation. */
--- a/src/test/scala/Test.scala Tue Oct 12 14:01:46 2010 -0400
+++ b/src/test/scala/Test.scala Wed Oct 13 22:06:06 2010 -0400
@@ -2,7 +2,7 @@
import Transformer._
import RDF._
-import SQL._
+import RDB._
import org.scalatest.FunSuite
@@ -13,8 +13,6 @@
implicit def string2relName (n:String) = RelName(n)
implicit def string2attrName (n:String) = AttrName(n)
-
-
test("2 People 1 Addresses") {
val addrs = Relation("Addresses",