changeset 336:8d846f38b2ca no-hierarchy

~ the BNode initializer is reset in databaseSemantics
author Alexandre Bertails <bertails@gmail.com>
date Sat, 12 Feb 2011 18:33:02 -0500
parents 9a828553ea69
children 36f6fb9e06fa
files directmapping-test/src/main/scala/DirectMappingTestSuite.scala directmapping/src/main/scala/DirectMapping.scala
diffstat 2 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- 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) })
     }
Set up and maintained by W3C Systems Team, please report bugs to sysreq@w3.org.

W3C would like to thank Microsoft who donated the server that allows us to run this service.