--- a/src/main/scala/RDB2RDFMain.scala Thu Dec 17 18:40:11 2009 -0500
+++ b/src/main/scala/RDB2RDFMain.scala Thu Dec 17 18:53:52 2009 -0500
@@ -120,7 +120,7 @@
}
}
- def acc(db:DatabaseDesc, stateP:R2RState, triple:TriplePattern, pk:PrimaryKey):R2RState = {
+ def acc(db:DatabaseDesc, stateP:R2RState, triple:TriplePattern, pk:PrimaryKey, enforeForeignKeys:Boolean):R2RState = {
val TriplePattern(s, p, o) = triple
var state = stateP
p match {
@@ -159,7 +159,8 @@
case OVar(v) => state = varConstraint(state, fkaliasattr, v, db, fkrel)
}
- state = R2RState(state.joins + AliasedResource(fkrel,oRelAlias), state.varmap, state.exprs)
+ if (enforeForeignKeys)
+ state = R2RState(state.joins + AliasedResource(fkrel,oRelAlias), state.varmap, state.exprs)
}
case Value(dt) => {
o match {
@@ -243,7 +244,7 @@
)
/* Examine each triple, updating the compilation state. */
- triples.triplepatterns.foreach(s => r2rState = acc(db, r2rState, s, pk))
+ triples.triplepatterns.foreach(s => r2rState = acc(db, r2rState, s, pk, true))
/* Select the attributes corresponding to the variables
* in the SPARQL SELECT. */
--- a/src/main/scala/SQL.scala Thu Dec 17 18:40:11 2009 -0500
+++ b/src/main/scala/SQL.scala Thu Dec 17 18:53:52 2009 -0500
@@ -18,16 +18,16 @@
override def toString = relalias + "." + attribute
}
case class Attribute(n:Name) {
- override def toString = "'" + n.s + "'"
+ override def toString = n.s /* "'" + n.s + "'" */
}
case class AttrAlias(n:Name) {
- override def toString = "'" + n.s + "'"
+ override def toString = n.s /* "'" + n.s + "'" */
}
case class Relation(n:Name) {
- override def toString = "'" + n.s + "'"
+ override def toString = n.s /* "'" + n.s + "'" */
}
case class RelAlias(n:Name) {
- override def toString = "'" + n.s + "'"
+ override def toString = n.s /* "'" + n.s + "'" */
}
case class TableList(joins:Set[AliasedResource]) {
override def toString = " FROM " + (joins mkString ("\n INNER JOIN "))
@@ -53,7 +53,7 @@
override def toString = "" + fqattribute
}
case class RValueTyped(datatype:SQLDatatype, i:Name) extends RValue {
- override def toString = "'" + i.s + "'" + datatype
+ override def toString = i.s /* "'" + i.s + "'" */ /* + datatype */
}
case class Name(s:String)