+ SPARQL CONSTRUCT support
authorAlexandre Bertails <bertails@gmail.com>
Sun, 28 Aug 2011 14:49:04 -0400
changeset 15 80c5cebba882
parent 14 25334ed662e2
child 16 72f48cef617d
+ SPARQL CONSTRUCT support
src/test/scala/Test.scala
--- a/src/test/scala/Test.scala	Sun Aug 28 14:42:57 2011 -0400
+++ b/src/test/scala/Test.scala	Sun Aug 28 14:49:04 2011 -0400
@@ -108,12 +108,12 @@
 </rdf:RDF>
 """, baseURI)
 
-  "POSTing an RDF documenton Joe's URI" should {
+  "POSTing an RDF document to Joe's URI" should {
     "succeed" in {
       val httpCode:Int = Http(joe.post(diffRDF) get_statusCode)
       httpCode must_== 200
     }
-    "append the diff graph" in {
+    "append the diff graph to the initial graph" in {
       val model = Http(joe as_model(baseURI))
       model must beIsomorphicWith (expectedFinalModel)
     }
@@ -140,9 +140,24 @@
   
   """POSTing "ASK ?name WHERE { [] foaf:name ?name }" to Joe's URI""" should {
     "return true" in {
-      val result:Boolean = Http(joe.post(askFoafName) >~ { s => (XML.fromSource(s) \ "boolean" \ text).head.toBoolean } )
+      val result:Boolean =
+        Http(joe.post(askFoafName) >~ { s => 
+          (XML.fromSource(s) \ "boolean" \ text).head.toBoolean
+          } )
       result must_== true
     }
   }
+  
+  val constructIdentity =
+"""
+CONSTRUCT { ?s ?p ?o } WHERE { ?s ?p ?o }
+"""
+  
+  """POSTing "CONSTRUCT { ?s ?p ?o } WHERE { ?s ?p ?o }" to Joe's URI""" should {
+    "return an isomorphic RDF graph" in {
+      val model = Http(joe as_model(baseURI))
+      model must beIsomorphicWith (expectedFinalModel)
+    }
+  }
     
 }