small re-org -- about to generalize joins
authorEric Prud'hommeaux <bertails@w3.org>
Thu, 10 Dec 2009 22:35:15 -0500
changeset 15 878e0bbdc2ec
parent 14 f0b6eaf1913f
child 16 658eef0e7116
small re-org -- about to generalize joins
src/main/scala/RDB2RDFMain.scala
--- a/src/main/scala/RDB2RDFMain.scala	Thu Dec 10 22:27:22 2009 -0500
+++ b/src/main/scala/RDB2RDFMain.scala	Thu Dec 10 22:35:15 2009 -0500
@@ -57,7 +57,7 @@
   * 
  * */
 object RDB2RDF {
-  case class R2RState(project:AttributeList, joins:List[Join], varmap:Map[Var, FQAttribute], exprs:Expression)
+  case class R2RState(project:AttributeList, joins:List[Join], exprs:Expression, varmap:Map[Var, FQAttribute])
 
   def acc(state:R2RState, triple:TriplePattern):R2RState = {
     state
@@ -69,7 +69,7 @@
       // AttributeList(List()), 
       AttributeList(List(
 	NamedAttribute(FQAttribute(Relation(Name("emp")),Attribute(Name("lastName"))),Attribute(Name("empName"))), 
-	NamedAttribute(FQAttribute(Relation(Name("manager")),Attribute(Name("lastName"))),Attribute(Name("managName"))))),
+	NamedAttribute(FQAttribute(Relation(Name("manager")),Attribute(Name("lastName"))),Attribute(Name("managName"))))), 
       // List[Join](), 
       List(
 	Join(TableAlias(Relation(Name("Employee")),Relation(Name("manager"))),
@@ -78,12 +78,12 @@
 				   RValueAttr(FQAttribute(Relation(Name("emp")),Attribute(Name("manager"))))))
 		      ))
       ), 
-      Map[Var, FQAttribute](), 
-      // Expression(List())
+      // Expression(List()), 
       Expression(List(
 	PrimaryExpressionNotNull(FQAttribute(Relation(Name("emp")),Attribute(Name("lastName")))), 
 	PrimaryExpressionNotNull(FQAttribute(Relation(Name("manager")),Attribute(Name("lastName"))))
-      ))
+      )), 
+      Map[Var, FQAttribute]()
     )
     triples.triplepatterns.foreach(s => r2rState = acc(r2rState, s))
     val ret = Select(