--- a/src/main/scala/RDB2RDFMain.scala Sat Dec 12 12:39:01 2009 -0500
+++ b/src/main/scala/RDB2RDFMain.scala Sat Dec 12 12:50:55 2009 -0500
@@ -99,7 +99,7 @@
}
def VarConstraint(v:Var, attr:FQAttribute) = {
- println("?" + v.s + "=> @@Binding(" + attr + ")")
+ println("?" + v.s + "=> @@Binding(" + toString(attr) + ")")
}
def LiteralConstraint(lit:SparqlLiteral, attr:FQAttribute) = {
@@ -108,10 +108,8 @@
def getKeyTarget(from:FQAttribute) : Option[FQAttribute] = {
from match {
- case FQAttribute(Relation(Name("Employee")), Attribute(Name("manager"))) =>{
- println(from + " is an fk")
+ case FQAttribute(Relation(Name("Employee")), Attribute(Name("manager"))) =>
Some(FQAttribute(Relation(Name("Employee")), Attribute(Name("id"))))
- }
case FQAttribute(Relation(Name("Employee")), Attribute(Name("lastName"))) => None
}
}
--- a/src/test/scala/RDB2RDFTest.scala Sat Dec 12 12:39:01 2009 -0500
+++ b/src/test/scala/RDB2RDFTest.scala Sat Dec 12 12:50:55 2009 -0500
@@ -11,7 +11,8 @@
SELECT ?empName ?manageName {
?emp <http://hr.example/DB/Employee#lastName> ?empName .
?emp <http://hr.example/DB/Employee#manager> ?manager .
-?manager <http://hr.example/DB/Employee#lastName> ?managName
+?manager <http://hr.example/DB/Employee#lastName> ?managName .
+?manager <http://hr.example/DB/Employee#manager> <http://hr.example/DB/Employee/id.18#record>
}
""").get
val sqlParser = Sql()