+ RDFModel test suite. The Jena backent already passes it
--- a/jena-test/src/test/scala/JenaTest.scala Thu Jan 13 09:23:43 2011 -0500
+++ b/jena-test/src/test/scala/JenaTest.scala Thu Jan 13 16:40:53 2011 -0500
@@ -1,5 +1,9 @@
package org.w3.rdf.jena
+import org.w3.rdf._
+
+class ConcreteModelTest extends RDFModelTest with JenaModel
+
import org.w3.rdf.rdfxml._
class RDFXMLTestWithJena extends RDFXMLTest with JenaModel
--- a/project/build/RDB2RDF.scala Thu Jan 13 09:23:43 2011 -0500
+++ b/project/build/RDB2RDF.scala Thu Jan 13 16:40:53 2011 -0500
@@ -30,7 +30,7 @@
lazy val rdfxml = project("rdfxml", "rdfxml", new RDFXML(_), rdf)
lazy val rdfxmlTest = project("rdfxml-test", "rdfxml-test", new RDFXMLTest(_), rdfxml)
lazy val jena = project("jena", "jena", new Jena(_), rdf)
- lazy val jenaTest = project("jena-test", "jena-test", new JenaTest(_), jena, directmappingTest, turtleTest, rdfxmlTest)
+ lazy val jenaTest = project("jena-test", "jena-test", new JenaTest(_), jena, rdfmodelTest, directmappingTest, turtleTest, rdfxmlTest)
lazy val sharedtestdata = project("sharedtestdata", "sharedtestdata", new SharedTestData(_), rdb, rdf, sql, turtle)
lazy val directmapping = project("directmapping", "directmapping", new DirectMapping(_), rdb, rdf, sql, sharedtestdata)
lazy val directmappingTest = project("directmapping-test", "directmapping-test", new DirectMappingTest(_), directmapping)
--- a/rdfmodel-test/src/main/scala/RDFModelTestSuite.scala Thu Jan 13 09:23:43 2011 -0500
+++ b/rdfmodel-test/src/main/scala/RDFModelTestSuite.scala Thu Jan 13 16:40:53 2011 -0500
@@ -1,58 +1,23 @@
package org.w3.rdf
-// trait Model {
-
-// type IRI
-// type Graph <: Iterable[Triple]
-// type Triple
-// type BNode
-// type Node
-// type NodeIRI <: Node
-// type NodeBNode <: Node
-// type Subject
-// type SubjectNode <: Subject
-// type Predicate
-// type PredicateIRI <: Predicate
-// type Object
-// type ObjectNode <: Object
-// type ObjectLiteral <: Object
-// type Literal
-// type PlainLiteral <: Literal
-// type TypedLiteral <: Literal
-// type LangTag
-
-// val IRI : Isomorphic1[String, IRI]
+import org.scalatest.FunSuite
-// trait GraphObject {
-// def empty:Graph
-// def apply(elems:Triple*):Graph
-// def apply(it:Iterable[Triple]):Graph
-// }
-// val Graph : GraphObject
-
-// val Triple : Isomorphic3[Subject, Predicate, Object, Triple]
-
-// val BNode : Isomorphic1[String, BNode]
-
-// val NodeIRI : Isomorphic1[IRI, NodeIRI]
-// val NodeBNode : Isomorphic1[BNode, NodeBNode]
-
-// val SubjectNode : Isomorphic1[Node, SubjectNode]
+trait RDFModelTest extends FunSuite with Model with Implicits {
-// val PredicateIRI : Isomorphic1[IRI, PredicateIRI]
-
-// val ObjectNode : Isomorphic1[Node, ObjectNode]
-// val ObjectLiteral : Isomorphic1[Literal, ObjectLiteral]
-
-// val PlainLiteral : Isomorphic2[String, Option[LangTag], PlainLiteral]
-// val TypedLiteral : Isomorphic2[String, IRI, TypedLiteral]
+ test("what's done cannot be undone... but it can be deconstructed") {
+ val timbl = IRI("http://www.w3.org/People/Berners-Lee/card#i")
+ val IRI(timblS) = timbl
+ assert("http://www.w3.org/People/Berners-Lee/card#i" === timblS)
+ val triple = Triple(timbl, timbl, timbl)
+ val Triple(SubjectNode(NodeIRI(s)), PredicateIRI(p), ObjectNode(NodeIRI(o))) = triple
+ assert(timbl === s)
+ assert(timbl === p)
+ assert(timbl === o)
+ val triple2 = Triple(BNode("label"), timbl, PlainLiteral("42", Some(LangTag("fr"))))
+ val Triple(SubjectNode(NodeBNode(BNode(label))), _, ObjectLiteral(PlainLiteral(answer, Some(LangTag(lang))))) = triple2
+ assert("label" === label)
+ assert("42" === answer)
+ assert("fr" === lang)
+ }
-// val LangTag : Isomorphic1[String, LangTag]
-
-// val StringDatatype = IRI("http://www.w3.org/2001/XMLSchema#string")
-// val IntegerDatatype = IRI("http://www.w3.org/2001/XMLSchema#integer")
-// val DateDatatype = IRI("http://www.w3.org/2001/XMLSchema#date")
-// val DateTimeDatatype = IRI("http://www.w3.org/2001/XMLSchema#dateTime")
-
-// }
-
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/rdfmodel-test/src/test/scala/RDFModelTest.scala Thu Jan 13 16:40:53 2011 -0500
@@ -0,0 +1,3 @@
+package org.w3.rdf
+
+class ConcreteModelTest extends RDFModelTest with ConcreteModel