You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jena.apache.org by an...@apache.org on 2015/05/13 10:43:46 UTC
[1/3] jena git commit: Add tests for SPARQL 1.1 sub-select
Repository: jena
Updated Branches:
refs/heads/master c51aa0800 -> beeb6b524
Add tests for SPARQL 1.1 sub-select
Project: http://git-wip-us.apache.org/repos/asf/jena/repo
Commit: http://git-wip-us.apache.org/repos/asf/jena/commit/2191b680
Tree: http://git-wip-us.apache.org/repos/asf/jena/tree/2191b680
Diff: http://git-wip-us.apache.org/repos/asf/jena/diff/2191b680
Branch: refs/heads/master
Commit: 2191b6801e073091c839da385b23947fe151534d
Parents: acd46a2
Author: Andy Seaborne <an...@apache.org>
Authored: Wed May 13 09:24:20 2015 +0100
Committer: Andy Seaborne <an...@apache.org>
Committed: Wed May 13 09:24:20 2015 +0100
----------------------------------------------------------------------
jena-arq/testing/ARQ/Serialization/manifest.ttl | 110 +++++++++----------
jena-arq/testing/ARQ/Serialization/serial.sh | 0
.../ARQ/Serialization/syntax-subselect-01.arq | 3 -
.../ARQ/Serialization/syntax-subselect-01.rq | 3 +
.../ARQ/Serialization/syntax-subselect-02.arq | 3 -
.../ARQ/Serialization/syntax-subselect-02.rq | 3 +
.../ARQ/Serialization/syntax-subselect-03.arq | 7 --
.../ARQ/Serialization/syntax-subselect-03.rq | 7 ++
.../ARQ/Serialization/syntax-subselect-04.arq | 9 --
.../ARQ/Serialization/syntax-subselect-04.rq | 7 ++
.../ARQ/Serialization/syntax-subselect-10.arq | 3 +
.../ARQ/Serialization/syntax-subselect-11.arq | 3 +
.../ARQ/Serialization/syntax-subselect-12.arq | 7 ++
.../ARQ/Serialization/syntax-subselect-13.arq | 9 ++
14 files changed, 95 insertions(+), 79 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/jena/blob/2191b680/jena-arq/testing/ARQ/Serialization/manifest.ttl
----------------------------------------------------------------------
diff --git a/jena-arq/testing/ARQ/Serialization/manifest.ttl b/jena-arq/testing/ARQ/Serialization/manifest.ttl
index 72bcd79..828a301 100644
--- a/jena-arq/testing/ARQ/Serialization/manifest.ttl
+++ b/jena-arq/testing/ARQ/Serialization/manifest.ttl
@@ -1,18 +1,3 @@
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements. See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix mf: <http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#> .
@@ -20,7 +5,7 @@
@prefix qt: <http://www.w3.org/2001/sw/DataAccess/tests/test-query#> .
<> rdf:type mf:Manifest ;
- rdfs:comment "Serialization tests" ;
+ rdfs:comment "Serialization tests Serialization" ;
mf:entries
(
[ mf:name "syn-01.rq" ;
@@ -199,14 +184,6 @@
rdf:type mfx:TestSerialization ;
mf:action <syntax-form-describe02.rq> ;
]
- [ mf:name "syntax-form-select-01.rq" ;
- rdf:type mfx:TestSerialization ;
- mf:action <syntax-form-select-01.rq> ;
- ]
- [ mf:name "syntax-form-select-02.rq" ;
- rdf:type mfx:TestSerialization ;
- mf:action <syntax-form-select-02.rq> ;
- ]
[ mf:name "syntax-forms-01.rq" ;
rdf:type mfx:TestSerialization ;
mf:action <syntax-forms-01.rq> ;
@@ -215,6 +192,14 @@
rdf:type mfx:TestSerialization ;
mf:action <syntax-forms-02.rq> ;
]
+ [ mf:name "syntax-form-select-01.rq" ;
+ rdf:type mfx:TestSerialization ;
+ mf:action <syntax-form-select-01.rq> ;
+ ]
+ [ mf:name "syntax-form-select-02.rq" ;
+ rdf:type mfx:TestSerialization ;
+ mf:action <syntax-form-select-02.rq> ;
+ ]
[ mf:name "syntax-function-01.rq" ;
rdf:type mfx:TestSerialization ;
mf:action <syntax-function-01.rq> ;
@@ -471,7 +456,6 @@
rdf:type mfx:TestSerialization ;
mf:action <syntax-order-09.rq> ;
]
-
[ mf:name "syntax-pat-01.rq" ;
rdf:type mfx:TestSerialization ;
mf:action <syntax-pat-01.rq> ;
@@ -572,33 +556,37 @@
rdf:type mfx:TestSerialization ;
mf:action <syntax-struct-14.rq> ;
]
- [ mf:name "syntax-union-01.rq" ;
+ [ mf:name "syntax-subselect-01.rq" ;
rdf:type mfx:TestSerialization ;
- mf:action <syntax-union-01.rq> ;
+ mf:action <syntax-subselect-01.rq> ;
]
- [ mf:name "syntax-union-02.rq" ;
+ [ mf:name "syntax-subselect-02.rq" ;
rdf:type mfx:TestSerialization ;
- mf:action <syntax-union-02.rq> ;
+ mf:action <syntax-subselect-02.rq> ;
]
- [ mf:name "syntax-select-expr-01.arq" ;
+ [ mf:name "syntax-subselect-03.rq" ;
rdf:type mfx:TestSerialization ;
- mf:action <syntax-select-expr-01.arq> ;
+ mf:action <syntax-subselect-03.rq> ;
]
- [ mf:name "syntax-select-expr-02.arq" ;
+ [ mf:name "syntax-subselect-04.rq" ;
rdf:type mfx:TestSerialization ;
- mf:action <syntax-select-expr-02.arq> ;
+ mf:action <syntax-subselect-04.rq> ;
]
- [ mf:name "syntax-select-expr-03.arq" ;
+ [ mf:name "syntax-union-01.rq" ;
rdf:type mfx:TestSerialization ;
- mf:action <syntax-select-expr-03.arq> ;
+ mf:action <syntax-union-01.rq> ;
]
- [ mf:name "syntax-group-01.arq" ;
+ [ mf:name "syntax-union-02.rq" ;
rdf:type mfx:TestSerialization ;
- mf:action <syntax-group-01.arq> ;
+ mf:action <syntax-union-02.rq> ;
]
- [ mf:name "syntax-group-02.arq" ;
+ [ mf:name "syntax-assign-01.arq" ;
rdf:type mfx:TestSerialization ;
- mf:action <syntax-group-01.arq> ;
+ mf:action <syntax-assign-01.arq> ;
+ ]
+ [ mf:name "syntax-assign-02.arq" ;
+ rdf:type mfx:TestSerialization ;
+ mf:action <syntax-assign-02.arq> ;
]
[ mf:name "syntax-count-01.arq" ;
rdf:type mfx:TestSerialization ;
@@ -616,36 +604,44 @@
rdf:type mfx:TestSerialization ;
mf:action <syntax-count-04.arq> ;
]
-
- [ mf:name "syntax-service-01.arq" ;
+ [ mf:name "syntax-group-01.arq" ;
rdf:type mfx:TestSerialization ;
- mf:action <syntax-service-01.arq> ;
+ mf:action <syntax-group-01.arq> ;
]
-
- [ mf:name "syntax-subselect-01.arq" ;
+ [ mf:name "syntax-group-02.arq" ;
+ rdf:type mfx:TestSerialization ;
+ mf:action <syntax-group-02.arq> ;
+ ]
+ [ mf:name "syntax-select-expr-01.arq" ;
rdf:type mfx:TestSerialization ;
- mf:action <syntax-subselect-01.arq> ;
+ mf:action <syntax-select-expr-01.arq> ;
]
- [ mf:name "syntax-subselect-02.arq" ;
+ [ mf:name "syntax-select-expr-02.arq" ;
rdf:type mfx:TestSerialization ;
- mf:action <syntax-subselect-02.arq> ;
+ mf:action <syntax-select-expr-02.arq> ;
]
- [ mf:name "syntax-subselect-03.arq" ;
+ [ mf:name "syntax-select-expr-03.arq" ;
rdf:type mfx:TestSerialization ;
- mf:action <syntax-subselect-03.arq> ;
+ mf:action <syntax-select-expr-03.arq> ;
]
- [ mf:name "syntax-subselect-04.arq" ;
+ [ mf:name "syntax-service-01.arq" ;
rdf:type mfx:TestSerialization ;
- mf:action <syntax-subselect-04.arq> ;
+ mf:action <syntax-service-01.arq> ;
]
-
- [ mf:name "syntax-assign-01.arq" ;
+ [ mf:name "syntax-subselect-10.arq" ;
rdf:type mfx:TestSerialization ;
- mf:action <syntax-assign-01.arq> ;
+ mf:action <syntax-subselect-10.arq> ;
]
- [ mf:name "syntax-assign-02.arq" ;
+ [ mf:name "syntax-subselect-11.arq" ;
rdf:type mfx:TestSerialization ;
- mf:action <syntax-assign-02.arq> ;
+ mf:action <syntax-subselect-11.arq> ;
+ ]
+ [ mf:name "syntax-subselect-12.arq" ;
+ rdf:type mfx:TestSerialization ;
+ mf:action <syntax-subselect-12.arq> ;
+ ]
+ [ mf:name "syntax-subselect-13.arq" ;
+ rdf:type mfx:TestSerialization ;
+ mf:action <syntax-subselect-13.arq> ;
]
-
) .
http://git-wip-us.apache.org/repos/asf/jena/blob/2191b680/jena-arq/testing/ARQ/Serialization/serial.sh
----------------------------------------------------------------------
diff --git a/jena-arq/testing/ARQ/Serialization/serial.sh b/jena-arq/testing/ARQ/Serialization/serial.sh
old mode 100644
new mode 100755
http://git-wip-us.apache.org/repos/asf/jena/blob/2191b680/jena-arq/testing/ARQ/Serialization/syntax-subselect-01.arq
----------------------------------------------------------------------
diff --git a/jena-arq/testing/ARQ/Serialization/syntax-subselect-01.arq b/jena-arq/testing/ARQ/Serialization/syntax-subselect-01.arq
deleted file mode 100644
index b88276e..0000000
--- a/jena-arq/testing/ARQ/Serialization/syntax-subselect-01.arq
+++ /dev/null
@@ -1,3 +0,0 @@
-PREFIX : <http://example/>
-
-SELECT * { SELECT * { ?s ?p ?o } }
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/jena/blob/2191b680/jena-arq/testing/ARQ/Serialization/syntax-subselect-01.rq
----------------------------------------------------------------------
diff --git a/jena-arq/testing/ARQ/Serialization/syntax-subselect-01.rq b/jena-arq/testing/ARQ/Serialization/syntax-subselect-01.rq
new file mode 100644
index 0000000..f39d4a7
--- /dev/null
+++ b/jena-arq/testing/ARQ/Serialization/syntax-subselect-01.rq
@@ -0,0 +1,3 @@
+PREFIX : <http://example/>
+
+SELECT * { SELECT ?s { ?s ?p ?o } }
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/jena/blob/2191b680/jena-arq/testing/ARQ/Serialization/syntax-subselect-02.arq
----------------------------------------------------------------------
diff --git a/jena-arq/testing/ARQ/Serialization/syntax-subselect-02.arq b/jena-arq/testing/ARQ/Serialization/syntax-subselect-02.arq
deleted file mode 100644
index 37b85a4..0000000
--- a/jena-arq/testing/ARQ/Serialization/syntax-subselect-02.arq
+++ /dev/null
@@ -1,3 +0,0 @@
-PREFIX : <http://example/>
-
-SELECT * { { SELECT * { ?s ?p ?o } } }
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/jena/blob/2191b680/jena-arq/testing/ARQ/Serialization/syntax-subselect-02.rq
----------------------------------------------------------------------
diff --git a/jena-arq/testing/ARQ/Serialization/syntax-subselect-02.rq b/jena-arq/testing/ARQ/Serialization/syntax-subselect-02.rq
new file mode 100644
index 0000000..a116b54
--- /dev/null
+++ b/jena-arq/testing/ARQ/Serialization/syntax-subselect-02.rq
@@ -0,0 +1,3 @@
+PREFIX : <http://example/>
+
+SELECT * { SELECT ?s { ?s ?p [] } }
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/jena/blob/2191b680/jena-arq/testing/ARQ/Serialization/syntax-subselect-03.arq
----------------------------------------------------------------------
diff --git a/jena-arq/testing/ARQ/Serialization/syntax-subselect-03.arq b/jena-arq/testing/ARQ/Serialization/syntax-subselect-03.arq
deleted file mode 100644
index 4f16ccb..0000000
--- a/jena-arq/testing/ARQ/Serialization/syntax-subselect-03.arq
+++ /dev/null
@@ -1,7 +0,0 @@
-PREFIX : <http://example/>
-
-SELECT * {
- :x :p ?v
- OPTIONAL
- { SELECT * { ?s ?p ?o } }
-}
http://git-wip-us.apache.org/repos/asf/jena/blob/2191b680/jena-arq/testing/ARQ/Serialization/syntax-subselect-03.rq
----------------------------------------------------------------------
diff --git a/jena-arq/testing/ARQ/Serialization/syntax-subselect-03.rq b/jena-arq/testing/ARQ/Serialization/syntax-subselect-03.rq
new file mode 100644
index 0000000..afc3d3c
--- /dev/null
+++ b/jena-arq/testing/ARQ/Serialization/syntax-subselect-03.rq
@@ -0,0 +1,7 @@
+PREFIX : <http://example/>
+
+SELECT * {
+ { SELECT ?s { ?s ?p [] } }
+ ?s ?q []
+ }
+
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/jena/blob/2191b680/jena-arq/testing/ARQ/Serialization/syntax-subselect-04.arq
----------------------------------------------------------------------
diff --git a/jena-arq/testing/ARQ/Serialization/syntax-subselect-04.arq b/jena-arq/testing/ARQ/Serialization/syntax-subselect-04.arq
deleted file mode 100644
index f6f2c09..0000000
--- a/jena-arq/testing/ARQ/Serialization/syntax-subselect-04.arq
+++ /dev/null
@@ -1,9 +0,0 @@
-PREFIX : <http://example/>
-
-SELECT * {
- :x :p ?v
- OPTIONAL
- {
- { SELECT * { ?s ?p ?o } }
- }
-}
http://git-wip-us.apache.org/repos/asf/jena/blob/2191b680/jena-arq/testing/ARQ/Serialization/syntax-subselect-04.rq
----------------------------------------------------------------------
diff --git a/jena-arq/testing/ARQ/Serialization/syntax-subselect-04.rq b/jena-arq/testing/ARQ/Serialization/syntax-subselect-04.rq
new file mode 100644
index 0000000..5dc2b97
--- /dev/null
+++ b/jena-arq/testing/ARQ/Serialization/syntax-subselect-04.rq
@@ -0,0 +1,7 @@
+PREFIX : <http://example/>
+
+SELECT * {
+ { SELECT ?s { ?s ?p _:a } }
+ ?s ?q _:b
+ }
+
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/jena/blob/2191b680/jena-arq/testing/ARQ/Serialization/syntax-subselect-10.arq
----------------------------------------------------------------------
diff --git a/jena-arq/testing/ARQ/Serialization/syntax-subselect-10.arq b/jena-arq/testing/ARQ/Serialization/syntax-subselect-10.arq
new file mode 100644
index 0000000..b88276e
--- /dev/null
+++ b/jena-arq/testing/ARQ/Serialization/syntax-subselect-10.arq
@@ -0,0 +1,3 @@
+PREFIX : <http://example/>
+
+SELECT * { SELECT * { ?s ?p ?o } }
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/jena/blob/2191b680/jena-arq/testing/ARQ/Serialization/syntax-subselect-11.arq
----------------------------------------------------------------------
diff --git a/jena-arq/testing/ARQ/Serialization/syntax-subselect-11.arq b/jena-arq/testing/ARQ/Serialization/syntax-subselect-11.arq
new file mode 100644
index 0000000..37b85a4
--- /dev/null
+++ b/jena-arq/testing/ARQ/Serialization/syntax-subselect-11.arq
@@ -0,0 +1,3 @@
+PREFIX : <http://example/>
+
+SELECT * { { SELECT * { ?s ?p ?o } } }
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/jena/blob/2191b680/jena-arq/testing/ARQ/Serialization/syntax-subselect-12.arq
----------------------------------------------------------------------
diff --git a/jena-arq/testing/ARQ/Serialization/syntax-subselect-12.arq b/jena-arq/testing/ARQ/Serialization/syntax-subselect-12.arq
new file mode 100644
index 0000000..4f16ccb
--- /dev/null
+++ b/jena-arq/testing/ARQ/Serialization/syntax-subselect-12.arq
@@ -0,0 +1,7 @@
+PREFIX : <http://example/>
+
+SELECT * {
+ :x :p ?v
+ OPTIONAL
+ { SELECT * { ?s ?p ?o } }
+}
http://git-wip-us.apache.org/repos/asf/jena/blob/2191b680/jena-arq/testing/ARQ/Serialization/syntax-subselect-13.arq
----------------------------------------------------------------------
diff --git a/jena-arq/testing/ARQ/Serialization/syntax-subselect-13.arq b/jena-arq/testing/ARQ/Serialization/syntax-subselect-13.arq
new file mode 100644
index 0000000..f6f2c09
--- /dev/null
+++ b/jena-arq/testing/ARQ/Serialization/syntax-subselect-13.arq
@@ -0,0 +1,9 @@
+PREFIX : <http://example/>
+
+SELECT * {
+ :x :p ?v
+ OPTIONAL
+ {
+ { SELECT * { ?s ?p ?o } }
+ }
+}
[2/3] jena git commit: JENA-939 : Fix by directly making a
QuerySerializer.
Posted by an...@apache.org.
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/master
Commit: 53af5b20418d8b6c95f8d33648bc147bd27b481a
Parents: 2191b68
Author: Andy Seaborne <an...@apache.org>
Authored: Wed May 13 09:40:48 2015 +0100
Committer: Andy Seaborne <an...@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
+
[3/3] jena git commit: Merge branch 'master' of
https://git-wip-us.apache.org/repos/asf/jena
Posted by an...@apache.org.
Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/jena
Project: http://git-wip-us.apache.org/repos/asf/jena/repo
Commit: http://git-wip-us.apache.org/repos/asf/jena/commit/beeb6b52
Tree: http://git-wip-us.apache.org/repos/asf/jena/tree/beeb6b52
Diff: http://git-wip-us.apache.org/repos/asf/jena/diff/beeb6b52
Branch: refs/heads/master
Commit: beeb6b524b10a9b7b44e80822ea60f2c11f55d87
Parents: 53af5b2 c51aa08
Author: Andy Seaborne <an...@apache.org>
Authored: Wed May 13 09:43:19 2015 +0100
Committer: Andy Seaborne <an...@apache.org>
Committed: Wed May 13 09:43:19 2015 +0100
----------------------------------------------------------------------
.../apache/jena/assembler/AssemblerHelp.java | 33 +++++++++++++++-----
1 file changed, 26 insertions(+), 7 deletions(-)
----------------------------------------------------------------------