jena-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cla...@apache.org
Subject [25/50] [abbrv] jena git commit: JENA-939 : Fix by directly making a QuerySerializer.
Date Sat, 16 May 2015 08:59:07 GMT
JENA-939 : Fix by directly making a QuerySerializer.

This code isinside a specific QuerySerializersetup so it can make one
directly.  There is no indirection necessary.  The
QuerySerializerFactory code was already choosing the syntax explicitly.


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

Branch: refs/heads/add-contract-tests
Commit: 53af5b20418d8b6c95f8d33648bc147bd27b481a
Parents: 2191b68
Author: Andy Seaborne <andy@apache.org>
Authored: Wed May 13 09:40:48 2015 +0100
Committer: Andy Seaborne <andy@apache.org>
Committed: Wed May 13 09:42:55 2015 +0100

----------------------------------------------------------------------
 .../jena/sparql/serializer/FormatterElement.java  | 18 +++++++++++++-----
 jena-arq/testing/ARQ/README                       |  3 +++
 2 files changed, 16 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/jena/blob/53af5b20/jena-arq/src/main/java/org/apache/jena/sparql/serializer/FormatterElement.java
----------------------------------------------------------------------
diff --git a/jena-arq/src/main/java/org/apache/jena/sparql/serializer/FormatterElement.java
b/jena-arq/src/main/java/org/apache/jena/sparql/serializer/FormatterElement.java
index 9c8975d..33033f7 100644
--- a/jena-arq/src/main/java/org/apache/jena/sparql/serializer/FormatterElement.java
+++ b/jena-arq/src/main/java/org/apache/jena/sparql/serializer/FormatterElement.java
@@ -27,8 +27,6 @@ import org.apache.jena.atlas.io.IndentedWriter ;
 import org.apache.jena.graph.Node ;
 import org.apache.jena.graph.Triple ;
 import org.apache.jena.query.Query ;
-import org.apache.jena.query.QueryVisitor ;
-import org.apache.jena.query.Syntax ;
 import org.apache.jena.sparql.core.BasicPattern ;
 import org.apache.jena.sparql.core.PathBlock ;
 import org.apache.jena.sparql.core.TriplePath ;
@@ -452,9 +450,19 @@ public class FormatterElement extends FormatterBase
         out.incIndent(INDENT) ;
         Query q = el.getQuery() ;
         
-        // Serialize with respect to the outer context prologue.
-        QuerySerializerFactory factory = SerializerRegistry.get().getQuerySerializerFactory(Syntax.syntaxARQ);
-        QueryVisitor serializer = factory.create(Syntax.syntaxARQ, context.getPrologue()
, out);
+        // JENA-939 : factory.create calls "new NodeToLabelMapBNode("b", false)", i.e. a
new mapping
+        // which looses the history and so reuses labels. 
+        
+//        // Serialize with respect to the outer context prologue.
+//        QuerySerializerFactory factory = SerializerRegistry.get().getQuerySerializerFactory(Syntax.syntaxARQ);
+//        QueryVisitor serializer = factory.create(Syntax.syntaxARQ, context.getPrologue()
, out);
+//        q.visit(serializer);
+        
+        // For the query pattern, use the same context
+        QuerySerializer serializer = new QuerySerializer(out, 
+                                                         new FormatterElement(out, context),
+                                                         new FmtExprSPARQL(out, context),
+                                                         null);
         q.visit(serializer);
         
         out.decIndent(INDENT) ;

http://git-wip-us.apache.org/repos/asf/jena/blob/53af5b20/jena-arq/testing/ARQ/README
----------------------------------------------------------------------
diff --git a/jena-arq/testing/ARQ/README b/jena-arq/testing/ARQ/README
new file mode 100644
index 0000000..89a274b
--- /dev/null
+++ b/jena-arq/testing/ARQ/README
@@ -0,0 +1,3 @@
+There are manaifest generating scripts for Syntax/ and Serlaization/
+Look for *.sh
+


Mime
View raw message