simplifying in Set-land
authorEric Prud'hommeaux <bertails@w3.org>
Wed, 16 Dec 2009 18:54:25 -0500
changeset 57 268b67c19423
parent 56 b0fae6434392
child 58 b68c7026e545
simplifying in Set-land
src/main/scala/RDB2RDFMain.scala
--- a/src/main/scala/RDB2RDFMain.scala	Wed Dec 16 17:58:14 2009 -0500
+++ b/src/main/scala/RDB2RDFMain.scala	Wed Dec 16 18:54:25 2009 -0500
@@ -135,14 +135,15 @@
 	    List()
 	  }
 	}
-	val sjoin = joined contains(relalias) match {
+	joined contains(relalias) match {
 	  case false => {
 	    //joins = joins ::: List(Join(AliasedResource(rel,relalias), sconstraint))
 	    joined += relalias
-	    Some(AliasedResource(rel,relalias))
+	    joins = joins ::: List(AliasedResource(rel,relalias))
 	  }
-	  case true => None
+	  case true =>
 	}
+
 	val target = db.relationdescs(rel).attributes(attr) match {
 	  case ForeignKey(fkrel, fkattr) => {
 	    val oRelAlias = relAliasFromO(o)
@@ -179,21 +180,10 @@
 	    joined contains(oRelAlias) match {
 	      case false => {
 
-		sjoin match { // complex dance to keep joins ordered -- ouch!
-		  case Some(x) => joins = joins ::: List(x)
-		  case None => 
-		}
-
 		joins = joins ::: List(AliasedResource(fkrel,oRelAlias))
 		joined = joined + oRelAlias
 	      }
 	      case true => {
-		sjoin match {
-		  case Some(x) => {
-		    joins = joins ::: List(x)
-		  }
-		  case None => 
-		}
 	      }
 	    }
 	  }
@@ -208,11 +198,6 @@
 		varmap += v -> binding
 	      }
 	    }
-	    sjoin match {
-	      case Some(x) => joins = joins ::: List(x)
-	      case None => 
-	    }
-
 	  }
 	}