changeset 37:3e1521c837cb

~ s/SQL/RDB/ # package is about relational structure
author Eric Prud'hommeaux <eric@w3.org>
date Wed, 13 Oct 2010 22:06:06 -0400
parents 15ef23dfd492
children 871a0feead53
files src/main/scala/Main.scala src/test/scala/Test.scala
diffstat 2 files changed, 4 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- 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",
Set up and maintained by W3C Systems Team, please report bugs to sysreq@w3.org.

W3C would like to thank Microsoft who donated the server that allows us to run this service.