--- a/directmapping-test/src/main/scala/DirectMappingTestSuite.scala Sat Feb 12 17:56:59 2011 -0500
+++ b/directmapping-test/src/main/scala/DirectMappingTestSuite.scala Sat Feb 12 18:33:02 2011 -0500
@@ -19,7 +19,6 @@
def testDirectMapping(testName:String, db:Database, expectedGraph:Graph):Unit =
test(testName) {
val computedGraph = databaseSemantics(db)
- DirectMapping.NextBNode = 97 // @@ call the "i'd like to reset my fresh variables to 0 so i can have predictable node names" function
assert (expectedGraph === computedGraph)
}
--- a/directmapping/src/main/scala/DirectMapping.scala Sat Feb 12 17:56:59 2011 -0500
+++ b/directmapping/src/main/scala/DirectMapping.scala Sat Feb 12 18:33:02 2011 -0500
@@ -11,7 +11,7 @@
trait DirectMapping {
// should be done by BNode
- var NextBNode = 97
+ private var NextBNode = 97
def freshbnode () : BNode = {
val ret = NextBNode
NextBNode = NextBNode + 1
@@ -71,6 +71,7 @@
/** The triples-generating functions start with databasemap: */
def databaseSemantics (db:Database) : Graph = {
+ NextBNode = 97
val nodeMap = dbToNodeMap(db)
Graph(db.keySet flatMap { (rn:RelName) => relationSemantics(db(rn), nodeMap, db) })
}