~ references and scalars don't need to be passed the relation no-hierarchy
authorAlexandre Bertails <bertails@w3.org>
Mon, 14 Feb 2011 14:13:53 -0500
branchno-hierarchy
changeset 344 e4918c0a0e71
parent 343 b4679fb25560
child 345 57ecde6ce678
~ references and scalars don't need to be passed the relation
directmapping/src/main/scala/DirectMapping.scala
rdb/src/main/scala/RDB.scala
--- a/directmapping/src/main/scala/DirectMapping.scala	Sun Feb 13 23:02:26 2011 -0500
+++ b/directmapping/src/main/scala/DirectMapping.scala	Mon Feb 14 14:13:53 2011 -0500
@@ -133,8 +133,8 @@
 	    SubjectNode(freshnode)
 	  }
         }
-      val fromFKs = t.references(r) map { fk => referenceSemantics(nodemap, t, fk) }
-      val fromLexicalValues = t.scalars(r) flatMap { a => lexicalValueSemantics(t, a) }
+      val fromFKs = t.references map { fk => referenceSemantics(nodemap, t, fk) }
+      val fromLexicalValues = t.scalars flatMap { a => lexicalValueSemantics(t, a) }
       // the relation provenance is mapped to an RDF type information, computed from the relation itself
       val fromRelation = (PredicateIRI(IRI("http://www.w3.org/1999/02/22-rdf-syntax-ns#type")),
 			  ObjectNode(NodeIRI(IRI(UE(r)))))
--- a/rdb/src/main/scala/RDB.scala	Sun Feb 13 23:02:26 2011 -0500
+++ b/rdb/src/main/scala/RDB.scala	Mon Feb 14 14:13:53 2011 -0500
@@ -113,7 +113,7 @@
     /**
      * returns all foreign keys that have only not-null values in it
      */
-    def references(r:Relation):Set[ForeignKey] = {
+    def references:Set[ForeignKey] = {
       val nullAttributes:Set[AttrName] =
 	m collect { case (attrName, cellValue) if cellValue == ␀ => attrName } toSet
 
@@ -124,7 +124,7 @@
      * returns all the not null attribute names
      * such that they don't also define a unary foreign key
      */
-    def scalars(r:Relation):Set[AttrName] = {
+    def scalars:Set[AttrName] = {
       val notNullAttributes:Set[AttrName] =
 	m collect { case (attrName, cellValue) if cellValue != ␀ => attrName } toSet