jena-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a...@apache.org
Subject [1/3] jena git commit: Fix to ElementTransformer for GRAPH.
Date Fri, 18 Mar 2016 13:02:42 GMT
Repository: jena
Updated Branches:
  refs/heads/master c7b83dbe6 -> e2bd6d539


Fix to ElementTransformer for GRAPH.

Project: http://git-wip-us.apache.org/repos/asf/jena/repo
Commit: http://git-wip-us.apache.org/repos/asf/jena/commit/bc5ace0e
Tree: http://git-wip-us.apache.org/repos/asf/jena/tree/bc5ace0e
Diff: http://git-wip-us.apache.org/repos/asf/jena/diff/bc5ace0e

Branch: refs/heads/master
Commit: bc5ace0e9460ae979079532f610a88b6363e96e5
Parents: c7b83db
Author: Andy Seaborne <andy@apache.org>
Authored: Thu Mar 17 14:56:08 2016 +0000
Committer: Andy Seaborne <andy@apache.org>
Committed: Thu Mar 17 14:56:08 2016 +0000

----------------------------------------------------------------------
 .../syntaxtransform/ElementTransformer.java      |  6 ++----
 .../syntaxtransform/TestSyntaxTransform.java     | 19 +++++++++++++++----
 2 files changed, 17 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/jena/blob/bc5ace0e/jena-arq/src/main/java/org/apache/jena/sparql/syntax/syntaxtransform/ElementTransformer.java
----------------------------------------------------------------------
diff --git a/jena-arq/src/main/java/org/apache/jena/sparql/syntax/syntaxtransform/ElementTransformer.java
b/jena-arq/src/main/java/org/apache/jena/sparql/syntax/syntaxtransform/ElementTransformer.java
index 04d2299..4a741e4 100644
--- a/jena-arq/src/main/java/org/apache/jena/sparql/syntax/syntaxtransform/ElementTransformer.java
+++ b/jena-arq/src/main/java/org/apache/jena/sparql/syntax/syntaxtransform/ElementTransformer.java
@@ -204,7 +204,7 @@ public class ElementTransformer {
         public void visit(ElementDataset el) {
             Element sub = pop() ;
             Element el2 = transform.transform(el, sub) ;
-            push(el) ;
+            push(el2) ;
         }
 
         @Override
@@ -212,7 +212,7 @@ public class ElementTransformer {
             Node n = el.getGraphNameNode() ;
             Node n1 = transformNode(n) ;
             Element elt1 = pop() ;
-            Element el2 = transform.transform(el, n, elt1) ; 
+            Element el2 = transform.transform(el, n1, elt1) ; 
             push(el2) ;
         }
 
@@ -252,10 +252,8 @@ public class ElementTransformer {
 
         @Override
         public void visit(ElementService el) {
-            boolean b = el.getSilent() ;
             Node n = el.getServiceNode() ;
             Node n1 = transformNode(n) ;
-            Element elt = el.getElement() ;
             Element elt1 = pop() ;
             Element el2 = transform.transform(el, n1, elt1) ;
             push(el2) ;

http://git-wip-us.apache.org/repos/asf/jena/blob/bc5ace0e/jena-arq/src/test/java/org/apache/jena/sparql/syntax/syntaxtransform/TestSyntaxTransform.java
----------------------------------------------------------------------
diff --git a/jena-arq/src/test/java/org/apache/jena/sparql/syntax/syntaxtransform/TestSyntaxTransform.java
b/jena-arq/src/test/java/org/apache/jena/sparql/syntax/syntaxtransform/TestSyntaxTransform.java
index c09f0fe..23d9f9b 100644
--- a/jena-arq/src/test/java/org/apache/jena/sparql/syntax/syntaxtransform/TestSyntaxTransform.java
+++ b/jena-arq/src/test/java/org/apache/jena/sparql/syntax/syntaxtransform/TestSyntaxTransform.java
@@ -76,11 +76,22 @@ public class TestSyntaxTransform extends BaseTest
                   "o", "1");
     }
 
-    @Test public void subst_query_11() { testQuery
-        ("SELECT * { ?s ?p ?o { SELECT ?x { ?x ?p ?o } } }",
-         "SELECT * { ?s ?p 1  { SELECT ?x { ?x ?p 1 } } }",
-         "o", "1") ; }
+    @Test public void subst_query_11() { 
+        testQuery("SELECT * { ?s ?p ?o { SELECT ?x { ?x ?p ?o } } }",
+                  "SELECT * { ?s ?p 1  { SELECT ?x { ?x ?p 1 } } }",
+                  "o", "1") ; }
+
+    @Test public void subst_query_20() { 
+        testQuery("SELECT * { ?s ?p ?g GRAPH ?g { ?s ?p ?g } }",
+                  "SELECT * { ?s ?p <urn:graph> GRAPH <urn:graph> { ?s ?p <urn:graph>
} }",
+                  "g", "<urn:graph>") ; }
 
+    @Test public void subst_query_21() { 
+        testQuery("SELECT * { ?s ?p ?srv SERVICE ?srv { ?s ?p ?srv}}",
+                  "SELECT * { ?s ?p <urn:service> SERVICE <urn:service> { ?s
?p <urn:service>}}",
+                  "srv", "<urn:service>") ; }
+
+    
     @Test public void subst_update_01() { 
         testUpdate("DELETE { ?s <urn:p> ?x } WHERE {}", 
                    "DELETE { ?s <urn:p> <urn:x> } WHERE {}",


Mime
View raw message