You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jena.apache.org by cl...@apache.org on 2018/10/14 10:32:08 UTC
[1/8] jena git commit: closes JENA=1602
Repository: jena
Updated Branches:
refs/heads/master a56eb06b8 -> 4702f9742
closes JENA=1602
Project: http://git-wip-us.apache.org/repos/asf/jena/repo
Commit: http://git-wip-us.apache.org/repos/asf/jena/commit/ee62b654
Tree: http://git-wip-us.apache.org/repos/asf/jena/tree/ee62b654
Diff: http://git-wip-us.apache.org/repos/asf/jena/diff/ee62b654
Branch: refs/heads/master
Commit: ee62b6540f795ddeb7ef7ee2eed2f2ac0d223d5b
Parents: cf08538
Author: Claude Warren <cl...@xenei.com>
Authored: Sun Sep 30 11:01:22 2018 +0100
Committer: Claude Warren <cl...@xenei.com>
Committed: Sun Sep 30 11:01:22 2018 +0100
----------------------------------------------------------------------
jena-extras/jena-querybuilder/.gitignore | 1 +
.../jena/arq/querybuilder/UpdateBuilder.java | 172 ++++++-
.../updatebuilder/CollectionQuadHolder.java | 130 ++++++
.../updatebuilder/ModelQuadHolder.java | 74 +++
.../updatebuilder/WhereProcessor.java | 449 -------------------
.../updatebuilder/WhereQuadHolder.java | 449 +++++++++++++++++++
.../updatebuilder/CollectionQuadHolderTest.java | 330 ++++++++++++++
.../updatebuilder/ModelQuadHolderTest.java | 82 ++++
.../updatebuilder/QBQuadHolderTest.java | 202 +++++++++
.../updatebuilder/SingleQuadHolderTest.java | 100 +++++
.../updatebuilder/WhereQuadHolderTest.java | 202 +++++++++
jena-maven-tools/pom.xml | 5 +-
12 files changed, 1740 insertions(+), 456 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/jena/blob/ee62b654/jena-extras/jena-querybuilder/.gitignore
----------------------------------------------------------------------
diff --git a/jena-extras/jena-querybuilder/.gitignore b/jena-extras/jena-querybuilder/.gitignore
new file mode 100644
index 0000000..d86b3db
--- /dev/null
+++ b/jena-extras/jena-querybuilder/.gitignore
@@ -0,0 +1 @@
+/.project_old
http://git-wip-us.apache.org/repos/asf/jena/blob/ee62b654/jena-extras/jena-querybuilder/src/main/java/org/apache/jena/arq/querybuilder/UpdateBuilder.java
----------------------------------------------------------------------
diff --git a/jena-extras/jena-querybuilder/src/main/java/org/apache/jena/arq/querybuilder/UpdateBuilder.java b/jena-extras/jena-querybuilder/src/main/java/org/apache/jena/arq/querybuilder/UpdateBuilder.java
index 2fb8fc8..44b9a93 100644
--- a/jena-extras/jena-querybuilder/src/main/java/org/apache/jena/arq/querybuilder/UpdateBuilder.java
+++ b/jena-extras/jena-querybuilder/src/main/java/org/apache/jena/arq/querybuilder/UpdateBuilder.java
@@ -29,16 +29,19 @@ import java.util.function.Function;
import org.apache.jena.arq.querybuilder.clauses.PrologClause;
import org.apache.jena.arq.querybuilder.clauses.WhereClause;
import org.apache.jena.arq.querybuilder.handlers.WhereHandler;
+import org.apache.jena.arq.querybuilder.updatebuilder.CollectionQuadHolder;
+import org.apache.jena.arq.querybuilder.updatebuilder.ModelQuadHolder;
import org.apache.jena.arq.querybuilder.updatebuilder.PrefixHandler;
import org.apache.jena.arq.querybuilder.updatebuilder.QBQuadHolder;
import org.apache.jena.arq.querybuilder.updatebuilder.QuadHolder;
import org.apache.jena.arq.querybuilder.updatebuilder.SingleQuadHolder;
-import org.apache.jena.arq.querybuilder.updatebuilder.WhereProcessor;
+import org.apache.jena.arq.querybuilder.updatebuilder.WhereQuadHolder;
import org.apache.jena.graph.FrontsTriple;
import org.apache.jena.graph.Node;
import org.apache.jena.graph.NodeFactory;
import org.apache.jena.graph.Triple;
import org.apache.jena.query.QueryParseException;
+import org.apache.jena.rdf.model.Model;
import org.apache.jena.rdf.model.Resource;
import org.apache.jena.shared.PrefixMapping;
import org.apache.jena.sparql.core.Quad;
@@ -65,7 +68,7 @@ import org.apache.jena.vocabulary.RDF;
public class UpdateBuilder {
private final PrefixHandler prefixHandler;
- private final WhereProcessor whereProcessor;
+ private final WhereQuadHolder whereProcessor;
private List<QuadHolder> inserts = new ArrayList<QuadHolder>();
private List<QuadHolder> deletes = new ArrayList<QuadHolder>();
private Map<Var, Node> values;
@@ -76,7 +79,7 @@ public class UpdateBuilder {
*/
public UpdateBuilder() {
this.prefixHandler = new PrefixHandler();
- this.whereProcessor = new WhereProcessor(prefixHandler);
+ this.whereProcessor = new WhereQuadHolder(prefixHandler);
this.values = new HashMap<Var, Node>();
this.with = null;
}
@@ -101,7 +104,7 @@ public class UpdateBuilder {
*/
public UpdateBuilder(PrefixMapping pMap) {
this.prefixHandler = new PrefixHandler(pMap);
- this.whereProcessor = new WhereProcessor(prefixHandler);
+ this.whereProcessor = new WhereQuadHolder(prefixHandler);
}
// conver a collection of QuadHolder to an iterator on quads.
@@ -358,8 +361,86 @@ public class UpdateBuilder {
inserts.add(new SingleQuadHolder(q));
return this;
}
+
+ /**
+ * Add all the statements in the model to the insert statement.
+ *
+ * @param model The model to insert.
+ * @return this builder for chaining.
+ */
+ public UpdateBuilder addInsert(Model model) {
+ inserts.add(new ModelQuadHolder( model ));
+ return this;
+ }
+
+ /**
+ * Add all the statements in the model to the insert statement.
+ *
+ * @param collection The triples to insert.
+ * @return this builder for chaining.
+ */
+ public UpdateBuilder addInsert(Collection<Triple> collection) {
+ inserts.add(new CollectionQuadHolder( collection ));
+ return this;
+ }
+
+ /**
+ * Add all the statements in the model to the insert statement.
+ *
+ * @param iter The iterator of triples to insert.
+ * @return this builder for chaining.
+ */
+ public UpdateBuilder addInsert(Iterator<Triple> iter) {
+ inserts.add(new CollectionQuadHolder( iter ));
+ return this;
+ }
+
+ /**
+ * Add all the statements in the model a specified graph to the insert statement.
+ *
+ * The graph object is converted by a call to makeNode().
+ *
+ * @see #makeNode(Object)
+ * @param g
+ * the graph for the triple.
+ * @param model
+ * the model to add.
+ * @return this builder for chaining.
+ */
+ public UpdateBuilder addInsert(Object g, Model model) {
+ inserts.add( new ModelQuadHolder(
+ AbstractQueryBuilder.makeNode(g, prefixHandler.getPrefixes()),
+ model));
+ return this;
+ }
/**
+ * Add all the statements in the model to the insert statement.
+ *
+ * @param collection The triples to insert.
+ * @return this builder for chaining.
+ */
+ public UpdateBuilder addInsert(Object g, Collection<Triple> collection) {
+ inserts.add(new CollectionQuadHolder(
+ AbstractQueryBuilder.makeNode(g, prefixHandler.getPrefixes()),
+ collection ));
+ return this;
+ }
+
+ /**
+ * Add all the statements in the model to the insert statement.
+ *
+ * @param iter The iterator of triples to insert.
+ * @return this builder for chaining.
+ */
+ public UpdateBuilder addInsert(Object g, Iterator<Triple> iter) {
+ inserts.add(new CollectionQuadHolder(
+ AbstractQueryBuilder.makeNode(g, prefixHandler.getPrefixes()),
+ iter ));
+ return this;
+ }
+
+ /**
* Add the statements from the where clause in the specified query builder
* to the insert statement.
*
@@ -480,6 +561,89 @@ public class UpdateBuilder {
}
/**
+ * Add all the statements in the model to the delete statement.
+ *
+ * @param model The model to insert.
+ * @return this builder for chaining.
+ */
+ public UpdateBuilder addDelete(Model model) {
+ deletes.add(new ModelQuadHolder( model ));
+ return this;
+ }
+
+ /**
+ * Add all the statements in the model to the delete statement.
+ *
+ * @param collection The collection of triples to insert.
+ * @return this builder for chaining.
+ */
+ public UpdateBuilder addDelete(Collection<Triple> collection) {
+ deletes.add(new CollectionQuadHolder( collection ));
+ return this;
+ }
+
+ /**
+ * Add all the statements in the model to the delete statement.
+ *
+ * @param iter The iterator of triples to insert.
+ * @return this builder for chaining.
+ */
+ public UpdateBuilder addDelete(Iterator<Triple> iter) {
+ deletes.add(new CollectionQuadHolder( iter ));
+ return this;
+ }
+
+ /**
+ * Add all the statements in the model a specified graph to the delete statement.
+ *
+ * The graph object is converted by a call to makeNode().
+ *
+ * @see #makeNode(Object)
+ * @param g
+ * the graph for the triples.
+ * @param model
+ * the model to add.
+ * @return this builder for chaining.
+ */
+ public UpdateBuilder addDelete(Object g, Model model) {
+ deletes.add( new ModelQuadHolder(
+ AbstractQueryBuilder.makeNode(g, prefixHandler.getPrefixes()),
+ model));
+ return this;
+ }
+
+
+ /**
+ * Add all the statements in the model to the delete statement.
+ *
+ * @param g
+ * the graph for the triples.
+ * @param collection The collection of triples to insert.
+ * @return this builder for chaining.
+ */
+ public UpdateBuilder addDelete(Object g, Collection<Triple> collection) {
+ deletes.add(new CollectionQuadHolder(
+ AbstractQueryBuilder.makeNode(g, prefixHandler.getPrefixes()),
+ collection ));
+ return this;
+ }
+
+ /**
+ * Add all the statements in the model to the delete statement.
+ *
+ * @param g
+ * the graph for the triples.
+ * @param iter The iterator of triples to insert.
+ * @return this builder for chaining.
+ */
+ public UpdateBuilder addDelete(Object g, Iterator<Triple> iter) {
+ deletes.add(new CollectionQuadHolder(
+ AbstractQueryBuilder.makeNode(g, prefixHandler.getPrefixes()),
+ iter ));
+ return this;
+ }
+
+ /**
* Add the statements from the where clause in the specified query builder
* to the delete statement.
*
http://git-wip-us.apache.org/repos/asf/jena/blob/ee62b654/jena-extras/jena-querybuilder/src/main/java/org/apache/jena/arq/querybuilder/updatebuilder/CollectionQuadHolder.java
----------------------------------------------------------------------
diff --git a/jena-extras/jena-querybuilder/src/main/java/org/apache/jena/arq/querybuilder/updatebuilder/CollectionQuadHolder.java b/jena-extras/jena-querybuilder/src/main/java/org/apache/jena/arq/querybuilder/updatebuilder/CollectionQuadHolder.java
new file mode 100644
index 0000000..e9116a5
--- /dev/null
+++ b/jena-extras/jena-querybuilder/src/main/java/org/apache/jena/arq/querybuilder/updatebuilder/CollectionQuadHolder.java
@@ -0,0 +1,130 @@
+/*
+ * 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.
+ */
+package org.apache.jena.arq.querybuilder.updatebuilder;
+
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.Set;
+
+import org.apache.jena.graph.Node;
+import org.apache.jena.graph.Triple;
+import org.apache.jena.sparql.core.Quad;
+import org.apache.jena.sparql.core.Var;
+import org.apache.jena.util.iterator.ExtendedIterator;
+import org.apache.jena.util.iterator.WrappedIterator;
+
+/**
+ * An QuadHolder that creates quads from a collection or iterator of triples.
+ *
+ */
+public class CollectionQuadHolder implements QuadHolder {
+
+ private final Set<Triple> collection;
+ private final Node defaultGraphName;
+ private Map<Var, Node> values;
+
+ /**
+ * Constructor.
+ *
+ * @param graph
+ * the default graph name for the triples
+ * @param triples
+ * the collection of triples.
+ */
+ public CollectionQuadHolder(final Node graph, Collection<Triple> triples) {
+ this.collection = new HashSet<Triple>();
+ this.collection.addAll( triples );
+ defaultGraphName = graph;
+ }
+
+ /**
+ * Constructor.
+ *
+ * @param graph
+ * the default graph name for the triples
+ * @param triples
+ * the iterator of triples.
+ */
+ public CollectionQuadHolder(final Node graph, Iterator<Triple> triples) {
+ this.collection = WrappedIterator.create( triples ).toSet();
+ defaultGraphName = graph;
+ }
+
+ /**
+ * Constructor. Uses Quad.defaultGraphNodeGenerated for the graph name.
+ *
+ * @see Quad#defaultGraphNodeGenerated
+ * @param triples
+ * the collection of triples.
+ */
+ public CollectionQuadHolder(final Collection<Triple> triples) {
+ this( Quad.defaultGraphNodeGenerated, triples );
+ }
+
+ /**
+ * Constructor.
+ *
+ * @param triples
+ * the iterator of triples.
+ */
+ public CollectionQuadHolder(Iterator<Triple> triples) {
+ this.collection = WrappedIterator.create( triples ).toSet();
+ defaultGraphName = Quad.defaultGraphNodeGenerated;
+ }
+
+ private Node valueMap( Node n )
+ {
+ if (n.isVariable())
+ {
+ Var v = Var.alloc(n);
+ Node n2 = values.get( n );
+ return n2==null?n:n2;
+ }
+ return n;
+ }
+
+ @Override
+ public ExtendedIterator<Quad> getQuads() {
+ if (values == null)
+ {
+ values = Collections.emptyMap();
+ }
+ return WrappedIterator.create(collection.iterator())
+ .mapWith( triple -> new Triple(
+ valueMap(triple.getSubject()),
+ valueMap(triple.getPredicate()),
+ valueMap(triple.getObject())
+ ))
+ .mapWith( triple -> new Quad( defaultGraphName, triple ) );
+ }
+
+
+
+ /**
+ * This implementation does nothing.
+ */
+ @Override
+ public QuadHolder setValues(final Map<Var, Node> values) {
+ this.values = values;
+ return this;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/jena/blob/ee62b654/jena-extras/jena-querybuilder/src/main/java/org/apache/jena/arq/querybuilder/updatebuilder/ModelQuadHolder.java
----------------------------------------------------------------------
diff --git a/jena-extras/jena-querybuilder/src/main/java/org/apache/jena/arq/querybuilder/updatebuilder/ModelQuadHolder.java b/jena-extras/jena-querybuilder/src/main/java/org/apache/jena/arq/querybuilder/updatebuilder/ModelQuadHolder.java
new file mode 100644
index 0000000..04661f7
--- /dev/null
+++ b/jena-extras/jena-querybuilder/src/main/java/org/apache/jena/arq/querybuilder/updatebuilder/ModelQuadHolder.java
@@ -0,0 +1,74 @@
+/*
+ * 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.
+ */
+package org.apache.jena.arq.querybuilder.updatebuilder;
+
+import java.util.Map;
+
+import org.apache.jena.graph.Node;
+import org.apache.jena.rdf.model.Model;
+import org.apache.jena.sparql.core.Quad;
+import org.apache.jena.sparql.core.Var;
+import org.apache.jena.util.iterator.ExtendedIterator;
+
+/**
+ * An QuadHolder that manages extracts all statements from a model as quads.
+ *
+ */
+public class ModelQuadHolder implements QuadHolder {
+
+ private final Model model;
+ private final Node defaultGraphName;
+
+ /**
+ * Constructor.
+ *
+ * @param graph
+ * the default graph name for the triples
+ * @param model
+ * the model that is providing the triples.
+ */
+ public ModelQuadHolder(final Node graph, final Model model) {
+ this.model = model;
+ defaultGraphName = graph;
+ }
+
+ /**
+ * Constructor. Uses Quad.defaultGraphNodeGenerated for the graph name.
+ *
+ * @see Quad#defaultGraphNodeGenerated
+ * @param model
+ * the model that is providing the triples.
+ */
+ public ModelQuadHolder(final Model model) {
+ this( Quad.defaultGraphNodeGenerated, model );
+ }
+
+ @Override
+ public ExtendedIterator<Quad> getQuads() {
+ return model.listStatements().mapWith( stmt -> new Quad( defaultGraphName, stmt.asTriple() ) );
+ }
+
+ /**
+ * This implementation does nothing.
+ */
+ @Override
+ public QuadHolder setValues(final Map<Var, Node> values) {
+ return this;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/jena/blob/ee62b654/jena-extras/jena-querybuilder/src/main/java/org/apache/jena/arq/querybuilder/updatebuilder/WhereProcessor.java
----------------------------------------------------------------------
diff --git a/jena-extras/jena-querybuilder/src/main/java/org/apache/jena/arq/querybuilder/updatebuilder/WhereProcessor.java b/jena-extras/jena-querybuilder/src/main/java/org/apache/jena/arq/querybuilder/updatebuilder/WhereProcessor.java
deleted file mode 100644
index 8403e20..0000000
--- a/jena-extras/jena-querybuilder/src/main/java/org/apache/jena/arq/querybuilder/updatebuilder/WhereProcessor.java
+++ /dev/null
@@ -1,449 +0,0 @@
-/*
- * 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.
- */
-package org.apache.jena.arq.querybuilder.updatebuilder;
-
-import java.util.Collections;
-import java.util.List;
-import java.util.Map;
-import org.apache.jena.arq.querybuilder.AbstractQueryBuilder;
-import org.apache.jena.arq.querybuilder.clauses.SelectClause;
-import org.apache.jena.arq.querybuilder.handlers.WhereHandler;
-import org.apache.jena.arq.querybuilder.rewriters.BuildElementVisitor;
-import org.apache.jena.arq.querybuilder.rewriters.ElementRewriter;
-import org.apache.jena.graph.Node;
-import org.apache.jena.graph.NodeFactory;
-import org.apache.jena.graph.Triple;
-import org.apache.jena.query.Query;
-import org.apache.jena.sparql.core.Quad;
-import org.apache.jena.sparql.core.TriplePath;
-import org.apache.jena.sparql.core.Var;
-import org.apache.jena.sparql.expr.Expr;
-import org.apache.jena.sparql.lang.sparql_11.ParseException;
-import org.apache.jena.sparql.syntax.*;
-import org.apache.jena.sparql.util.ExprUtils;
-import org.apache.jena.util.iterator.ExtendedIterator;
-import org.apache.jena.util.iterator.NiceIterator;
-import org.apache.jena.vocabulary.RDF;
-
-/**
- * The where processor. Generally handles update where clause.
- *
- * @see <a href=
- * "http://www.w3.org/TR/2013/REC-sparql11-query-20130321/#rGroupGraphPattern">
- * SPARQL 11 Query Language - Group Graph Pattern</a>
- *
- */
-public class WhereProcessor implements QuadHolder {
-
- private Element whereClause;
- private final PrefixHandler prefixHandler;
-
- /**
- * Constructor.
- *
- * @param prefixHandler
- * the prefix handler to use.
- */
- public WhereProcessor(PrefixHandler prefixHandler) {
- this.prefixHandler = prefixHandler;
- }
-
- /**
- * True if there are no elements in the where processor.
- *
- * @return true if there are no elements.
- */
- public boolean isEmpty() {
- return whereClause == null || (whereClause instanceof ElementGroup && ((ElementGroup) whereClause).isEmpty());
- }
-
- @Override
- public ExtendedIterator<Quad> getQuads() {
- return getQuads( Quad.defaultGraphNodeGenerated);
- }
-
- public ExtendedIterator<Quad> getQuads( Node defaultGraphName ) {
- if (isEmpty())
- {
- return NiceIterator.emptyIterator();
- }
- QuadIteratorBuilder builder = new QuadIteratorBuilder(defaultGraphName);
- whereClause.visit(builder);
- return builder.iter;
- }
- /**
- * Add all where attributes from the Where Handler argument.
- *
- * @param whereHandler
- * The Where Handler to copy from.
- */
- public void addAll(WhereHandler whereHandler) {
-
- Element e = whereHandler.getQueryPattern();
- if (e != null) {
- // clone the Element
- ElementRewriter rewriter = new ElementRewriter(Collections.emptyMap());
- e.visit(rewriter);
- Element clone = rewriter.getResult();
-
- if (whereClause == null) {
- whereClause = clone;
- } else {
- ElementGroup eg = null;
- if (whereClause instanceof ElementGroup) {
- eg = (ElementGroup) whereClause;
- } else {
- eg = new ElementGroup();
- eg.addElement(whereClause);
- }
- if (clone instanceof ElementGroup) {
- for (Element ele : ((ElementGroup) clone).getElements()) {
- eg.addElement(ele);
- }
- } else {
- eg.addElement(clone);
- }
- whereClause = eg;
- }
- }
- }
-
- /**
- * Get the element group for the clause. if The element group is not set,
- * create and set it.
- *
- * Public for ExprFactory use.
- *
- * @return The element group.
- */
- public ElementGroup getClause() {
- Element e = whereClause;
- if (e == null) {
- e = new ElementGroup();
- whereClause = e;
- }
- if (e instanceof ElementGroup) {
- return (ElementGroup) e;
- }
-
- ElementGroup eg = new ElementGroup();
- eg.addElement(e);
- whereClause = eg;
- return eg;
- }
-
- /**
- * Test that a triple is valid. Throws an IllegalArgumentException if the
- * triple is not valid.
- *
- * @param t
- * The trip to test.
- */
- private static void testTriple(TriplePath t) {
- // verify Triple is valid
- boolean validSubject = t.getSubject().isURI() || t.getSubject().isBlank() || t.getSubject().isVariable()
- || t.getSubject().equals(Node.ANY);
- boolean validPredicate;
-
- if (t.isTriple()) {
- validPredicate = t.getPredicate().isURI() || t.getPredicate().isVariable()
- || t.getPredicate().equals(Node.ANY);
- } else {
- validPredicate = t.getPath() != null;
- }
-
- boolean validObject = t.getObject().isURI() || t.getObject().isLiteral() || t.getObject().isBlank()
- || t.getObject().isVariable() || t.getObject().equals(Node.ANY);
-
- if (!validSubject || !validPredicate || !validObject) {
- StringBuilder sb = new StringBuilder();
- if (!validSubject) {
- sb.append(String.format("Subject (%s) must be a URI, blank, variable, or a wildcard. %n",
- t.getSubject()));
- }
- if (!validPredicate) {
- sb.append(String.format("Predicate (%s) must be a Path, URI , variable, or a wildcard. %n",
- t.getPredicate()));
- }
- if (!validObject) {
- sb.append(String.format("Object (%s) must be a URI, literal, blank, , variable, or a wildcard. %n",
- t.getObject()));
- }
- if (!validSubject || !validPredicate) {
- sb.append(String.format("Is a prefix missing? Prefix must be defined before use. %n"));
- }
- throw new IllegalArgumentException(sb.toString());
- }
- }
-
- /**
- * Add the triple path to the where clause
- *
- * @param t
- * The triple path to add.
- * @throws IllegalArgumentException
- * If the triple path is not a valid triple path for a where
- * clause.
- */
- public void addWhere(TriplePath t) throws IllegalArgumentException {
- testTriple(t);
- ElementGroup eg = getClause();
- List<Element> lst = eg.getElements();
- if (lst.isEmpty()) {
- ElementPathBlock epb = new ElementPathBlock();
- epb.addTriple(t);
- eg.addElement(epb);
- } else {
- Element e = lst.get(lst.size() - 1);
- if (e instanceof ElementTriplesBlock && t.isTriple()) {
- ElementTriplesBlock etb = (ElementTriplesBlock) e;
- etb.addTriple(t.asTriple());
- } else if (e instanceof ElementPathBlock) {
- ElementPathBlock epb = (ElementPathBlock) e;
- epb.addTriple(t);
- } else {
- ElementPathBlock etb = new ElementPathBlock();
- etb.addTriple(t);
- eg.addElement(etb);
- }
-
- }
- }
-
- /**
- * Add an optional triple to the where clause
- *
- * @param t
- * The triple path to add.
- * @throws IllegalArgumentException
- * If the triple is not a valid triple for a where clause.
- */
- public void addOptional(TriplePath t) throws IllegalArgumentException {
- testTriple(t);
- ElementPathBlock epb = new ElementPathBlock();
- epb.addTriple(t);
- ElementOptional opt = new ElementOptional(epb);
- getClause().addElement(opt);
- }
-
- /**
- * Add the contents of a where handler as an optional statement.
- *
- * @param whereHandler
- * The where handler to use as the optional statement.
- */
- public void addOptional(WhereHandler whereHandler) {
- getClause().addElement(new ElementOptional(whereHandler.getClause()));
- }
-
- /**
- * Add an expression string as a filter.
- *
- * @param expression
- * The expression string to add.
- * @throws ParseException
- * If the expression can not be parsed.
- */
- public void addFilter(String expression) throws ParseException {
- getClause().addElement(new ElementFilter(parseExpr(expression)));
- }
-
- private Expr parseExpr(String expression) {
- Query query = new Query();
- query.setPrefixMapping(prefixHandler.getPrefixes());
- return ExprUtils.parse(query, expression, true);
-
- }
-
- /**
- * add an expression as a filter.
- *
- * @param expr
- * The expression to add.
- */
- public void addFilter(Expr expr) {
- getClause().addElement(new ElementFilter(expr));
- }
-
- /**
- * Add a subquery to the where clause.
- *
- * @param subQuery
- * The sub query to add.
- */
- public void addSubQuery(AbstractQueryBuilder<?> subQuery) {
- getClause().addElement(subQuery.asSubQuery());
- }
-
- /**
- * Add a union to the where clause.
- *
- * @param subQuery
- * The subquery to add as the union.
- */
- public void addUnion(AbstractQueryBuilder<?> subQuery) {
- ElementUnion union = null;
- ElementGroup clause = getClause();
- // if the last element is a union make sure we add to it.
- if (!clause.isEmpty()) {
- Element lastElement = clause.getElements().get(clause.getElements().size() - 1);
- if (lastElement instanceof ElementUnion) {
- union = (ElementUnion) lastElement;
- } else {
- // clauses is not empty and is not a union so it is the left
- // side of the union.
- union = new ElementUnion();
- union.addElement(clause);
- whereClause = union;
- }
- } else {
- // add the union as the first element in the clause.
- union = new ElementUnion();
- clause.addElement(union);
- }
- // if there are projected vars then do a full blown subquery
- // otherwise just add the clause.
- if (subQuery instanceof SelectClause && ((SelectClause<?>) subQuery).getVars().size() > 0) {
- union.addElement(subQuery.asSubQuery());
- } else {
- prefixHandler.addPrefixes(subQuery.getPrologHandler().getPrefixes());
- union.addElement(subQuery.getWhereHandler().getClause());
- }
-
- }
-
- /**
- * Add a graph to the where clause.
- *
- * @param graph
- * The name of the graph.
- * @param subQuery
- * The where handler that defines the graph.
- */
- public void addGraph(Node graph, WhereHandler subQuery) {
- getClause().addElement(new ElementNamedGraph(graph, subQuery.getClause()));
- }
-
- /**
- * Add a binding to the where clause.
- *
- * @param expr
- * The expression to bind.
- * @param var
- * The variable to bind it to.
- */
- public void addBind(Expr expr, Var var) {
- getClause().addElement(new ElementBind(var, expr));
- }
-
- /**
- * Add a binding to the where clause.
- *
- * @param expression
- * The expression to bind.
- * @param var
- * The variable to bind it to.
- * @throws ParseException
- */
- public void addBind(String expression, Var var) throws ParseException {
- getClause().addElement(new ElementBind(var, parseExpr(expression)));
- }
-
- /**
- * replace the vars in the expressions with the nodes in the values map.
- * Vars not listed in the values map are not changed.
- *
- * Will return null if the whereClause is null.
- *
- * @param values
- * the value map to use
- * @return A new Element instance with the values changed.
- */
- public WhereProcessor setVars(Map<Var, Node> values) {
- if ( whereClause != null) {
- /* process when values are empty as rewriter handles Node_Variable to Var translation.
- *
- */
- ElementRewriter r = new ElementRewriter(values);
- whereClause.visit(r);
- whereClause = r.getResult();
- }
- return this;
- }
-
- @Override
- public QuadHolder setValues(Map<Var, Node> values)
- {
- setVars( values );
- return this;
- }
-
- /**
- * Create a list node from a list of objects as per RDF Collections.
- *
- * http://www.w3.org/TR/2013/REC-sparql11-query-20130321/#collections
- *
- * @param objs
- * the list of objects for the list.
- * @return the first blank node in the list.
- */
- public Node list(Object... objs) {
- Node retval = NodeFactory.createBlankNode();
- Node lastObject = retval;
- for (int i = 0; i < objs.length; i++) {
- Node n = AbstractQueryBuilder.makeNode(objs[i], prefixHandler.getPrefixes());
- addWhere(new TriplePath(new Triple(lastObject, RDF.first.asNode(), n)));
- if (i + 1 < objs.length) {
- Node nextObject = NodeFactory.createBlankNode();
- addWhere(new TriplePath(new Triple(lastObject, RDF.rest.asNode(), nextObject)));
- lastObject = nextObject;
- } else {
- addWhere(new TriplePath(new Triple(lastObject, RDF.rest.asNode(), RDF.nil.asNode())));
- }
-
- }
-
- return retval;
- }
-
- /**
- * Add a minus operation to the where clause.
- * The prefixes will be updated with the prefixes from the abstract query builder.
- *
- * @param qb the abstract builder that defines the data to subtract.
- */
- public void addMinus(AbstractQueryBuilder<?> qb) {
- prefixHandler.addPrefixes(qb.getPrologHandler().getPrefixes());
- ElementGroup clause = getClause();
- ElementMinus minus = new ElementMinus(qb.getWhereHandler().getClause());
- clause.addElement(minus);
- }
-
-
- /**
- * @return Build the whereClause and return the element.
- */
- public Element build() {
- /*
- * cleanup union-of-one and other similar issues.
- */
- BuildElementVisitor visitor = new BuildElementVisitor();
- whereClause.visit(visitor);
- return whereClause;
- }
-}
http://git-wip-us.apache.org/repos/asf/jena/blob/ee62b654/jena-extras/jena-querybuilder/src/main/java/org/apache/jena/arq/querybuilder/updatebuilder/WhereQuadHolder.java
----------------------------------------------------------------------
diff --git a/jena-extras/jena-querybuilder/src/main/java/org/apache/jena/arq/querybuilder/updatebuilder/WhereQuadHolder.java b/jena-extras/jena-querybuilder/src/main/java/org/apache/jena/arq/querybuilder/updatebuilder/WhereQuadHolder.java
new file mode 100644
index 0000000..b0a96f7
--- /dev/null
+++ b/jena-extras/jena-querybuilder/src/main/java/org/apache/jena/arq/querybuilder/updatebuilder/WhereQuadHolder.java
@@ -0,0 +1,449 @@
+/*
+ * 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.
+ */
+package org.apache.jena.arq.querybuilder.updatebuilder;
+
+import java.util.Collections;
+import java.util.List;
+import java.util.Map;
+import org.apache.jena.arq.querybuilder.AbstractQueryBuilder;
+import org.apache.jena.arq.querybuilder.clauses.SelectClause;
+import org.apache.jena.arq.querybuilder.handlers.WhereHandler;
+import org.apache.jena.arq.querybuilder.rewriters.BuildElementVisitor;
+import org.apache.jena.arq.querybuilder.rewriters.ElementRewriter;
+import org.apache.jena.graph.Node;
+import org.apache.jena.graph.NodeFactory;
+import org.apache.jena.graph.Triple;
+import org.apache.jena.query.Query;
+import org.apache.jena.sparql.core.Quad;
+import org.apache.jena.sparql.core.TriplePath;
+import org.apache.jena.sparql.core.Var;
+import org.apache.jena.sparql.expr.Expr;
+import org.apache.jena.sparql.lang.sparql_11.ParseException;
+import org.apache.jena.sparql.syntax.*;
+import org.apache.jena.sparql.util.ExprUtils;
+import org.apache.jena.util.iterator.ExtendedIterator;
+import org.apache.jena.util.iterator.NiceIterator;
+import org.apache.jena.vocabulary.RDF;
+
+/**
+ * The where processor. Generally handles update where clause.
+ *
+ * @see <a href=
+ * "http://www.w3.org/TR/2013/REC-sparql11-query-20130321/#rGroupGraphPattern">
+ * SPARQL 11 Query Language - Group Graph Pattern</a>
+ *
+ */
+public class WhereQuadHolder implements QuadHolder {
+
+ private Element whereClause;
+ private final PrefixHandler prefixHandler;
+
+ /**
+ * Constructor.
+ *
+ * @param prefixHandler
+ * the prefix handler to use.
+ */
+ public WhereQuadHolder(PrefixHandler prefixHandler) {
+ this.prefixHandler = prefixHandler;
+ }
+
+ /**
+ * True if there are no elements in the where processor.
+ *
+ * @return true if there are no elements.
+ */
+ public boolean isEmpty() {
+ return whereClause == null || (whereClause instanceof ElementGroup && ((ElementGroup) whereClause).isEmpty());
+ }
+
+ @Override
+ public ExtendedIterator<Quad> getQuads() {
+ return getQuads( Quad.defaultGraphNodeGenerated);
+ }
+
+ public ExtendedIterator<Quad> getQuads( Node defaultGraphName ) {
+ if (isEmpty())
+ {
+ return NiceIterator.emptyIterator();
+ }
+ QuadIteratorBuilder builder = new QuadIteratorBuilder(defaultGraphName);
+ whereClause.visit(builder);
+ return builder.iter;
+ }
+ /**
+ * Add all where attributes from the Where Handler argument.
+ *
+ * @param whereHandler
+ * The Where Handler to copy from.
+ */
+ public void addAll(WhereHandler whereHandler) {
+
+ Element e = whereHandler.getQueryPattern();
+ if (e != null) {
+ // clone the Element
+ ElementRewriter rewriter = new ElementRewriter(Collections.emptyMap());
+ e.visit(rewriter);
+ Element clone = rewriter.getResult();
+
+ if (whereClause == null) {
+ whereClause = clone;
+ } else {
+ ElementGroup eg = null;
+ if (whereClause instanceof ElementGroup) {
+ eg = (ElementGroup) whereClause;
+ } else {
+ eg = new ElementGroup();
+ eg.addElement(whereClause);
+ }
+ if (clone instanceof ElementGroup) {
+ for (Element ele : ((ElementGroup) clone).getElements()) {
+ eg.addElement(ele);
+ }
+ } else {
+ eg.addElement(clone);
+ }
+ whereClause = eg;
+ }
+ }
+ }
+
+ /**
+ * Get the element group for the clause. if The element group is not set,
+ * create and set it.
+ *
+ * Public for ExprFactory use.
+ *
+ * @return The element group.
+ */
+ public ElementGroup getClause() {
+ Element e = whereClause;
+ if (e == null) {
+ e = new ElementGroup();
+ whereClause = e;
+ }
+ if (e instanceof ElementGroup) {
+ return (ElementGroup) e;
+ }
+
+ ElementGroup eg = new ElementGroup();
+ eg.addElement(e);
+ whereClause = eg;
+ return eg;
+ }
+
+ /**
+ * Test that a triple is valid. Throws an IllegalArgumentException if the
+ * triple is not valid.
+ *
+ * @param t
+ * The trip to test.
+ */
+ private static void testTriple(TriplePath t) {
+ // verify Triple is valid
+ boolean validSubject = t.getSubject().isURI() || t.getSubject().isBlank() || t.getSubject().isVariable()
+ || t.getSubject().equals(Node.ANY);
+ boolean validPredicate;
+
+ if (t.isTriple()) {
+ validPredicate = t.getPredicate().isURI() || t.getPredicate().isVariable()
+ || t.getPredicate().equals(Node.ANY);
+ } else {
+ validPredicate = t.getPath() != null;
+ }
+
+ boolean validObject = t.getObject().isURI() || t.getObject().isLiteral() || t.getObject().isBlank()
+ || t.getObject().isVariable() || t.getObject().equals(Node.ANY);
+
+ if (!validSubject || !validPredicate || !validObject) {
+ StringBuilder sb = new StringBuilder();
+ if (!validSubject) {
+ sb.append(String.format("Subject (%s) must be a URI, blank, variable, or a wildcard. %n",
+ t.getSubject()));
+ }
+ if (!validPredicate) {
+ sb.append(String.format("Predicate (%s) must be a Path, URI , variable, or a wildcard. %n",
+ t.getPredicate()));
+ }
+ if (!validObject) {
+ sb.append(String.format("Object (%s) must be a URI, literal, blank, , variable, or a wildcard. %n",
+ t.getObject()));
+ }
+ if (!validSubject || !validPredicate) {
+ sb.append(String.format("Is a prefix missing? Prefix must be defined before use. %n"));
+ }
+ throw new IllegalArgumentException(sb.toString());
+ }
+ }
+
+ /**
+ * Add the triple path to the where clause
+ *
+ * @param t
+ * The triple path to add.
+ * @throws IllegalArgumentException
+ * If the triple path is not a valid triple path for a where
+ * clause.
+ */
+ public void addWhere(TriplePath t) throws IllegalArgumentException {
+ testTriple(t);
+ ElementGroup eg = getClause();
+ List<Element> lst = eg.getElements();
+ if (lst.isEmpty()) {
+ ElementPathBlock epb = new ElementPathBlock();
+ epb.addTriple(t);
+ eg.addElement(epb);
+ } else {
+ Element e = lst.get(lst.size() - 1);
+ if (e instanceof ElementTriplesBlock && t.isTriple()) {
+ ElementTriplesBlock etb = (ElementTriplesBlock) e;
+ etb.addTriple(t.asTriple());
+ } else if (e instanceof ElementPathBlock) {
+ ElementPathBlock epb = (ElementPathBlock) e;
+ epb.addTriple(t);
+ } else {
+ ElementPathBlock etb = new ElementPathBlock();
+ etb.addTriple(t);
+ eg.addElement(etb);
+ }
+
+ }
+ }
+
+ /**
+ * Add an optional triple to the where clause
+ *
+ * @param t
+ * The triple path to add.
+ * @throws IllegalArgumentException
+ * If the triple is not a valid triple for a where clause.
+ */
+ public void addOptional(TriplePath t) throws IllegalArgumentException {
+ testTriple(t);
+ ElementPathBlock epb = new ElementPathBlock();
+ epb.addTriple(t);
+ ElementOptional opt = new ElementOptional(epb);
+ getClause().addElement(opt);
+ }
+
+ /**
+ * Add the contents of a where handler as an optional statement.
+ *
+ * @param whereHandler
+ * The where handler to use as the optional statement.
+ */
+ public void addOptional(WhereHandler whereHandler) {
+ getClause().addElement(new ElementOptional(whereHandler.getClause()));
+ }
+
+ /**
+ * Add an expression string as a filter.
+ *
+ * @param expression
+ * The expression string to add.
+ * @throws ParseException
+ * If the expression can not be parsed.
+ */
+ public void addFilter(String expression) throws ParseException {
+ getClause().addElement(new ElementFilter(parseExpr(expression)));
+ }
+
+ private Expr parseExpr(String expression) {
+ Query query = new Query();
+ query.setPrefixMapping(prefixHandler.getPrefixes());
+ return ExprUtils.parse(query, expression, true);
+
+ }
+
+ /**
+ * add an expression as a filter.
+ *
+ * @param expr
+ * The expression to add.
+ */
+ public void addFilter(Expr expr) {
+ getClause().addElement(new ElementFilter(expr));
+ }
+
+ /**
+ * Add a subquery to the where clause.
+ *
+ * @param subQuery
+ * The sub query to add.
+ */
+ public void addSubQuery(AbstractQueryBuilder<?> subQuery) {
+ getClause().addElement(subQuery.asSubQuery());
+ }
+
+ /**
+ * Add a union to the where clause.
+ *
+ * @param subQuery
+ * The subquery to add as the union.
+ */
+ public void addUnion(AbstractQueryBuilder<?> subQuery) {
+ ElementUnion union = null;
+ ElementGroup clause = getClause();
+ // if the last element is a union make sure we add to it.
+ if (!clause.isEmpty()) {
+ Element lastElement = clause.getElements().get(clause.getElements().size() - 1);
+ if (lastElement instanceof ElementUnion) {
+ union = (ElementUnion) lastElement;
+ } else {
+ // clauses is not empty and is not a union so it is the left
+ // side of the union.
+ union = new ElementUnion();
+ union.addElement(clause);
+ whereClause = union;
+ }
+ } else {
+ // add the union as the first element in the clause.
+ union = new ElementUnion();
+ clause.addElement(union);
+ }
+ // if there are projected vars then do a full blown subquery
+ // otherwise just add the clause.
+ if (subQuery instanceof SelectClause && ((SelectClause<?>) subQuery).getVars().size() > 0) {
+ union.addElement(subQuery.asSubQuery());
+ } else {
+ prefixHandler.addPrefixes(subQuery.getPrologHandler().getPrefixes());
+ union.addElement(subQuery.getWhereHandler().getClause());
+ }
+
+ }
+
+ /**
+ * Add a graph to the where clause.
+ *
+ * @param graph
+ * The name of the graph.
+ * @param subQuery
+ * The where handler that defines the graph.
+ */
+ public void addGraph(Node graph, WhereHandler subQuery) {
+ getClause().addElement(new ElementNamedGraph(graph, subQuery.getClause()));
+ }
+
+ /**
+ * Add a binding to the where clause.
+ *
+ * @param expr
+ * The expression to bind.
+ * @param var
+ * The variable to bind it to.
+ */
+ public void addBind(Expr expr, Var var) {
+ getClause().addElement(new ElementBind(var, expr));
+ }
+
+ /**
+ * Add a binding to the where clause.
+ *
+ * @param expression
+ * The expression to bind.
+ * @param var
+ * The variable to bind it to.
+ * @throws ParseException
+ */
+ public void addBind(String expression, Var var) throws ParseException {
+ getClause().addElement(new ElementBind(var, parseExpr(expression)));
+ }
+
+ /**
+ * replace the vars in the expressions with the nodes in the values map.
+ * Vars not listed in the values map are not changed.
+ *
+ * Will return null if the whereClause is null.
+ *
+ * @param values
+ * the value map to use
+ * @return A new Element instance with the values changed.
+ */
+ public WhereQuadHolder setVars(Map<Var, Node> values) {
+ if ( whereClause != null) {
+ /* process when values are empty as rewriter handles Node_Variable to Var translation.
+ *
+ */
+ ElementRewriter r = new ElementRewriter(values);
+ whereClause.visit(r);
+ whereClause = r.getResult();
+ }
+ return this;
+ }
+
+ @Override
+ public QuadHolder setValues(Map<Var, Node> values)
+ {
+ setVars( values );
+ return this;
+ }
+
+ /**
+ * Create a list node from a list of objects as per RDF Collections.
+ *
+ * http://www.w3.org/TR/2013/REC-sparql11-query-20130321/#collections
+ *
+ * @param objs
+ * the list of objects for the list.
+ * @return the first blank node in the list.
+ */
+ public Node list(Object... objs) {
+ Node retval = NodeFactory.createBlankNode();
+ Node lastObject = retval;
+ for (int i = 0; i < objs.length; i++) {
+ Node n = AbstractQueryBuilder.makeNode(objs[i], prefixHandler.getPrefixes());
+ addWhere(new TriplePath(new Triple(lastObject, RDF.first.asNode(), n)));
+ if (i + 1 < objs.length) {
+ Node nextObject = NodeFactory.createBlankNode();
+ addWhere(new TriplePath(new Triple(lastObject, RDF.rest.asNode(), nextObject)));
+ lastObject = nextObject;
+ } else {
+ addWhere(new TriplePath(new Triple(lastObject, RDF.rest.asNode(), RDF.nil.asNode())));
+ }
+
+ }
+
+ return retval;
+ }
+
+ /**
+ * Add a minus operation to the where clause.
+ * The prefixes will be updated with the prefixes from the abstract query builder.
+ *
+ * @param qb the abstract builder that defines the data to subtract.
+ */
+ public void addMinus(AbstractQueryBuilder<?> qb) {
+ prefixHandler.addPrefixes(qb.getPrologHandler().getPrefixes());
+ ElementGroup clause = getClause();
+ ElementMinus minus = new ElementMinus(qb.getWhereHandler().getClause());
+ clause.addElement(minus);
+ }
+
+
+ /**
+ * @return Build the whereClause and return the element.
+ */
+ public Element build() {
+ /*
+ * cleanup union-of-one and other similar issues.
+ */
+ BuildElementVisitor visitor = new BuildElementVisitor();
+ whereClause.visit(visitor);
+ return whereClause;
+ }
+}
http://git-wip-us.apache.org/repos/asf/jena/blob/ee62b654/jena-extras/jena-querybuilder/src/test/java/org/apache/jena/arq/querybuilder/updatebuilder/CollectionQuadHolderTest.java
----------------------------------------------------------------------
diff --git a/jena-extras/jena-querybuilder/src/test/java/org/apache/jena/arq/querybuilder/updatebuilder/CollectionQuadHolderTest.java b/jena-extras/jena-querybuilder/src/test/java/org/apache/jena/arq/querybuilder/updatebuilder/CollectionQuadHolderTest.java
new file mode 100644
index 0000000..d088f04
--- /dev/null
+++ b/jena-extras/jena-querybuilder/src/test/java/org/apache/jena/arq/querybuilder/updatebuilder/CollectionQuadHolderTest.java
@@ -0,0 +1,330 @@
+package org.apache.jena.arq.querybuilder.updatebuilder;
+
+import static org.junit.Assert.assertEquals;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.jena.graph.Node;
+import org.apache.jena.graph.NodeFactory;
+import org.apache.jena.graph.Triple;
+import org.apache.jena.sparql.core.Quad;
+import org.apache.jena.sparql.core.Var;
+import org.apache.jena.util.iterator.ExtendedIterator;
+import org.apache.jena.util.iterator.WrappedIterator;
+import org.junit.Test;
+
+public class CollectionQuadHolderTest {
+
+ private CollectionQuadHolder holder;
+
+ @Test
+ public void namedGraphTest_List()
+ {
+ Node g = NodeFactory.createURI( "g" );
+
+ List<Triple> tLst = new ArrayList<Triple>();
+ Node s = NodeFactory.createURI( "s" );
+ Node p = NodeFactory.createURI( "p" );
+ Node o = NodeFactory.createURI( "o" );
+ tLst.add( new Triple( s, p, o ) );
+
+ Node s2 = NodeFactory.createURI( "s2" );
+ Node p2 = NodeFactory.createURI( "p2" );
+ Node o2 = NodeFactory.createURI( "o2" );
+ tLst.add( new Triple( s2, p2, o2 ) );
+
+ holder = new CollectionQuadHolder( g, tLst );
+
+ List<Quad> lst = holder.getQuads().toList();
+ assertEquals( 2, lst.size() );
+ assertEquals( new Quad( g, tLst.get(0)), lst.get(0));
+ assertEquals( new Quad( g, tLst.get(1)), lst.get(1));
+ }
+
+ @Test
+ public void namedGraphTest_List_Var()
+ {
+ Node g = NodeFactory.createURI( "g" );
+
+ List<Triple> tLst = new ArrayList<Triple>();
+ Node s = NodeFactory.createURI( "s" );
+ Node p = NodeFactory.createVariable( "p" );
+ Node o = NodeFactory.createURI( "o" );
+ tLst.add( new Triple( s, p, o ) );
+
+ Node s2 = NodeFactory.createURI( "s2" );
+ Node p2 = NodeFactory.createURI( "p2" );
+ Node o2 = NodeFactory.createURI( "o2" );
+ tLst.add( new Triple( s2, p, o2 ) );
+
+ holder = new CollectionQuadHolder( g, tLst );
+ Map<Var,Node> map = new HashMap<>();
+ map.put( Var.alloc(p), p2);
+ holder.setValues( map );
+
+ List<Triple> aLst = new ArrayList<Triple>();
+ aLst.add( new Triple( s, p2, o ) );
+ aLst.add( new Triple( s2, p2, o2 ) );
+
+ List<Quad> lst = holder.getQuads().toList();
+ assertEquals( 2, lst.size() );
+ assertEquals( new Quad( g, aLst.get(0)), lst.get(0));
+ assertEquals( new Quad( g, aLst.get(1)), lst.get(1));
+ }
+
+ @Test
+ public void namedGraphTest_Iterator()
+ {
+ Node g = NodeFactory.createURI( "g" );
+
+ List<Triple> tLst = new ArrayList<Triple>();
+ Node s = NodeFactory.createURI( "s" );
+ Node p = NodeFactory.createURI( "p" );
+ Node o = NodeFactory.createURI( "o" );
+ tLst.add( new Triple( s, p, o ) );
+
+ Node s2 = NodeFactory.createURI( "s2" );
+ Node p2 = NodeFactory.createURI( "p2" );
+ Node o2 = NodeFactory.createURI( "o2" );
+ tLst.add( new Triple( s2, p2, o2 ) );
+
+ holder = new CollectionQuadHolder( g, tLst.iterator() );
+
+ List<Quad> lst = holder.getQuads().toList();
+ assertEquals( 2, lst.size() );
+ assertEquals( new Quad( g, tLst.get(0)), lst.get(0));
+ assertEquals( new Quad( g, tLst.get(1)), lst.get(1));
+ }
+
+ @Test
+ public void namedGraphTest_Iterator_Var()
+ {
+ Node g = NodeFactory.createURI( "g" );
+
+ List<Triple> tLst = new ArrayList<Triple>();
+ Node s = NodeFactory.createURI( "s" );
+ Node p = NodeFactory.createVariable( "p" );
+ Node o = NodeFactory.createURI( "o" );
+ tLst.add( new Triple( s, p, o ) );
+
+ Node s2 = NodeFactory.createURI( "s2" );
+ Node p2 = NodeFactory.createURI( "p2" );
+ Node o2 = NodeFactory.createURI( "o2" );
+ tLst.add( new Triple( s2, p, o2 ) );
+
+ holder = new CollectionQuadHolder( g, tLst.iterator() );
+ Map<Var,Node> map = new HashMap<>();
+ map.put( Var.alloc(p), p2);
+ holder.setValues( map );
+
+ List<Triple> aLst = new ArrayList<Triple>();
+ aLst.add( new Triple( s, p2, o ) );
+ aLst.add( new Triple( s2, p2, o2 ) );
+
+ List<Quad> lst = holder.getQuads().toList();
+ assertEquals( 2, lst.size() );
+ assertEquals( new Quad( g, aLst.get(0)), lst.get(0));
+ assertEquals( new Quad( g, aLst.get(1)), lst.get(1));
+ }
+
+
+
+ @Test
+ public void anonymousGraphTest_List()
+ {
+ Node g = NodeFactory.createURI( "g" );
+
+ List<Triple> tLst = new ArrayList<Triple>();
+ Node s = NodeFactory.createURI( "s" );
+ Node p = NodeFactory.createURI( "p" );
+ Node o = NodeFactory.createURI( "o" );
+ tLst.add( new Triple( s, p, o ) );
+
+ Node s2 = NodeFactory.createURI( "s2" );
+ Node p2 = NodeFactory.createURI( "p2" );
+ Node o2 = NodeFactory.createURI( "o2" );
+ tLst.add( new Triple( s2, p2, o2 ) );
+
+ holder = new CollectionQuadHolder( tLst );
+
+ List<Quad> lst = holder.getQuads().toList();
+ assertEquals( 2, lst.size() );
+ assertEquals( new Quad( Quad.defaultGraphNodeGenerated, tLst.get(0)), lst.get(0));
+ assertEquals( new Quad( Quad.defaultGraphNodeGenerated, tLst.get(1)), lst.get(1));
+ }
+
+ @Test
+ public void anonymousGraphTest_List_Var()
+ {
+ List<Triple> tLst = new ArrayList<Triple>();
+ Node s = NodeFactory.createURI( "s" );
+ Node p = NodeFactory.createVariable( "p" );
+ Node o = NodeFactory.createURI( "o" );
+ tLst.add( new Triple( s, p, o ) );
+
+ Node s2 = NodeFactory.createURI( "s2" );
+ Node p2 = NodeFactory.createURI( "p2" );
+ Node o2 = NodeFactory.createURI( "o2" );
+ tLst.add( new Triple( s2, p, o2 ) );
+
+ holder = new CollectionQuadHolder( tLst );
+ Map<Var,Node> map = new HashMap<>();
+ map.put( Var.alloc(p), p2);
+ holder.setValues( map );
+
+ List<Triple> aLst = new ArrayList<Triple>();
+ aLst.add( new Triple( s, p2, o ) );
+ aLst.add( new Triple( s2, p2, o2 ) );
+
+ List<Quad> lst = holder.getQuads().toList();
+ assertEquals( 2, lst.size() );
+ assertEquals( new Quad( Quad.defaultGraphNodeGenerated, aLst.get(0)), lst.get(0));
+ assertEquals( new Quad( Quad.defaultGraphNodeGenerated, aLst.get(1)), lst.get(1));
+ }
+
+
+ @Test
+ public void anonymousGraphTest_Iterator()
+ {
+ Node g = NodeFactory.createURI( "g" );
+
+ List<Triple> tLst = new ArrayList<Triple>();
+ Node s = NodeFactory.createURI( "s" );
+ Node p = NodeFactory.createURI( "p" );
+ Node o = NodeFactory.createURI( "o" );
+ tLst.add( new Triple( s, p, o ) );
+
+ Node s2 = NodeFactory.createURI( "s2" );
+ Node p2 = NodeFactory.createURI( "p2" );
+ Node o2 = NodeFactory.createURI( "o2" );
+ tLst.add( new Triple( s2, p2, o2 ) );
+
+ holder = new CollectionQuadHolder( tLst.iterator() );
+
+ List<Quad> lst = holder.getQuads().toList();
+ assertEquals( 2, lst.size() );
+ assertEquals( new Quad( Quad.defaultGraphNodeGenerated, tLst.get(0)), lst.get(0));
+ assertEquals( new Quad( Quad.defaultGraphNodeGenerated, tLst.get(1)), lst.get(1));
+ }
+
+ @Test
+ public void anonymousGraphTest_Iterator_Var()
+ {
+ List<Triple> tLst = new ArrayList<Triple>();
+ Node s = NodeFactory.createURI( "s" );
+ Node p = NodeFactory.createVariable( "p" );
+ Node o = NodeFactory.createURI( "o" );
+ tLst.add( new Triple( s, p, o ) );
+
+ Node s2 = NodeFactory.createURI( "s2" );
+ Node p2 = NodeFactory.createURI( "p2" );
+ Node o2 = NodeFactory.createURI( "o2" );
+ tLst.add( new Triple( s2, p, o2 ) );
+
+ holder = new CollectionQuadHolder( tLst.iterator() );
+ Map<Var,Node> map = new HashMap<>();
+ map.put( Var.alloc(p), p2);
+ holder.setValues( map );
+
+ List<Triple> aLst = new ArrayList<Triple>();
+ aLst.add( new Triple( s, p2, o ) );
+ aLst.add( new Triple( s2, p2, o2 ) );
+
+ List<Quad> lst = holder.getQuads().toList();
+ assertEquals( 2, lst.size() );
+ assertEquals( new Quad( Quad.defaultGraphNodeGenerated, aLst.get(0)), lst.get(0));
+ assertEquals( new Quad( Quad.defaultGraphNodeGenerated, aLst.get(1)), lst.get(1));
+ }
+
+// @Test
+// public void anonymousGraphTest_var()
+// {
+// Node g = NodeFactory.createURI( "g" );
+// Node s = NodeFactory.createURI( "s" );
+// Node p = NodeFactory.createVariable( "p" );
+// Node o = NodeFactory.createURI( "o" );
+// Triple triple = new Triple( s, p, o );
+// Quad quad = new Quad( Quad.defaultGraphNodeGenerated, s, p, o );
+// holder = new SingleQuadHolder( triple );
+// List<Quad> lst = holder.getQuads().toList();
+// assertEquals( 1, lst.size() );
+// assertEquals( quad, lst.get(0));
+//
+// Map<Var,Node> map = new HashMap<>();
+// Node p2 = NodeFactory.createURI( "p2" );
+// map.put( Var.alloc(p), p2);
+// holder.setValues( map );
+// Quad quad2 = new Quad( Quad.defaultGraphNodeGenerated, s, p2, o );
+// lst = holder.getQuads().toList();
+// assertEquals( 1, lst.size() );
+// assertEquals( quad2, lst.get(0));
+//
+// /**
+// * Constructor.
+// *
+// * @param graph
+// * the default graph name for the triples
+// * @param triples
+// * the collection of triples.
+// */
+// public CollectionQuadHolder(final Node graph, Collection<Triple> triples) {
+// this.collection = new HashSet<Triple>();
+// this.collection.addAll( triples );
+// defaultGraphName = graph;
+// }
+//
+// /**
+// * Constructor.
+// *
+// * @param graph
+// * the default graph name for the triples
+// * @param triples
+// * the iterator of triples.
+// */
+// public CollectionQuadHolder(final Node graph, Iterator<Triple> triples) {
+// this.collection = WrappedIterator.create( triples ).toSet();
+// defaultGraphName = graph;
+// }
+//
+// /**
+// * Constructor. Uses Quad.defaultGraphNodeGenerated for the graph name.
+// *
+// * @see Quad#defaultGraphNodeGenerated
+// * @param triples
+// * the collection of triples.
+// */
+// public CollectionQuadHolder(final Collection<Triple> triples) {
+// this( Quad.defaultGraphNodeGenerated, triples );
+// }
+//
+// /**
+// * Constructor.
+// *
+// * @param triples
+// * the iterator of triples.
+// */
+// public CollectionQuadHolder(Iterator<Triple> triples) {
+// this.collection = WrappedIterator.create( triples ).toSet();
+// defaultGraphName = Quad.defaultGraphNodeGenerated;
+// }
+//
+// @Override
+// public ExtendedIterator<Quad> getQuads() {
+// return WrappedIterator.create(collection.iterator())
+// .mapWith( triple -> new Quad( defaultGraphName, triple ) );
+// }
+//
+// /**
+// * This implementation does nothing.
+// */
+// @Override
+// public QuadHolder setValues(final Map<Var, Node> values) {
+// return this;
+// }
+}
http://git-wip-us.apache.org/repos/asf/jena/blob/ee62b654/jena-extras/jena-querybuilder/src/test/java/org/apache/jena/arq/querybuilder/updatebuilder/ModelQuadHolderTest.java
----------------------------------------------------------------------
diff --git a/jena-extras/jena-querybuilder/src/test/java/org/apache/jena/arq/querybuilder/updatebuilder/ModelQuadHolderTest.java b/jena-extras/jena-querybuilder/src/test/java/org/apache/jena/arq/querybuilder/updatebuilder/ModelQuadHolderTest.java
new file mode 100644
index 0000000..16a6204
--- /dev/null
+++ b/jena-extras/jena-querybuilder/src/test/java/org/apache/jena/arq/querybuilder/updatebuilder/ModelQuadHolderTest.java
@@ -0,0 +1,82 @@
+package org.apache.jena.arq.querybuilder.updatebuilder;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.jena.graph.Node;
+import org.apache.jena.graph.NodeFactory;
+import org.apache.jena.graph.Triple;
+import org.apache.jena.rdf.model.Model;
+import org.apache.jena.rdf.model.ModelFactory;
+import org.apache.jena.rdf.model.Property;
+import org.apache.jena.rdf.model.RDFNode;
+import org.apache.jena.rdf.model.Resource;
+import org.apache.jena.rdf.model.ResourceFactory;
+import org.apache.jena.sparql.core.Quad;
+import org.junit.Test;
+
+public class ModelQuadHolderTest {
+
+ private Model model;
+ private ModelQuadHolder holder;
+
+ @Test
+ public void anonymousTest() {
+ model = ModelFactory.createDefaultModel();
+
+ List<Triple> tLst = new ArrayList<Triple>();
+ Resource s = ResourceFactory.createResource( "s" );
+ Property p = ResourceFactory.createProperty( "p" );
+ Resource o = ResourceFactory.createResource( "o" );
+ tLst.add( new Triple( s.asNode(), p.asNode(), o.asNode() ) );
+ model.add( s, p, o );
+
+ Resource s2 = ResourceFactory.createResource( "s2" );
+ Property p2 = ResourceFactory.createProperty( "p2" );
+ Resource o2 = ResourceFactory.createResource( "o2" );
+ tLst.add( new Triple( s2.asNode(), p2.asNode(), o2.asNode() ) );
+ model.add( s2, p2, o2 );
+
+ holder = new ModelQuadHolder( model );
+
+ List<Quad> lst = holder.getQuads().toList();
+ assertEquals( 2, lst.size() );
+ Quad q = new Quad( Quad.defaultGraphNodeGenerated, tLst.get(0));
+ assertTrue( "missing "+q, lst.contains( q ));
+
+ q = new Quad( Quad.defaultGraphNodeGenerated, tLst.get(1));
+ assertTrue( "missing "+q, lst.contains( q ));
+ }
+
+ @Test
+ public void namedTest() {
+ model = ModelFactory.createDefaultModel();
+
+ Node g = NodeFactory.createURI( "g" );
+ List<Triple> tLst = new ArrayList<Triple>();
+ Resource s = ResourceFactory.createResource( "s" );
+ Property p = ResourceFactory.createProperty( "p" );
+ Resource o = ResourceFactory.createResource( "o" );
+ tLst.add( new Triple( s.asNode(), p.asNode(), o.asNode() ) );
+ model.add( s, p, o );
+
+ Resource s2 = ResourceFactory.createResource( "s2" );
+ Property p2 = ResourceFactory.createProperty( "p2" );
+ Resource o2 = ResourceFactory.createResource( "o2" );
+ tLst.add( new Triple( s2.asNode(), p2.asNode(), o2.asNode() ) );
+ model.add( s2, p2, o2 );
+
+ holder = new ModelQuadHolder( g, model );
+
+ List<Quad> lst = holder.getQuads().toList();
+ assertEquals( 2, lst.size() );
+ Quad q = new Quad( g, tLst.get(0));
+ assertTrue( "missing "+q, lst.contains( q ));
+
+ q = new Quad( g, tLst.get(1));
+ assertTrue( "missing "+q, lst.contains( q ));
+ }
+}
http://git-wip-us.apache.org/repos/asf/jena/blob/ee62b654/jena-extras/jena-querybuilder/src/test/java/org/apache/jena/arq/querybuilder/updatebuilder/QBQuadHolderTest.java
----------------------------------------------------------------------
diff --git a/jena-extras/jena-querybuilder/src/test/java/org/apache/jena/arq/querybuilder/updatebuilder/QBQuadHolderTest.java b/jena-extras/jena-querybuilder/src/test/java/org/apache/jena/arq/querybuilder/updatebuilder/QBQuadHolderTest.java
new file mode 100644
index 0000000..e071aa3
--- /dev/null
+++ b/jena-extras/jena-querybuilder/src/test/java/org/apache/jena/arq/querybuilder/updatebuilder/QBQuadHolderTest.java
@@ -0,0 +1,202 @@
+package org.apache.jena.arq.querybuilder.updatebuilder;
+
+import static org.junit.Assert.assertEquals;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.jena.arq.querybuilder.AbstractQueryBuilder;
+import org.apache.jena.arq.querybuilder.WhereBuilder;
+import org.apache.jena.graph.Node;
+import org.apache.jena.graph.NodeFactory;
+import org.apache.jena.graph.Triple;
+import org.apache.jena.sparql.core.Quad;
+import org.apache.jena.sparql.core.Var;
+import org.junit.Test;
+
+public class QBQuadHolderTest {
+
+ private QBQuadHolder holder;
+
+
+ @Test
+ public void anonymousTest()
+ {
+ WhereBuilder builder = new WhereBuilder();
+
+ List<Triple> tLst = new ArrayList<Triple>();
+ Node s = NodeFactory.createURI( "s" );
+ Node p = NodeFactory.createURI( "p" );
+ Node o = NodeFactory.createURI( "o" );
+ tLst.add( new Triple( s, p, o ) );
+ builder.addWhere( s, p, o );
+
+ Node s2 = NodeFactory.createURI( "s2" );
+ Node p2 = NodeFactory.createURI( "p2" );
+ Node o2 = NodeFactory.createURI( "o2" );
+ tLst.add( new Triple( s2, p2, o2 ) );
+ builder.addWhere( s2, p2, o2 );
+
+ holder = new QBQuadHolder( builder );
+
+ List<Quad> lst = holder.getQuads().toList();
+ assertEquals( 2, lst.size() );
+ assertEquals( new Quad( Quad.defaultGraphNodeGenerated, tLst.get(0)), lst.get(0));
+ assertEquals( new Quad( Quad.defaultGraphNodeGenerated, tLst.get(1)), lst.get(1));
+ }
+
+ @Test
+ public void anonymousTest_Var()
+ {
+ WhereBuilder builder = new WhereBuilder();
+
+ List<Triple> tLst = new ArrayList<Triple>();
+ Node s = NodeFactory.createURI( "s" );
+ Node p = NodeFactory.createVariable( "p" );
+ Node o = NodeFactory.createURI( "o" );
+ builder.addWhere( s, p, o );
+
+ Node s2 = NodeFactory.createURI( "s2" );
+ Node p2 = NodeFactory.createURI( "p2" );
+ Node o2 = NodeFactory.createURI( "o2" );
+ tLst.add( new Triple( s, p2, o ) );
+ tLst.add( new Triple( s2, p2, o2 ) );
+ builder.addWhere( s2, p, o2 );
+
+ holder = new QBQuadHolder( builder );
+
+ Map<Var,Node> map = new HashMap<>();
+ map.put( Var.alloc(p), p2);
+ holder.setValues( map );
+
+ List<Quad> lst = holder.getQuads().toList();
+ assertEquals( 2, lst.size() );
+ assertEquals( new Quad( Quad.defaultGraphNodeGenerated, tLst.get(0)), lst.get(0));
+ assertEquals( new Quad( Quad.defaultGraphNodeGenerated, tLst.get(1)), lst.get(1));
+ }
+
+ @Test
+ public void namedTest()
+ {
+ WhereBuilder builder = new WhereBuilder();
+
+ Node g = NodeFactory.createURI( "g" );
+
+ List<Triple> tLst = new ArrayList<Triple>();
+ Node s = NodeFactory.createURI( "s" );
+ Node p = NodeFactory.createURI( "p" );
+ Node o = NodeFactory.createURI( "o" );
+ tLst.add( new Triple( s, p, o ) );
+ builder.addGraph( g, s, p, o );
+
+ Node s2 = NodeFactory.createURI( "s2" );
+ Node p2 = NodeFactory.createURI( "p2" );
+ Node o2 = NodeFactory.createURI( "o2" );
+ tLst.add( new Triple( s2, p2, o2 ) );
+
+ builder.addGraph( g, s2, p2, o2 );
+
+ holder = new QBQuadHolder( builder );
+
+ List<Quad> lst = holder.getQuads().toList();
+ assertEquals( 2, lst.size() );
+ assertEquals( new Quad( g, tLst.get(0)), lst.get(0));
+ assertEquals( new Quad( g, tLst.get(1)), lst.get(1));
+ }
+
+ @Test
+ public void namedTest_Var()
+ {
+ WhereBuilder builder = new WhereBuilder();
+
+ Node g = NodeFactory.createURI( "g" );
+
+ List<Triple> tLst = new ArrayList<Triple>();
+ Node s = NodeFactory.createURI( "s" );
+ Node p = NodeFactory.createVariable( "p" );
+ Node o = NodeFactory.createURI( "o" );
+ builder.addGraph( g, s, p, o );
+
+ Node s2 = NodeFactory.createURI( "s2" );
+ Node p2 = NodeFactory.createURI( "p2" );
+ Node o2 = NodeFactory.createURI( "o2" );
+ tLst.add( new Triple( s, p2, o ) );
+ tLst.add( new Triple( s2, p2, o2 ) );
+
+ builder.addGraph( g, s2, p, o2 );
+
+ holder = new QBQuadHolder( builder );
+
+ Map<Var,Node> map = new HashMap<>();
+ map.put( Var.alloc(p), p2);
+ holder.setValues( map );
+
+ List<Quad> lst = holder.getQuads().toList();
+ assertEquals( 2, lst.size() );
+ assertEquals( new Quad( g, tLst.get(0)), lst.get(0));
+ assertEquals( new Quad( g, tLst.get(1)), lst.get(1));
+ }
+
+
+ @Test
+ public void mixedTest()
+ {
+ WhereBuilder builder = new WhereBuilder();
+
+ List<Triple> tLst = new ArrayList<Triple>();
+ Node s = NodeFactory.createURI( "s" );
+ Node p = NodeFactory.createURI( "p" );
+ Node o = NodeFactory.createURI( "o" );
+ tLst.add( new Triple( s, p, o ) );
+ builder.addWhere( s, p, o );
+
+ Node g = NodeFactory.createURI( "g" );
+ Node s2 = NodeFactory.createURI( "s2" );
+ Node p2 = NodeFactory.createURI( "p2" );
+ Node o2 = NodeFactory.createURI( "o2" );
+ tLst.add( new Triple( s2, p2, o2 ) );
+
+ builder.addGraph( g, s2, p2, o2 );
+
+ holder = new QBQuadHolder( builder );
+
+ List<Quad> lst = holder.getQuads().toList();
+ assertEquals( 2, lst.size() );
+ assertEquals( new Quad( Quad.defaultGraphNodeGenerated, tLst.get(0)), lst.get(0));
+ assertEquals( new Quad( g, tLst.get(1)), lst.get(1));
+ }
+
+ @Test
+ public void mixedTest_Var()
+ {
+ WhereBuilder builder = new WhereBuilder();
+
+ List<Triple> tLst = new ArrayList<Triple>();
+ Node s = NodeFactory.createURI( "s" );
+ Node p = NodeFactory.createVariable( "p" );
+ Node o = NodeFactory.createURI( "o" );
+ builder.addWhere( s, p, o );
+
+ Node g = NodeFactory.createURI( "g" );
+ Node s2 = NodeFactory.createURI( "s2" );
+ Node p2 = NodeFactory.createURI( "p2" );
+ Node o2 = NodeFactory.createURI( "o2" );
+ tLst.add( new Triple( s, p2, o ) );
+ tLst.add( new Triple( s2, p2, o2 ) );
+
+ builder.addGraph( g, s2, p, o2 );
+
+ holder = new QBQuadHolder( builder );
+
+ Map<Var,Node> map = new HashMap<>();
+ map.put( Var.alloc(p), p2);
+ holder.setValues( map );
+
+ List<Quad> lst = holder.getQuads().toList();
+ assertEquals( 2, lst.size() );
+ assertEquals( new Quad( Quad.defaultGraphNodeGenerated, tLst.get(0)), lst.get(0));
+ assertEquals( new Quad( g, tLst.get(1)), lst.get(1));
+ }
+}
http://git-wip-us.apache.org/repos/asf/jena/blob/ee62b654/jena-extras/jena-querybuilder/src/test/java/org/apache/jena/arq/querybuilder/updatebuilder/SingleQuadHolderTest.java
----------------------------------------------------------------------
diff --git a/jena-extras/jena-querybuilder/src/test/java/org/apache/jena/arq/querybuilder/updatebuilder/SingleQuadHolderTest.java b/jena-extras/jena-querybuilder/src/test/java/org/apache/jena/arq/querybuilder/updatebuilder/SingleQuadHolderTest.java
new file mode 100644
index 0000000..4c170ea
--- /dev/null
+++ b/jena-extras/jena-querybuilder/src/test/java/org/apache/jena/arq/querybuilder/updatebuilder/SingleQuadHolderTest.java
@@ -0,0 +1,100 @@
+package org.apache.jena.arq.querybuilder.updatebuilder;
+
+import static org.junit.Assert.assertEquals;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.jena.arq.querybuilder.AbstractQueryBuilder;
+import org.apache.jena.graph.Node;
+import org.apache.jena.graph.NodeFactory;
+import org.apache.jena.graph.Triple;
+import org.apache.jena.sparql.core.Quad;
+import org.apache.jena.sparql.core.Var;
+import org.apache.jena.util.iterator.ExtendedIterator;
+import org.apache.jena.util.iterator.SingletonIterator;
+import org.junit.Test;
+
+public class SingleQuadHolderTest {
+
+ private SingleQuadHolder holder;
+
+ @Test
+ public void getQuads_Quad()
+ {
+ Node g = NodeFactory.createURI( "g" );
+ Node s = NodeFactory.createURI( "s" );
+ Node p = NodeFactory.createURI( "p" );
+ Node o = NodeFactory.createURI( "o" );
+ Quad quad = new Quad( g, s, p, o );
+ holder = new SingleQuadHolder( quad );
+ List<Quad> lst = holder.getQuads().toList();
+ assertEquals( 1, lst.size() );
+ assertEquals( quad, lst.get(0));
+ }
+
+
+ @Test
+ public void getQuads_Quad_vars()
+ {
+ Node g = NodeFactory.createURI( "g" );
+ Node s = NodeFactory.createURI( "s" );
+ Node p = NodeFactory.createVariable( "p" );
+ Node o = NodeFactory.createURI( "o" );
+ Quad quad = new Quad( g, s, p, o );
+ holder = new SingleQuadHolder( quad );
+ List<Quad> lst = holder.getQuads().toList();
+ assertEquals( 1, lst.size() );
+ assertEquals( quad, lst.get(0));
+
+ Map<Var,Node> map = new HashMap<>();
+ Node p2 = NodeFactory.createURI( "p2" );
+ map.put( Var.alloc(p), p2);
+ holder.setValues( map );
+ Quad quad2 = new Quad( g, s, p2, o );
+ lst = holder.getQuads().toList();
+ assertEquals( 1, lst.size() );
+ assertEquals( quad2, lst.get(0));
+ }
+
+ @Test
+ public void getQuads_Triple()
+ {
+
+ Node s = NodeFactory.createURI( "s" );
+ Node p = NodeFactory.createURI( "p" );
+ Node o = NodeFactory.createURI( "o" );
+ Triple triple = new Triple( s, p, o );
+ Quad quad = new Quad( Quad.defaultGraphNodeGenerated, s, p, o );
+ holder = new SingleQuadHolder( triple );
+ List<Quad> lst = holder.getQuads().toList();
+ assertEquals( 1, lst.size() );
+ assertEquals( quad, lst.get(0));
+ }
+
+
+ @Test
+ public void getQuads_Triple_vars()
+ {
+ Node s = NodeFactory.createURI( "s" );
+ Node p = NodeFactory.createVariable( "p" );
+ Node o = NodeFactory.createURI( "o" );
+ Triple triple = new Triple( s, p, o );
+ Quad quad = new Quad( Quad.defaultGraphNodeGenerated, s, p, o );
+ holder = new SingleQuadHolder( triple );
+ List<Quad> lst = holder.getQuads().toList();
+ assertEquals( 1, lst.size() );
+ assertEquals( quad, lst.get(0));
+
+ Map<Var,Node> map = new HashMap<>();
+ Node p2 = NodeFactory.createURI( "p2" );
+ map.put( Var.alloc(p), p2);
+ holder.setValues( map );
+ Quad quad2 = new Quad( Quad.defaultGraphNodeGenerated, s, p2, o );
+ lst = holder.getQuads().toList();
+ assertEquals( 1, lst.size() );
+ assertEquals( quad2, lst.get(0));
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/jena/blob/ee62b654/jena-extras/jena-querybuilder/src/test/java/org/apache/jena/arq/querybuilder/updatebuilder/WhereQuadHolderTest.java
----------------------------------------------------------------------
diff --git a/jena-extras/jena-querybuilder/src/test/java/org/apache/jena/arq/querybuilder/updatebuilder/WhereQuadHolderTest.java b/jena-extras/jena-querybuilder/src/test/java/org/apache/jena/arq/querybuilder/updatebuilder/WhereQuadHolderTest.java
new file mode 100644
index 0000000..a663339
--- /dev/null
+++ b/jena-extras/jena-querybuilder/src/test/java/org/apache/jena/arq/querybuilder/updatebuilder/WhereQuadHolderTest.java
@@ -0,0 +1,202 @@
+package org.apache.jena.arq.querybuilder.updatebuilder;
+
+import static org.junit.Assert.assertEquals;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.jena.arq.querybuilder.AbstractQueryBuilder;
+import org.apache.jena.arq.querybuilder.WhereBuilder;
+import org.apache.jena.arq.querybuilder.handlers.WhereHandler;
+import org.apache.jena.graph.Node;
+import org.apache.jena.graph.NodeFactory;
+import org.apache.jena.graph.Triple;
+import org.apache.jena.sparql.core.Quad;
+import org.apache.jena.sparql.core.TriplePath;
+import org.apache.jena.sparql.core.Var;
+import org.apache.jena.sparql.path.P_Link;
+import org.apache.jena.sparql.path.Path;
+import org.junit.Test;
+
+public class WhereQuadHolderTest {
+
+ private WhereQuadHolder holder;
+
+
+ @Test
+ public void anonymousTest()
+ {
+ holder = new WhereQuadHolder( new PrefixHandler() );
+
+ List<Triple> tLst = new ArrayList<Triple>();
+ Node s = NodeFactory.createURI( "s" );
+ Node p = NodeFactory.createURI( "p" );
+ Node o = NodeFactory.createURI( "o" );
+ tLst.add( new Triple( s, p, o ) );
+ holder.addWhere( new TriplePath( s, new P_Link(p), o ));
+
+ Node s2 = NodeFactory.createURI( "s2" );
+ Node p2 = NodeFactory.createURI( "p2" );
+ Node o2 = NodeFactory.createURI( "o2" );
+ tLst.add( new Triple( s2, p2, o2 ) );
+ holder.addWhere( new TriplePath( s2, new P_Link(p2), o2 ));
+
+ List<Quad> lst = holder.getQuads().toList();
+ assertEquals( 2, lst.size() );
+ assertEquals( new Quad( Quad.defaultGraphNodeGenerated, tLst.get(0)), lst.get(0));
+ assertEquals( new Quad( Quad.defaultGraphNodeGenerated, tLst.get(1)), lst.get(1));
+ }
+
+ @Test
+ public void anonymousTest_Var()
+ {
+ holder = new WhereQuadHolder( new PrefixHandler() );
+
+ List<Triple> tLst = new ArrayList<Triple>();
+ Node s = NodeFactory.createURI( "s" );
+ Node p = NodeFactory.createVariable( "p" );
+ Node o = NodeFactory.createURI( "o" );
+ holder.addWhere( new TriplePath( s, new P_Link(p), o ));
+
+ Node s2 = NodeFactory.createURI( "s2" );
+ Node p2 = NodeFactory.createURI( "p2" );
+ Node o2 = NodeFactory.createURI( "o2" );
+ tLst.add( new Triple( s, p2, o ) );
+ tLst.add( new Triple( s2, p2, o2 ) );
+ holder.addWhere( new TriplePath( s2, new P_Link(p), o2 ));
+
+ Map<Var,Node> map = new HashMap<>();
+ map.put( Var.alloc(p), p2);
+ holder.setValues( map );
+
+ List<Quad> lst = holder.getQuads().toList();
+ assertEquals( 2, lst.size() );
+ assertEquals( new Quad( Quad.defaultGraphNodeGenerated, tLst.get(0)), lst.get(0));
+ assertEquals( new Quad( Quad.defaultGraphNodeGenerated, tLst.get(1)), lst.get(1));
+ }
+
+ @Test
+ public void namedTest()
+ {
+ holder = new WhereQuadHolder( new PrefixHandler() );
+
+ Node g = NodeFactory.createURI( "g" );
+
+ List<Triple> tLst = new ArrayList<Triple>();
+ Node s = NodeFactory.createURI( "s" );
+ Node p = NodeFactory.createURI( "p" );
+ Node o = NodeFactory.createURI( "o" );
+ tLst.add( new Triple( s, p, o ) );
+ WhereHandler whereHandler = new WhereHandler();
+ whereHandler.addWhere( new TriplePath(s, new P_Link(p), o ));
+ holder.addGraph( g, whereHandler );
+
+ Node s2 = NodeFactory.createURI( "s2" );
+ Node p2 = NodeFactory.createURI( "p2" );
+ Node o2 = NodeFactory.createURI( "o2" );
+ tLst.add( new Triple( s2, p2, o2 ) );
+ whereHandler = new WhereHandler();
+ whereHandler.addWhere( new TriplePath(s2, new P_Link(p2), o2 ));
+ holder.addGraph( g, whereHandler );
+
+ List<Quad> lst = holder.getQuads().toList();
+ assertEquals( 2, lst.size() );
+ assertEquals( new Quad( g, tLst.get(0)), lst.get(0));
+ assertEquals( new Quad( g, tLst.get(1)), lst.get(1));
+ }
+
+ @Test
+ public void namedTest_Var()
+ {
+ holder = new WhereQuadHolder( new PrefixHandler() );
+
+ Node g = NodeFactory.createURI( "g" );
+
+ List<Triple> tLst = new ArrayList<Triple>();
+ Node s = NodeFactory.createURI( "s" );
+ Node p = NodeFactory.createVariable( "p" );
+ Node o = NodeFactory.createURI( "o" );
+ WhereHandler whereHandler = new WhereHandler();
+ whereHandler.addWhere( new TriplePath(s, new P_Link(p), o ));
+ holder.addGraph( g, whereHandler );
+
+ Node s2 = NodeFactory.createURI( "s2" );
+ Node p2 = NodeFactory.createURI( "p2" );
+ Node o2 = NodeFactory.createURI( "o2" );
+ whereHandler = new WhereHandler();
+ whereHandler.addWhere( new TriplePath(s2, new P_Link(p2), o2 ));
+ holder.addGraph( g, whereHandler );
+
+ tLst.add( new Triple( s, p2, o ) );
+ tLst.add( new Triple( s2, p2, o2 ) );
+
+ Map<Var,Node> map = new HashMap<>();
+ map.put( Var.alloc(p), p2);
+ holder.setValues( map );
+
+ List<Quad> lst = holder.getQuads().toList();
+ assertEquals( 2, lst.size() );
+ assertEquals( new Quad( g, tLst.get(0)), lst.get(0));
+ assertEquals( new Quad( g, tLst.get(1)), lst.get(1));
+ }
+
+ @Test
+ public void mixedTest()
+ {
+ holder = new WhereQuadHolder( new PrefixHandler() );
+
+ List<Triple> tLst = new ArrayList<Triple>();
+ Node s = NodeFactory.createURI( "s" );
+ Node p = NodeFactory.createURI( "p" );
+ Node o = NodeFactory.createURI( "o" );
+ tLst.add( new Triple( s, p, o ) );
+ holder.addWhere( new TriplePath(s, new P_Link(p), o ) );
+
+ Node g = NodeFactory.createURI( "g" );
+ Node s2 = NodeFactory.createURI( "s2" );
+ Node p2 = NodeFactory.createURI( "p2" );
+ Node o2 = NodeFactory.createURI( "o2" );
+ tLst.add( new Triple( s2, p2, o2 ) );
+ WhereHandler whereHandler = new WhereHandler();
+ whereHandler.addWhere( new TriplePath(s2, new P_Link(p2), o2 ));
+ holder.addGraph( g, whereHandler );
+
+ List<Quad> lst = holder.getQuads().toList();
+ assertEquals( 2, lst.size() );
+ assertEquals( new Quad( Quad.defaultGraphNodeGenerated, tLst.get(0)), lst.get(0));
+ assertEquals( new Quad( g, tLst.get(1)), lst.get(1));
+ }
+
+ @Test
+ public void mixedTest_Var()
+ {
+ holder = new WhereQuadHolder( new PrefixHandler() );
+
+ List<Triple> tLst = new ArrayList<Triple>();
+ Node s = NodeFactory.createURI( "s" );
+ Node p = NodeFactory.createVariable( "p" );
+ Node o = NodeFactory.createURI( "o" );
+ holder.addWhere( new TriplePath(s, new P_Link(p), o ) );
+
+ Node g = NodeFactory.createURI( "g" );
+ Node s2 = NodeFactory.createURI( "s2" );
+ Node p2 = NodeFactory.createURI( "p2" );
+ Node o2 = NodeFactory.createURI( "o2" );
+ tLst.add( new Triple( s, p2, o ) );
+ tLst.add( new Triple( s2, p2, o2 ) );
+ WhereHandler whereHandler = new WhereHandler();
+ whereHandler.addWhere( new TriplePath(s2, new P_Link(p2), o2 ));
+ holder.addGraph( g, whereHandler );
+
+ Map<Var,Node> map = new HashMap<>();
+ map.put( Var.alloc(p), p2);
+ holder.setValues( map );
+
+ List<Quad> lst = holder.getQuads().toList();
+ assertEquals( 2, lst.size() );
+ assertEquals( new Quad( Quad.defaultGraphNodeGenerated, tLst.get(0)), lst.get(0));
+ assertEquals( new Quad( g, tLst.get(1)), lst.get(1));
+ }
+}
http://git-wip-us.apache.org/repos/asf/jena/blob/ee62b654/jena-maven-tools/pom.xml
----------------------------------------------------------------------
diff --git a/jena-maven-tools/pom.xml b/jena-maven-tools/pom.xml
index c301588..7860c3e 100644
--- a/jena-maven-tools/pom.xml
+++ b/jena-maven-tools/pom.xml
@@ -20,7 +20,6 @@
<modelVersion>4.0.0</modelVersion>
<artifactId>jena-maven-tools</artifactId>
<packaging>maven-plugin</packaging>
- <version>3.7.0-SNAPSHOT</version>
<name>Apache Jena - Maven Plugins, including schemagen</name>
<description>Plugins for Apache Maven to perform source management activities,
such as generating Java files from RDF vocabulary sources using
@@ -30,7 +29,7 @@
<parent>
<groupId>org.apache.jena</groupId>
<artifactId>jena</artifactId>
- <version>3.7.0-SNAPSHOT</version>
+ <version>3.9.0-SNAPSHOT</version>
<relativePath>..</relativePath>
</parent>
@@ -188,7 +187,7 @@
<dependency>
<groupId>org.apache.jena</groupId>
<artifactId>jena-cmds</artifactId>
- <version>3.7.0-SNAPSHOT</version>
+ <version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.codehaus.plexus</groupId>
[6/8] jena git commit: reversing unintended changes
Posted by cl...@apache.org.
reversing unintended changes
Project: http://git-wip-us.apache.org/repos/asf/jena/repo
Commit: http://git-wip-us.apache.org/repos/asf/jena/commit/24a092d9
Tree: http://git-wip-us.apache.org/repos/asf/jena/tree/24a092d9
Diff: http://git-wip-us.apache.org/repos/asf/jena/diff/24a092d9
Branch: refs/heads/master
Commit: 24a092d9ea4633219aa3932daedb3e728af51051
Parents: d6dc5cd
Author: Claude Warren <cl...@xenei.com>
Authored: Fri Oct 12 21:46:24 2018 +0100
Committer: Claude Warren <cl...@xenei.com>
Committed: Fri Oct 12 21:46:24 2018 +0100
----------------------------------------------------------------------
jena-maven-tools/pom.xml | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/jena/blob/24a092d9/jena-maven-tools/pom.xml
----------------------------------------------------------------------
diff --git a/jena-maven-tools/pom.xml b/jena-maven-tools/pom.xml
index 7860c3e..c301588 100644
--- a/jena-maven-tools/pom.xml
+++ b/jena-maven-tools/pom.xml
@@ -20,6 +20,7 @@
<modelVersion>4.0.0</modelVersion>
<artifactId>jena-maven-tools</artifactId>
<packaging>maven-plugin</packaging>
+ <version>3.7.0-SNAPSHOT</version>
<name>Apache Jena - Maven Plugins, including schemagen</name>
<description>Plugins for Apache Maven to perform source management activities,
such as generating Java files from RDF vocabulary sources using
@@ -29,7 +30,7 @@
<parent>
<groupId>org.apache.jena</groupId>
<artifactId>jena</artifactId>
- <version>3.9.0-SNAPSHOT</version>
+ <version>3.7.0-SNAPSHOT</version>
<relativePath>..</relativePath>
</parent>
@@ -187,7 +188,7 @@
<dependency>
<groupId>org.apache.jena</groupId>
<artifactId>jena-cmds</artifactId>
- <version>${project.version}</version>
+ <version>3.7.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.codehaus.plexus</groupId>
[7/8] jena git commit: JENA-1602 Merge commit 'refs/pull/480/head' of
github.com:apache/jena
Posted by cl...@apache.org.
JENA-1602 Merge commit 'refs/pull/480/head' of github.com:apache/jena
This closes #480
Project: http://git-wip-us.apache.org/repos/asf/jena/repo
Commit: http://git-wip-us.apache.org/repos/asf/jena/commit/3dfdfa8a
Tree: http://git-wip-us.apache.org/repos/asf/jena/tree/3dfdfa8a
Diff: http://git-wip-us.apache.org/repos/asf/jena/diff/3dfdfa8a
Branch: refs/heads/master
Commit: 3dfdfa8add99f1802d414bba117cbf94ebe3d817
Parents: a56eb06 24a092d
Author: Claude Warren <cl...@xenei.com>
Authored: Sun Oct 14 11:24:17 2018 +0100
Committer: Claude Warren <cl...@xenei.com>
Committed: Sun Oct 14 11:24:17 2018 +0100
----------------------------------------------------------------------
.../jena/arq/querybuilder/UpdateBuilder.java | 172 ++++++-
.../updatebuilder/CollectionQuadHolder.java | 130 ++++++
.../updatebuilder/ModelQuadHolder.java | 74 +++
.../updatebuilder/WhereProcessor.java | 449 -------------------
.../updatebuilder/WhereQuadHolder.java | 449 +++++++++++++++++++
.../updatebuilder/CollectionQuadHolderTest.java | 340 ++++++++++++++
.../updatebuilder/ModelQuadHolderTest.java | 98 ++++
.../updatebuilder/QBQuadHolderTest.java | 218 +++++++++
.../updatebuilder/SingleQuadHolderTest.java | 114 +++++
.../updatebuilder/WhereQuadHolderTest.java | 216 +++++++++
10 files changed, 1807 insertions(+), 453 deletions(-)
----------------------------------------------------------------------
[2/8] jena git commit: Merge branch 'master' into 1602-fix
Posted by cl...@apache.org.
Merge branch 'master' into 1602-fix
Project: http://git-wip-us.apache.org/repos/asf/jena/repo
Commit: http://git-wip-us.apache.org/repos/asf/jena/commit/311843dd
Tree: http://git-wip-us.apache.org/repos/asf/jena/tree/311843dd
Diff: http://git-wip-us.apache.org/repos/asf/jena/diff/311843dd
Branch: refs/heads/master
Commit: 311843dd22bc5ea2b11d10ae9011645f797c504d
Parents: ee62b65 ecb01ec
Author: Claude Warren <cl...@xenei.com>
Authored: Sun Oct 7 13:10:53 2018 +0100
Committer: Claude Warren <cl...@xenei.com>
Committed: Sun Oct 7 13:10:53 2018 +0100
----------------------------------------------------------------------
.gitignore | 2 +
README | 10 -
README.md | 10 +
apache-jena-libs/pom.xml | 10 +-
apache-jena-osgi/jena-osgi-features/pom.xml | 2 +-
.../src/main/resources/features.xml | 2 -
apache-jena-osgi/jena-osgi/pom.xml | 16 +-
apache-jena-osgi/pom.xml | 4 +-
apache-jena/pom.xml | 48 +-
jena-arq/pom.xml | 12 +-
.../arq/examples/riot/ExJsonLD.java | 380 -
.../arq/examples/riot/ExRIOT1_ReadModel.java | 52 +
.../arq/examples/riot/ExRIOT2_ReadDataset.java | 45 +
.../arq/examples/riot/ExRIOT3_RDFParser.java | 57 +
.../examples/riot/ExRIOT4_StreamRDF_Filter.java | 64 +
.../examples/riot/ExRIOT5_StreamRDFCollect.java | 48 +
.../arq/examples/riot/ExRIOT6_AddNewReader.java | 117 +
.../arq/examples/riot/ExRIOT7_ParserPiped.java | 73 +
.../arq/examples/riot/ExRIOT_1.java | 52 -
.../arq/examples/riot/ExRIOT_2.java | 57 -
.../arq/examples/riot/ExRIOT_3.java | 45 -
.../arq/examples/riot/ExRIOT_4.java | 80 -
.../arq/examples/riot/ExRIOT_5.java | 117 -
.../arq/examples/riot/ExRIOT_6.java | 73 -
.../arq/examples/riot/ExRIOT_7.java | 48 -
.../arq/examples/riot/ExRIOT_out1.java | 48 -
.../arq/examples/riot/ExRIOT_out2.java | 47 -
.../arq/examples/riot/ExRIOT_out3.java | 107 -
.../arq/examples/riot/ExRIOTw1_writeModel.java | 48 +
.../arq/examples/riot/ExRIOTw2_writeRDF.java | 47 +
.../examples/riot/ExRIOTw3_AddNewWriter.java | 107 +
.../arq/examples/riot/Ex_WriteJsonLD.java | 380 +
.../java/org/apache/jena/atlas/web/WebLib.java | 12 +
.../apache/jena/riot/out/NodeFormatterTTL.java | 36 +-
.../java/org/apache/jena/riot/web/HttpOp.java | 57 +-
.../jena/riot/web/HttpRequestTransformer.java | 29 +
.../apache/jena/riot/web/HttpResponseLib.java | 9 +-
.../org/apache/jena/sparql/ARQConstants.java | 4 +-
.../jena/sparql/sse/builders/BuilderExpr.java | 12 +-
jena-base/pom.xml | 6 +-
.../org/apache/jena/atlas/logging/LogCtl.java | 31 +-
.../logging/java/ConsoleHandlerStream.java | 11 +-
jena-cmds/pom.xml | 22 +-
jena-cmds/src/main/java/arq/bindings.java | 2 +-
jena-cmds/src/main/java/arq/iri.java | 2 +-
jena-cmds/src/main/java/arq/juuid.java | 2 +-
jena-cmds/src/main/java/arq/qexpr.java | 25 +-
jena-cmds/src/main/java/arq/rupdate.java | 2 +-
jena-cmds/src/main/java/arq/utf8.java | 2 +-
jena-cmds/src/main/java/jena/version.java | 2 +-
jena-cmds/src/main/java/riotcmd/dumpthrift.java | 2 +-
jena-cmds/src/main/java/riotcmd/utf8.java | 2 +-
jena-core/pom.xml | 10 +-
.../apache/jena/datatypes/xsd/XSDDatatype.java | 2 +-
.../java/org/apache/jena/vocabulary/AS.java | 160 +
.../java/org/apache/jena/vocabulary/OA.java | 113 +
jena-csv/pom.xml | 10 +-
jena-db/jena-dboe-base/pom.xml | 6 +-
jena-db/jena-dboe-index-test/pom.xml | 4 +-
jena-db/jena-dboe-index/pom.xml | 4 +-
jena-db/jena-dboe-trans-data/pom.xml | 10 +-
jena-db/jena-dboe-transaction/pom.xml | 4 +-
jena-db/jena-tdb2/pom.xml | 10 +-
.../apache/jena/tdb2/loader/LoaderFactory.java | 10 +-
.../loader/sequential/LoaderSequential.java | 2 +-
jena-db/pom.xml | 4 +-
jena-elephas/jena-elephas-common/pom.xml | 2 +-
jena-elephas/jena-elephas-io/pom.xml | 4 +-
jena-elephas/jena-elephas-mapreduce/pom.xml | 2 +-
.../filter/AbstractNodeTupleFilterMapper.java | 6 +-
jena-elephas/jena-elephas-stats/pom.xml | 2 +-
jena-elephas/pom.xml | 6 +-
jena-extras/jena-querybuilder/pom.xml | 2 +-
jena-extras/pom.xml | 6 +-
jena-fuseki1/pom.xml | 18 +-
.../apache-jena-fuseki/assembly-dist.xml | 4 +-
jena-fuseki2/apache-jena-fuseki/pom.xml | 6 +-
jena-fuseki2/jena-fuseki-access/pom.xml | 17 +-
.../jena/fuseki/access/DataAccessCtl.java | 2 +-
.../access/AbstractTestSecurityAssembler.java | 8 +-
.../fuseki/access/TestSecurityFilterFuseki.java | 11 +-
jena-fuseki2/jena-fuseki-basic/pom.xml | 206 -
jena-fuseki2/jena-fuseki-basic/run-sparqler | 8 -
.../jena-fuseki-basic/sparqler/data/books.ttl | 48 -
.../jena-fuseki-basic/sparqler/data/empty.nt | 2 -
.../sparqler/data/sparql-data.ttl | 102 -
.../sparqler/data/underground.ttl | 8996 ----------------
.../sparqler/log4j-foreground.properties | 44 -
.../sparqler/log4j-server.properties | 44 -
.../jena-fuseki-basic/sparqler/pages/D.nt | 0
.../jena-fuseki-basic/sparqler/pages/D.rdf | 8 -
.../jena-fuseki-basic/sparqler/pages/D.ttl | 3 -
.../sparqler/pages/crossdomain.xml | 3 -
.../sparqler/pages/data-validator.html | 48 -
.../jena-fuseki-basic/sparqler/pages/doc.css | 127 -
.../jena-fuseki-basic/sparqler/pages/fuseki.css | 148 -
.../jena-fuseki-basic/sparqler/pages/index.html | 73 -
.../sparqler/pages/iri-validator.html | 22 -
.../sparqler/pages/query-validator.html | 71 -
.../jena-fuseki-basic/sparqler/pages/query.html | 63 -
.../jena-fuseki-basic/sparqler/pages/robots.txt | 2 -
.../sparqler/pages/sparql.html | 51 -
.../sparqler/pages/update-validator.html | 46 -
.../sparqler/pages/update.html | 27 -
.../sparqler/pages/validator.html | 35 -
.../sparqler/pages/xml-to-html-links.xsl | 183 -
.../sparqler/pages/xml-to-html-plain.xsl | 187 -
.../sparqler/pages/xml-to-html.xsl | 187 -
.../jena-fuseki-basic/sparqler/run-sparqler | 64 -
.../apache/jena/fuseki/cmds/FusekiBasicCmd.java | 46 -
.../jena/fuseki/cmds/FusekiBasicMain.java | 513 -
.../apache/jena/fuseki/cmds/PlatformInfo.java | 135 -
.../apache/jena/fuseki/cmds/ServerConfig.java | 51 -
jena-fuseki2/jena-fuseki-core/fuseki-dev | 105 -
jena-fuseki2/jena-fuseki-core/pom.xml | 85 +-
.../java/org/apache/jena/fuseki/Fuseki.java | 76 +
.../java/org/apache/jena/fuseki/FusekiCmd.java | 28 -
.../java/org/apache/jena/fuseki/FusekiLib.java | 238 -
.../fuseki/authz/AuthorizationFilter403.java | 59 -
.../apache/jena/fuseki/authz/DenyFilter.java | 33 -
.../jena/fuseki/authz/LocalhostFilter.java | 62 -
.../build/DatasetDescriptionRegistry.java | 17 +-
.../apache/jena/fuseki/build/FusekiBuilder.java | 139 +-
.../apache/jena/fuseki/build/FusekiConfig.java | 88 +-
.../org/apache/jena/fuseki/build/Template.java | 70 -
.../jena/fuseki/build/TemplateFunctions.java | 86 -
.../org/apache/jena/fuseki/cmd/FusekiCmd.java | 377 -
.../org/apache/jena/fuseki/cmd/JettyFuseki.java | 325 -
.../org/apache/jena/fuseki/conneg/ConNeg.java | 206 -
.../org/apache/jena/fuseki/conneg/WebLib.java | 60 -
.../java/org/apache/jena/fuseki/ctl/Backup.java | 131 -
.../org/apache/jena/fuseki/jetty/JettyLib.java | 9 +-
.../apache/jena/fuseki/mgt/ActionBackup.java | 68 -
.../jena/fuseki/mgt/ActionBackupList.java | 95 -
.../apache/jena/fuseki/mgt/ActionDatasets.java | 511 -
.../org/apache/jena/fuseki/mgt/ActionLogs.java | 60 -
.../jena/fuseki/mgt/ActionServerStatus.java | 117 -
.../org/apache/jena/fuseki/mgt/DumpServlet.java | 300 -
.../apache/jena/fuseki/mgt/ServerMgtConst.java | 39 -
.../fuseki/server/DataAccessPointRegistry.java | 9 +-
.../apache/jena/fuseki/server/DataService.java | 18 +-
.../apache/jena/fuseki/server/ServiceOnly.java | 44 +
.../apache/jena/fuseki/servlets/ActionLib.java | 12 +-
.../jena/fuseki/servlets/ActionService.java | 6 +-
.../jena/fuseki/servlets/REST_Quads_RW.java | 4 +-
.../jena/fuseki/servlets/ResponseDataset.java | 6 +-
.../jena/fuseki/servlets/ResponseResultSet.java | 2 +-
.../jena/fuseki/servlets/SPARQL_GSP_RW.java | 8 +-
.../jena/fuseki/servlets/SPARQL_Query.java | 6 +-
.../jena/fuseki/servlets/SPARQL_Update.java | 5 +-
.../jena/fuseki/servlets/SPARQL_Upload.java | 6 +-
.../jena/fuseki/servlets/ServiceRouter.java | 2 +-
.../org/apache/jena/fuseki/system/ConNeg.java | 206 +
.../apache/jena/fuseki/system/FusekiNetLib.java | 179 +
.../org/apache/jena/fuseki/system/Upload.java | 3 +-
.../jena/fuseki/validation/ValidatorBase.java | 2 +-
.../validation/html/DataValidatorHTML.java | 4 +-
.../apache/jena/fuseki/webapp/FusekiEnv.java | 168 -
.../webapp/FusekiServerEnvironmentInit.java | 54 -
.../fuseki/webapp/FusekiServerListener.java | 107 -
.../apache/jena/fuseki/webapp/FusekiSystem.java | 459 -
.../fuseki/webapp/ShiroEnvironmentLoader.java | 163 -
.../apache/jena/fuseki/webapp/SystemState.java | 96 -
.../org/apache/jena/fuseki/webapp/config.ttl | 30 -
.../org/apache/jena/fuseki/webapp/shiro.ini | 37 -
.../jena/fuseki/webapp/templates/config-mem | 27 -
.../jena/fuseki/webapp/templates/config-service | 23 -
.../jena/fuseki/webapp/templates/config-tdb | 31 -
.../jena/fuseki/webapp/templates/config-tdb-dir | 30 -
.../jena/fuseki/webapp/templates/config-tdb-mem | 30 -
.../jena/fuseki/webapp/templates/config-tdb2 | 31 -
.../fuseki/webapp/templates/config-tdb2-dir | 30 -
.../fuseki/webapp/templates/config-tdb2-mem | 30 -
.../src/main/webapp/WEB-INF/web.xml | 326 -
.../src/main/webapp/admin-logs.html | 73 -
.../main/webapp/css/bootstrap-select.min.css | 7 -
.../src/main/webapp/css/bootstrap-theme.css.map | 1 -
.../src/main/webapp/css/bootstrap-theme.min.css | 7 -
.../src/main/webapp/css/bootstrap.css.map | 1 -
.../src/main/webapp/css/bootstrap.min.css | 7 -
.../src/main/webapp/css/codemirror.css | 301 -
.../src/main/webapp/css/codemirror.min.css | 1 -
.../src/main/webapp/css/font-awesome.min.css | 4 -
.../src/main/webapp/css/fui.css | 191 -
.../src/main/webapp/css/jquery.dataTables.css | 220 -
.../webapp/css/jquery.fileupload-noscript.css | 22 -
.../css/jquery.fileupload-ui-noscript.css | 17 -
.../main/webapp/css/jquery.fileupload-ui.css | 57 -
.../src/main/webapp/css/jquery.fileupload.css | 36 -
.../src/main/webapp/css/pivot.min.css | 1 -
.../src/main/webapp/css/qonsole.css | 172 -
.../src/main/webapp/css/yasqe.min.css | 1 -
.../src/main/webapp/css/yasr.min.css | 1 -
.../src/main/webapp/dataset.html | 247 -
.../src/main/webapp/documentation.html | 83 -
.../src/main/webapp/fonts/FontAwesome.otf | Bin 75188 -> 0 bytes
.../main/webapp/fonts/fontawesome-webfont.eot | Bin 72449 -> 0 bytes
.../main/webapp/fonts/fontawesome-webfont.svg | 504 -
.../main/webapp/fonts/fontawesome-webfont.ttf | Bin 141564 -> 0 bytes
.../main/webapp/fonts/fontawesome-webfont.woff | Bin 83760 -> 0 bytes
.../fonts/glyphicons-halflings-regular.eot | Bin 20335 -> 0 bytes
.../fonts/glyphicons-halflings-regular.svg | 229 -
.../fonts/glyphicons-halflings-regular.ttf | Bin 41280 -> 0 bytes
.../fonts/glyphicons-halflings-regular.woff | Bin 23320 -> 0 bytes
.../src/main/webapp/images/back_disabled.png | Bin 1361 -> 0 bytes
.../src/main/webapp/images/back_enabled.png | Bin 1379 -> 0 bytes
.../main/webapp/images/back_enabled_hover.png | Bin 1375 -> 0 bytes
.../src/main/webapp/images/favicon.ico | Bin 1085 -> 0 bytes
.../src/main/webapp/images/forward_disabled.png | Bin 1363 -> 0 bytes
.../src/main/webapp/images/forward_enabled.png | Bin 1380 -> 0 bytes
.../webapp/images/forward_enabled_hover.png | Bin 1379 -> 0 bytes
.../webapp/images/jena-logo-notext-small.png | Bin 2469 -> 0 bytes
.../src/main/webapp/images/sort_asc.png | Bin 1118 -> 0 bytes
.../main/webapp/images/sort_asc_disabled.png | Bin 1050 -> 0 bytes
.../src/main/webapp/images/sort_both.png | Bin 1136 -> 0 bytes
.../src/main/webapp/images/sort_desc.png | Bin 1127 -> 0 bytes
.../main/webapp/images/sort_desc_disabled.png | Bin 1045 -> 0 bytes
.../src/main/webapp/images/wait30.gif | Bin 6337 -> 0 bytes
.../jena-fuseki-core/src/main/webapp/index.html | 101 -
.../js/app/controllers/dataset-controller.js | 69 -
.../js/app/controllers/index-controller.js | 50 -
.../js/app/controllers/manage-controller.js | 39 -
.../js/app/controllers/query-controller.js | 72 -
.../js/app/controllers/upload-controller.js | 42 -
.../js/app/controllers/validation-controller.js | 38 -
.../src/main/webapp/js/app/fui.js | 33 -
.../src/main/webapp/js/app/main.dataset.js | 31 -
.../src/main/webapp/js/app/main.index.js | 24 -
.../src/main/webapp/js/app/main.manage.js | 27 -
.../src/main/webapp/js/app/main.validation.js | 24 -
.../main/webapp/js/app/models/dataset-stats.js | 102 -
.../src/main/webapp/js/app/models/dataset.js | 262 -
.../main/webapp/js/app/models/fuseki-server.js | 180 -
.../src/main/webapp/js/app/models/task.js | 105 -
.../webapp/js/app/models/validation-options.js | 85 -
.../src/main/webapp/js/app/qonsole-config.js | 27 -
.../main/webapp/js/app/services/ping-service.js | 54 -
.../js/app/services/validation-service.js | 98 -
.../webapp/js/app/templates/dataset-edit.tpl | 58 -
.../webapp/js/app/templates/dataset-info.tpl | 40 -
.../js/app/templates/dataset-management.tpl | 62 -
.../js/app/templates/dataset-selection-list.tpl | 22 -
.../js/app/templates/dataset-selector.tpl | 15 -
.../js/app/templates/dataset-simple-create.tpl | 85 -
.../webapp/js/app/templates/dataset-stats.tpl | 14 -
.../webapp/js/app/templates/file-upload.tpl | 46 -
.../webapp/js/app/templates/uploadable-file.tpl | 23 -
.../src/main/webapp/js/app/util/page-utils.js | 33 -
.../main/webapp/js/app/views/dataset-edit.js | 205 -
.../main/webapp/js/app/views/dataset-info.js | 76 -
.../webapp/js/app/views/dataset-management.js | 173 -
.../js/app/views/dataset-selection-list.js | 58 -
.../webapp/js/app/views/dataset-selector.js | 84 -
.../js/app/views/dataset-simple-create.js | 102 -
.../main/webapp/js/app/views/dataset-stats.js | 41 -
.../js/app/views/datasets-dropdown-list.js | 43 -
.../src/main/webapp/js/app/views/file-upload.js | 225 -
.../webapp/js/app/views/tabbed-view-manager.js | 63 -
.../main/webapp/js/app/views/uploadable-file.js | 39 -
.../webapp/js/app/views/validation-options.js | 54 -
.../src/main/webapp/js/common-config.js | 94 -
.../main/webapp/js/lib/addon/fold/brace-fold.js | 105 -
.../webapp/js/lib/addon/fold/comment-fold.js | 57 -
.../main/webapp/js/lib/addon/fold/foldcode.js | 145 -
.../main/webapp/js/lib/addon/fold/foldgutter.js | 134 -
.../main/webapp/js/lib/addon/fold/xml-fold.js | 181 -
.../src/main/webapp/js/lib/backbone-min.js | 2 -
.../src/main/webapp/js/lib/backbone.js | 1581 ---
.../main/webapp/js/lib/backbone.marionette.js | 2385 -----
.../main/webapp/js/lib/bootstrap-select.min.js | 8 -
.../src/main/webapp/js/lib/bootstrap.min.js | 6 -
.../src/main/webapp/js/lib/html5shiv.js | 8 -
.../src/main/webapp/js/lib/jquery-1.10.2.js | 9789 ------------------
.../src/main/webapp/js/lib/jquery-1.10.2.min.js | 6 -
.../src/main/webapp/js/lib/jquery-ui.min.js | 7 -
.../main/webapp/js/lib/jquery.dataTables.min.js | 157 -
.../src/main/webapp/js/lib/jquery.fileupload.js | 1426 ---
.../webapp/js/lib/jquery.fileupload.local.js | 1428 ---
.../src/main/webapp/js/lib/jquery.form.js | 1278 ---
.../webapp/js/lib/jquery.iframe-transport.js | 214 -
.../src/main/webapp/js/lib/jquery.ui.widget.js | 530 -
.../main/webapp/js/lib/jquery.xdomainrequest.js | 90 -
.../src/main/webapp/js/lib/lib/codemirror.js | 7638 --------------
.../webapp/js/lib/mode/javascript/javascript.js | 683 --
.../main/webapp/js/lib/mode/sparql/sparql.js | 160 -
.../main/webapp/js/lib/mode/turtle/turtle.js | 160 -
.../src/main/webapp/js/lib/mode/xml/xml.js | 384 -
.../src/main/webapp/js/lib/pivot.js | 1363 ---
.../src/main/webapp/js/lib/pivot.min.js | 2 -
.../src/main/webapp/js/lib/pivot.min.js.map | 1 -
.../src/main/webapp/js/lib/plugins/text.js | 386 -
.../src/main/webapp/js/lib/qonsole.js | 577 --
.../src/main/webapp/js/lib/refresh.sh | 21 -
.../src/main/webapp/js/lib/require.js | 2076 ----
.../src/main/webapp/js/lib/require.min.js | 36 -
.../src/main/webapp/js/lib/respond.min.js | 6 -
.../src/main/webapp/js/lib/sprintf-0.7-beta1.js | 183 -
.../src/main/webapp/js/lib/underscore.js | 1276 ---
.../src/main/webapp/js/lib/yasqe.min.js | 9 -
.../src/main/webapp/js/lib/yasqe.min.js.map | 1 -
.../src/main/webapp/js/lib/yasr.min.js | 8 -
.../src/main/webapp/js/lib/yasr.min.js.map | 1 -
.../src/main/webapp/manage.html | 110 -
.../src/main/webapp/services.html | 76 -
.../src/main/webapp/test/test-fuseki-config.ttl | 27 -
.../src/main/webapp/validate.html | 147 -
.../apache/jena/fuseki/AbstractFusekiTest.java | 51 -
.../test/java/org/apache/jena/fuseki/Dummy.java | 23 +
.../java/org/apache/jena/fuseki/FileSender.java | 87 -
.../java/org/apache/jena/fuseki/FusekiTest.java | 101 -
.../java/org/apache/jena/fuseki/ServerCtl.java | 304 -
.../java/org/apache/jena/fuseki/ServerTest.java | 42 -
.../java/org/apache/jena/fuseki/TS_Fuseki.java | 81 -
.../java/org/apache/jena/fuseki/TestAdmin.java | 514 -
.../org/apache/jena/fuseki/TestAdminAPI.java | 120 -
.../java/org/apache/jena/fuseki/TestAuth.java | 380 -
.../org/apache/jena/fuseki/TestBuilder.java | 68 -
.../jena/fuseki/TestDatasetAccessorHTTP.java | 318 -
.../fuseki/TestDatasetGraphAccessorHTTP.java | 40 -
.../org/apache/jena/fuseki/TestDatasetOps.java | 136 -
.../org/apache/jena/fuseki/TestFileUpload.java | 124 -
.../java/org/apache/jena/fuseki/TestHttpOp.java | 198 -
.../apache/jena/fuseki/TestHttpOperations.java | 131 -
.../org/apache/jena/fuseki/TestHttpOptions.java | 56 -
.../java/org/apache/jena/fuseki/TestQuery.java | 322 -
.../apache/jena/fuseki/TestSPARQLProtocol.java | 84 -
.../apache/jena/fuseki/TestServerReadOnly.java | 134 -
jena-fuseki2/jena-fuseki-embedded/pom.xml | 152 -
.../jena/fuseki/embedded/FusekiServer.java | 597 --
.../jena/fuseki/embedded/JettyServer.java | 369 -
.../jena/fuseki/embedded/CustomService.java | 81 -
.../jena/fuseki/embedded/FusekiTestAuth.java | 191 -
.../jena/fuseki/embedded/FusekiTestServer.java | 261 -
.../jena/fuseki/embedded/TS_EmbeddedFuseki.java | 51 -
.../fuseki/embedded/TestEmbeddedFuseki.java | 321 -
.../embedded/TestFusekiCustomOperation.java | 188 -
.../fuseki/embedded/TestFusekiTestAuth.java | 98 -
.../fuseki/embedded/TestFusekiTestServer.java | 60 -
.../fuseki/embedded/TestMultipleEmbedded.java | 170 -
.../examples/ExtendFuseki_AddService_1.java | 158 -
.../examples/ExtendFuseki_AddService_2.java | 123 -
.../examples/ExtendFuseki_AddService_3.java | 107 -
.../embedded/examples/SpecialService.java | 81 -
.../src/test/resources/log4j.properties | 40 -
.../testing/FusekiEmbedded/config.ttl | 18 -
.../testing/FusekiEmbedded/test.txt | 1 -
jena-fuseki2/jena-fuseki-fulljar/pom.xml | 123 +
jena-fuseki2/jena-fuseki-main/pom.xml | 159 +
.../org/apache/jena/fuseki/main/FusekiLib.java | 74 +
.../apache/jena/fuseki/main/FusekiServer.java | 597 ++
.../apache/jena/fuseki/main/JettyServer.java | 371 +
.../jena/fuseki/main/cmds/FusekiMain.java | 498 +
.../jena/fuseki/main/cmds/FusekiMainCmd.java | 46 +
.../jena/fuseki/main/cmds/PlatformInfo.java | 135 +
.../jena/fuseki/main/cmds/ServerConfig.java | 51 +
.../apache/jena/fuseki/main/CustomService.java | 81 +
.../apache/jena/fuseki/main/FusekiTestAuth.java | 178 +
.../jena/fuseki/main/FusekiTestServer.java | 261 +
.../jena/fuseki/main/TS_EmbeddedFuseki.java | 51 +
.../jena/fuseki/main/TestEmbeddedFuseki.java | 334 +
.../fuseki/main/TestFusekiCustomOperation.java | 188 +
.../jena/fuseki/main/TestFusekiTestAuth.java | 98 +
.../jena/fuseki/main/TestFusekiTestServer.java | 60 +
.../jena/fuseki/main/TestMultipleEmbedded.java | 170 +
.../examples/ExtendFuseki_AddService_1.java | 158 +
.../examples/ExtendFuseki_AddService_2.java | 123 +
.../examples/ExtendFuseki_AddService_3.java | 107 +
.../fuseki/main/examples/SpecialService.java | 81 +
.../src/test/resources/log4j.properties | 40 +
.../testing/FusekiEmbedded/config.ttl | 18 +
.../testing/FusekiEmbedded/test.txt | 1 +
jena-fuseki2/jena-fuseki-server/.gitignore | 1 -
jena-fuseki2/jena-fuseki-server/pom.xml | 31 +-
jena-fuseki2/jena-fuseki-war/pom.xml | 8 +-
jena-fuseki2/jena-fuseki-webapp/fuseki-dev | 105 +
jena-fuseki2/jena-fuseki-webapp/pom.xml | 199 +
.../fuseki/authz/AuthorizationFilter403.java | 59 +
.../apache/jena/fuseki/authz/DenyFilter.java | 33 +
.../jena/fuseki/authz/LocalhostFilter.java | 62 +
.../org/apache/jena/fuseki/cmd/FusekiCmd.java | 377 +
.../org/apache/jena/fuseki/cmd/JettyFuseki.java | 325 +
.../apache/jena/fuseki/mgt/ActionBackup.java | 67 +
.../jena/fuseki/mgt/ActionBackupList.java | 95 +
.../apache/jena/fuseki/mgt/ActionDatasets.java | 523 +
.../org/apache/jena/fuseki/mgt/ActionLogs.java | 60 +
.../jena/fuseki/mgt/ActionServerStatus.java | 117 +
.../java/org/apache/jena/fuseki/mgt/Backup.java | 131 +
.../org/apache/jena/fuseki/mgt/DumpServlet.java | 300 +
.../apache/jena/fuseki/mgt/ServerMgtConst.java | 39 +
.../org/apache/jena/fuseki/mgt/Template.java | 70 +
.../jena/fuseki/mgt/TemplateFunctions.java | 86 +
.../apache/jena/fuseki/webapp/FusekiEnv.java | 168 +
.../webapp/FusekiServerEnvironmentInit.java | 54 +
.../fuseki/webapp/FusekiServerListener.java | 107 +
.../apache/jena/fuseki/webapp/FusekiSystem.java | 472 +
.../fuseki/webapp/ShiroEnvironmentLoader.java | 163 +
.../apache/jena/fuseki/webapp/SystemState.java | 96 +
.../src/main/resources/META-INF/DEPENDENCIES | 24 +
.../src/main/resources/META-INF/LICENSE | 253 +
.../src/main/resources/META-INF/NOTICE | 16 +
.../apache/jena/fuseki/fuseki-properties.xml | 8 +
.../org/apache/jena/fuseki/log4j.properties | 40 +
.../org/apache/jena/fuseki/webapp/config.ttl | 30 +
.../org/apache/jena/fuseki/webapp/shiro.ini | 37 +
.../jena/fuseki/webapp/templates/config-mem | 27 +
.../jena/fuseki/webapp/templates/config-service | 23 +
.../jena/fuseki/webapp/templates/config-tdb | 31 +
.../jena/fuseki/webapp/templates/config-tdb-dir | 30 +
.../jena/fuseki/webapp/templates/config-tdb-mem | 30 +
.../jena/fuseki/webapp/templates/config-tdb2 | 31 +
.../fuseki/webapp/templates/config-tdb2-dir | 30 +
.../fuseki/webapp/templates/config-tdb2-mem | 30 +
.../src/main/webapp/WEB-INF/web.xml | 326 +
.../src/main/webapp/admin-logs.html | 73 +
.../main/webapp/css/bootstrap-select.min.css | 7 +
.../src/main/webapp/css/bootstrap-theme.css.map | 1 +
.../src/main/webapp/css/bootstrap-theme.min.css | 7 +
.../src/main/webapp/css/bootstrap.css.map | 1 +
.../src/main/webapp/css/bootstrap.min.css | 7 +
.../src/main/webapp/css/codemirror.css | 301 +
.../src/main/webapp/css/codemirror.min.css | 1 +
.../src/main/webapp/css/font-awesome.min.css | 4 +
.../src/main/webapp/css/fui.css | 191 +
.../src/main/webapp/css/jquery.dataTables.css | 220 +
.../webapp/css/jquery.fileupload-noscript.css | 22 +
.../css/jquery.fileupload-ui-noscript.css | 17 +
.../main/webapp/css/jquery.fileupload-ui.css | 57 +
.../src/main/webapp/css/jquery.fileupload.css | 36 +
.../src/main/webapp/css/pivot.min.css | 1 +
.../src/main/webapp/css/qonsole.css | 172 +
.../src/main/webapp/css/yasqe.min.css | 1 +
.../src/main/webapp/css/yasr.min.css | 1 +
.../src/main/webapp/dataset.html | 247 +
.../src/main/webapp/documentation.html | 83 +
.../src/main/webapp/fonts/FontAwesome.otf | Bin 0 -> 75188 bytes
.../main/webapp/fonts/fontawesome-webfont.eot | Bin 0 -> 72449 bytes
.../main/webapp/fonts/fontawesome-webfont.svg | 504 +
.../main/webapp/fonts/fontawesome-webfont.ttf | Bin 0 -> 141564 bytes
.../main/webapp/fonts/fontawesome-webfont.woff | Bin 0 -> 83760 bytes
.../fonts/glyphicons-halflings-regular.eot | Bin 0 -> 20335 bytes
.../fonts/glyphicons-halflings-regular.svg | 229 +
.../fonts/glyphicons-halflings-regular.ttf | Bin 0 -> 41280 bytes
.../fonts/glyphicons-halflings-regular.woff | Bin 0 -> 23320 bytes
.../src/main/webapp/images/back_disabled.png | Bin 0 -> 1361 bytes
.../src/main/webapp/images/back_enabled.png | Bin 0 -> 1379 bytes
.../main/webapp/images/back_enabled_hover.png | Bin 0 -> 1375 bytes
.../src/main/webapp/images/favicon.ico | Bin 0 -> 1085 bytes
.../src/main/webapp/images/forward_disabled.png | Bin 0 -> 1363 bytes
.../src/main/webapp/images/forward_enabled.png | Bin 0 -> 1380 bytes
.../webapp/images/forward_enabled_hover.png | Bin 0 -> 1379 bytes
.../webapp/images/jena-logo-notext-small.png | Bin 0 -> 2469 bytes
.../src/main/webapp/images/sort_asc.png | Bin 0 -> 1118 bytes
.../main/webapp/images/sort_asc_disabled.png | Bin 0 -> 1050 bytes
.../src/main/webapp/images/sort_both.png | Bin 0 -> 1136 bytes
.../src/main/webapp/images/sort_desc.png | Bin 0 -> 1127 bytes
.../main/webapp/images/sort_desc_disabled.png | Bin 0 -> 1045 bytes
.../src/main/webapp/images/wait30.gif | Bin 0 -> 6337 bytes
.../src/main/webapp/index.html | 101 +
.../js/app/controllers/dataset-controller.js | 69 +
.../js/app/controllers/index-controller.js | 50 +
.../js/app/controllers/manage-controller.js | 39 +
.../js/app/controllers/query-controller.js | 72 +
.../js/app/controllers/upload-controller.js | 42 +
.../js/app/controllers/validation-controller.js | 38 +
.../src/main/webapp/js/app/fui.js | 33 +
.../src/main/webapp/js/app/main.dataset.js | 31 +
.../src/main/webapp/js/app/main.index.js | 24 +
.../src/main/webapp/js/app/main.manage.js | 27 +
.../src/main/webapp/js/app/main.validation.js | 24 +
.../main/webapp/js/app/models/dataset-stats.js | 102 +
.../src/main/webapp/js/app/models/dataset.js | 262 +
.../main/webapp/js/app/models/fuseki-server.js | 180 +
.../src/main/webapp/js/app/models/task.js | 105 +
.../webapp/js/app/models/validation-options.js | 85 +
.../src/main/webapp/js/app/qonsole-config.js | 27 +
.../main/webapp/js/app/services/ping-service.js | 54 +
.../js/app/services/validation-service.js | 98 +
.../webapp/js/app/templates/dataset-edit.tpl | 58 +
.../webapp/js/app/templates/dataset-info.tpl | 40 +
.../js/app/templates/dataset-management.tpl | 62 +
.../js/app/templates/dataset-selection-list.tpl | 22 +
.../js/app/templates/dataset-selector.tpl | 15 +
.../js/app/templates/dataset-simple-create.tpl | 85 +
.../webapp/js/app/templates/dataset-stats.tpl | 14 +
.../webapp/js/app/templates/file-upload.tpl | 46 +
.../webapp/js/app/templates/uploadable-file.tpl | 23 +
.../src/main/webapp/js/app/util/page-utils.js | 33 +
.../main/webapp/js/app/views/dataset-edit.js | 205 +
.../main/webapp/js/app/views/dataset-info.js | 76 +
.../webapp/js/app/views/dataset-management.js | 173 +
.../js/app/views/dataset-selection-list.js | 58 +
.../webapp/js/app/views/dataset-selector.js | 84 +
.../js/app/views/dataset-simple-create.js | 102 +
.../main/webapp/js/app/views/dataset-stats.js | 41 +
.../js/app/views/datasets-dropdown-list.js | 43 +
.../src/main/webapp/js/app/views/file-upload.js | 225 +
.../webapp/js/app/views/tabbed-view-manager.js | 63 +
.../main/webapp/js/app/views/uploadable-file.js | 39 +
.../webapp/js/app/views/validation-options.js | 54 +
.../src/main/webapp/js/common-config.js | 94 +
.../main/webapp/js/lib/addon/fold/brace-fold.js | 105 +
.../webapp/js/lib/addon/fold/comment-fold.js | 57 +
.../main/webapp/js/lib/addon/fold/foldcode.js | 145 +
.../main/webapp/js/lib/addon/fold/foldgutter.js | 134 +
.../main/webapp/js/lib/addon/fold/xml-fold.js | 181 +
.../src/main/webapp/js/lib/backbone-min.js | 2 +
.../src/main/webapp/js/lib/backbone.js | 1581 +++
.../main/webapp/js/lib/backbone.marionette.js | 2385 +++++
.../main/webapp/js/lib/bootstrap-select.min.js | 8 +
.../src/main/webapp/js/lib/bootstrap.min.js | 6 +
.../src/main/webapp/js/lib/html5shiv.js | 8 +
.../src/main/webapp/js/lib/jquery-1.10.2.js | 9789 ++++++++++++++++++
.../src/main/webapp/js/lib/jquery-1.10.2.min.js | 6 +
.../src/main/webapp/js/lib/jquery-ui.min.js | 7 +
.../main/webapp/js/lib/jquery.dataTables.min.js | 157 +
.../src/main/webapp/js/lib/jquery.fileupload.js | 1426 +++
.../webapp/js/lib/jquery.fileupload.local.js | 1428 +++
.../src/main/webapp/js/lib/jquery.form.js | 1278 +++
.../webapp/js/lib/jquery.iframe-transport.js | 214 +
.../src/main/webapp/js/lib/jquery.ui.widget.js | 530 +
.../main/webapp/js/lib/jquery.xdomainrequest.js | 90 +
.../src/main/webapp/js/lib/lib/codemirror.js | 7638 ++++++++++++++
.../webapp/js/lib/mode/javascript/javascript.js | 683 ++
.../main/webapp/js/lib/mode/sparql/sparql.js | 160 +
.../main/webapp/js/lib/mode/turtle/turtle.js | 160 +
.../src/main/webapp/js/lib/mode/xml/xml.js | 384 +
.../src/main/webapp/js/lib/pivot.js | 1363 +++
.../src/main/webapp/js/lib/pivot.min.js | 2 +
.../src/main/webapp/js/lib/pivot.min.js.map | 1 +
.../src/main/webapp/js/lib/plugins/text.js | 386 +
.../src/main/webapp/js/lib/qonsole.js | 577 ++
.../src/main/webapp/js/lib/refresh.sh | 21 +
.../src/main/webapp/js/lib/require.js | 2076 ++++
.../src/main/webapp/js/lib/require.min.js | 36 +
.../src/main/webapp/js/lib/respond.min.js | 6 +
.../src/main/webapp/js/lib/sprintf-0.7-beta1.js | 183 +
.../src/main/webapp/js/lib/underscore.js | 1276 +++
.../src/main/webapp/js/lib/yasqe.min.js | 9 +
.../src/main/webapp/js/lib/yasqe.min.js.map | 1 +
.../src/main/webapp/js/lib/yasr.min.js | 8 +
.../src/main/webapp/js/lib/yasr.min.js.map | 1 +
.../src/main/webapp/manage.html | 110 +
.../src/main/webapp/services.html | 76 +
.../src/main/webapp/test/test-fuseki-config.ttl | 27 +
.../src/main/webapp/validate.html | 147 +
.../apache/jena/fuseki/AbstractFusekiTest.java | 51 +
.../java/org/apache/jena/fuseki/FileSender.java | 87 +
.../java/org/apache/jena/fuseki/FusekiTest.java | 101 +
.../java/org/apache/jena/fuseki/ServerCtl.java | 305 +
.../java/org/apache/jena/fuseki/ServerTest.java | 42 +
.../java/org/apache/jena/fuseki/TS_Fuseki.java | 81 +
.../java/org/apache/jena/fuseki/TestAdmin.java | 514 +
.../org/apache/jena/fuseki/TestAdminAPI.java | 126 +
.../java/org/apache/jena/fuseki/TestAuth.java | 379 +
.../org/apache/jena/fuseki/TestBuilder.java | 68 +
.../jena/fuseki/TestDatasetAccessorHTTP.java | 318 +
.../fuseki/TestDatasetGraphAccessorHTTP.java | 40 +
.../org/apache/jena/fuseki/TestDatasetOps.java | 136 +
.../org/apache/jena/fuseki/TestFileUpload.java | 124 +
.../java/org/apache/jena/fuseki/TestHttpOp.java | 198 +
.../apache/jena/fuseki/TestHttpOperations.java | 131 +
.../org/apache/jena/fuseki/TestHttpOptions.java | 56 +
.../java/org/apache/jena/fuseki/TestQuery.java | 322 +
.../apache/jena/fuseki/TestSPARQLProtocol.java | 84 +
.../apache/jena/fuseki/TestServerReadOnly.java | 134 +
.../jena-fuseki-webapp/testing/config-ds-1.ttl | 15 +
.../testing/config-ds-bad-name-1.ttl | 15 +
.../testing/config-ds-bad-name-2.ttl | 15 +
.../testing/config-ds-bad-name-3.ttl | 15 +
.../testing/config-ds-bad-name-4.ttl | 15 +
jena-fuseki2/pom.xml | 16 +-
jena-integration-tests/pom.xml | 26 +-
.../TestRDFConnectionFusekiBinary.java | 11 +-
.../rdfconnection/TestRDFConnectionRemote.java | 6 +-
jena-iri/pom.xml | 4 +-
jena-jdbc/jena-jdbc-core/pom.xml | 4 +-
jena-jdbc/jena-jdbc-driver-bundle/pom.xml | 27 +-
jena-jdbc/jena-jdbc-driver-mem/pom.xml | 6 +-
jena-jdbc/jena-jdbc-driver-remote/pom.xml | 14 +-
.../jena/jdbc/remote/TS_JdbcDriverRemote.java | 2 +-
.../TestRemoteEndpointConnection.java | 2 +-
.../TestRemoteEndpointConnectionWithAuth.java | 2 +-
...stRemoteEndpointConnectionWithGraphUris.java | 2 +-
...oteEndpointConnectionWithResultSetTypes.java | 2 +-
.../metadata/TestRemoteConnectionMetadata.java | 2 +-
.../results/TestRemoteEndpointResults.java | 2 +-
.../TestRemoteEndpointResultsWithAuth.java | 2 +-
.../TestRemoteEndpointResultsWithGraphUris.java | 2 +-
...RemoteEndpointResultsWithResultSetTypes.java | 2 +-
.../TestRemoteEndpointStatements.java | 2 +-
jena-jdbc/jena-jdbc-driver-tdb/pom.xml | 10 +-
jena-jdbc/pom.xml | 4 +-
jena-permissions/pom.xml | 4 +-
jena-rdfconnection/pom.xml | 12 +-
.../jena/rdfconnection/RDFConnectionRemote.java | 74 +-
jena-sdb/pom.xml | 14 +-
jena-shaded-guava/pom.xml | 4 +-
jena-spatial/pom.xml | 10 +-
.../src/main/java/jena/spatialindexer.java | 17 +-
.../jena/query/spatial/SpatialIndexContext.java | 6 +-
jena-tdb/pom.xml | 12 +-
jena-text-es/pom.xml | 8 +-
jena-text/pom.xml | 10 +-
pom.xml | 26 +-
604 files changed, 54793 insertions(+), 64406 deletions(-)
----------------------------------------------------------------------
[3/8] jena git commit: added license and removed dead code
Posted by cl...@apache.org.
added license and removed dead code
Project: http://git-wip-us.apache.org/repos/asf/jena/repo
Commit: http://git-wip-us.apache.org/repos/asf/jena/commit/27691564
Tree: http://git-wip-us.apache.org/repos/asf/jena/tree/27691564
Diff: http://git-wip-us.apache.org/repos/asf/jena/diff/27691564
Branch: refs/heads/master
Commit: 27691564775e52da291e3ae18c8b5989415ea9b8
Parents: 311843d
Author: Claude Warren <cl...@xenei.com>
Authored: Sun Oct 7 15:09:56 2018 +0100
Committer: Claude Warren <cl...@xenei.com>
Committed: Sun Oct 7 15:09:56 2018 +0100
----------------------------------------------------------------------
.../updatebuilder/CollectionQuadHolderTest.java | 24 ++++++++++++++------
.../updatebuilder/ModelQuadHolderTest.java | 18 ++++++++++++++-
.../updatebuilder/QBQuadHolderTest.java | 18 ++++++++++++++-
.../updatebuilder/SingleQuadHolderTest.java | 20 +++++++++++++---
.../updatebuilder/WhereQuadHolderTest.java | 20 +++++++++++++---
5 files changed, 85 insertions(+), 15 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/jena/blob/27691564/jena-extras/jena-querybuilder/src/test/java/org/apache/jena/arq/querybuilder/updatebuilder/CollectionQuadHolderTest.java
----------------------------------------------------------------------
diff --git a/jena-extras/jena-querybuilder/src/test/java/org/apache/jena/arq/querybuilder/updatebuilder/CollectionQuadHolderTest.java b/jena-extras/jena-querybuilder/src/test/java/org/apache/jena/arq/querybuilder/updatebuilder/CollectionQuadHolderTest.java
index d088f04..38be596 100644
--- a/jena-extras/jena-querybuilder/src/test/java/org/apache/jena/arq/querybuilder/updatebuilder/CollectionQuadHolderTest.java
+++ b/jena-extras/jena-querybuilder/src/test/java/org/apache/jena/arq/querybuilder/updatebuilder/CollectionQuadHolderTest.java
@@ -1,12 +1,26 @@
+/*
+ * 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.
+ */
package org.apache.jena.arq.querybuilder.updatebuilder;
import static org.junit.Assert.assertEquals;
import java.util.ArrayList;
-import java.util.Collection;
import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
import java.util.List;
import java.util.Map;
@@ -15,8 +29,6 @@ import org.apache.jena.graph.NodeFactory;
import org.apache.jena.graph.Triple;
import org.apache.jena.sparql.core.Quad;
import org.apache.jena.sparql.core.Var;
-import org.apache.jena.util.iterator.ExtendedIterator;
-import org.apache.jena.util.iterator.WrappedIterator;
import org.junit.Test;
public class CollectionQuadHolderTest {
@@ -138,7 +150,6 @@ public class CollectionQuadHolderTest {
@Test
public void anonymousGraphTest_List()
{
- Node g = NodeFactory.createURI( "g" );
List<Triple> tLst = new ArrayList<Triple>();
Node s = NodeFactory.createURI( "s" );
@@ -192,7 +203,6 @@ public class CollectionQuadHolderTest {
@Test
public void anonymousGraphTest_Iterator()
{
- Node g = NodeFactory.createURI( "g" );
List<Triple> tLst = new ArrayList<Triple>();
Node s = NodeFactory.createURI( "s" );
http://git-wip-us.apache.org/repos/asf/jena/blob/27691564/jena-extras/jena-querybuilder/src/test/java/org/apache/jena/arq/querybuilder/updatebuilder/ModelQuadHolderTest.java
----------------------------------------------------------------------
diff --git a/jena-extras/jena-querybuilder/src/test/java/org/apache/jena/arq/querybuilder/updatebuilder/ModelQuadHolderTest.java b/jena-extras/jena-querybuilder/src/test/java/org/apache/jena/arq/querybuilder/updatebuilder/ModelQuadHolderTest.java
index 16a6204..c061f96 100644
--- a/jena-extras/jena-querybuilder/src/test/java/org/apache/jena/arq/querybuilder/updatebuilder/ModelQuadHolderTest.java
+++ b/jena-extras/jena-querybuilder/src/test/java/org/apache/jena/arq/querybuilder/updatebuilder/ModelQuadHolderTest.java
@@ -1,3 +1,20 @@
+/*
+ * 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.
+ */
package org.apache.jena.arq.querybuilder.updatebuilder;
import static org.junit.Assert.assertEquals;
@@ -12,7 +29,6 @@ import org.apache.jena.graph.Triple;
import org.apache.jena.rdf.model.Model;
import org.apache.jena.rdf.model.ModelFactory;
import org.apache.jena.rdf.model.Property;
-import org.apache.jena.rdf.model.RDFNode;
import org.apache.jena.rdf.model.Resource;
import org.apache.jena.rdf.model.ResourceFactory;
import org.apache.jena.sparql.core.Quad;
http://git-wip-us.apache.org/repos/asf/jena/blob/27691564/jena-extras/jena-querybuilder/src/test/java/org/apache/jena/arq/querybuilder/updatebuilder/QBQuadHolderTest.java
----------------------------------------------------------------------
diff --git a/jena-extras/jena-querybuilder/src/test/java/org/apache/jena/arq/querybuilder/updatebuilder/QBQuadHolderTest.java b/jena-extras/jena-querybuilder/src/test/java/org/apache/jena/arq/querybuilder/updatebuilder/QBQuadHolderTest.java
index e071aa3..2939858 100644
--- a/jena-extras/jena-querybuilder/src/test/java/org/apache/jena/arq/querybuilder/updatebuilder/QBQuadHolderTest.java
+++ b/jena-extras/jena-querybuilder/src/test/java/org/apache/jena/arq/querybuilder/updatebuilder/QBQuadHolderTest.java
@@ -1,3 +1,20 @@
+/*
+ * 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.
+ */
package org.apache.jena.arq.querybuilder.updatebuilder;
import static org.junit.Assert.assertEquals;
@@ -7,7 +24,6 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
-import org.apache.jena.arq.querybuilder.AbstractQueryBuilder;
import org.apache.jena.arq.querybuilder.WhereBuilder;
import org.apache.jena.graph.Node;
import org.apache.jena.graph.NodeFactory;
http://git-wip-us.apache.org/repos/asf/jena/blob/27691564/jena-extras/jena-querybuilder/src/test/java/org/apache/jena/arq/querybuilder/updatebuilder/SingleQuadHolderTest.java
----------------------------------------------------------------------
diff --git a/jena-extras/jena-querybuilder/src/test/java/org/apache/jena/arq/querybuilder/updatebuilder/SingleQuadHolderTest.java b/jena-extras/jena-querybuilder/src/test/java/org/apache/jena/arq/querybuilder/updatebuilder/SingleQuadHolderTest.java
index 4c170ea..81748d6 100644
--- a/jena-extras/jena-querybuilder/src/test/java/org/apache/jena/arq/querybuilder/updatebuilder/SingleQuadHolderTest.java
+++ b/jena-extras/jena-querybuilder/src/test/java/org/apache/jena/arq/querybuilder/updatebuilder/SingleQuadHolderTest.java
@@ -1,3 +1,20 @@
+/*
+ * 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.
+ */
package org.apache.jena.arq.querybuilder.updatebuilder;
import static org.junit.Assert.assertEquals;
@@ -6,14 +23,11 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
-import org.apache.jena.arq.querybuilder.AbstractQueryBuilder;
import org.apache.jena.graph.Node;
import org.apache.jena.graph.NodeFactory;
import org.apache.jena.graph.Triple;
import org.apache.jena.sparql.core.Quad;
import org.apache.jena.sparql.core.Var;
-import org.apache.jena.util.iterator.ExtendedIterator;
-import org.apache.jena.util.iterator.SingletonIterator;
import org.junit.Test;
public class SingleQuadHolderTest {
http://git-wip-us.apache.org/repos/asf/jena/blob/27691564/jena-extras/jena-querybuilder/src/test/java/org/apache/jena/arq/querybuilder/updatebuilder/WhereQuadHolderTest.java
----------------------------------------------------------------------
diff --git a/jena-extras/jena-querybuilder/src/test/java/org/apache/jena/arq/querybuilder/updatebuilder/WhereQuadHolderTest.java b/jena-extras/jena-querybuilder/src/test/java/org/apache/jena/arq/querybuilder/updatebuilder/WhereQuadHolderTest.java
index a663339..8ba810a 100644
--- a/jena-extras/jena-querybuilder/src/test/java/org/apache/jena/arq/querybuilder/updatebuilder/WhereQuadHolderTest.java
+++ b/jena-extras/jena-querybuilder/src/test/java/org/apache/jena/arq/querybuilder/updatebuilder/WhereQuadHolderTest.java
@@ -1,3 +1,20 @@
+/*
+ * 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.
+ */
package org.apache.jena.arq.querybuilder.updatebuilder;
import static org.junit.Assert.assertEquals;
@@ -7,8 +24,6 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
-import org.apache.jena.arq.querybuilder.AbstractQueryBuilder;
-import org.apache.jena.arq.querybuilder.WhereBuilder;
import org.apache.jena.arq.querybuilder.handlers.WhereHandler;
import org.apache.jena.graph.Node;
import org.apache.jena.graph.NodeFactory;
@@ -17,7 +32,6 @@ import org.apache.jena.sparql.core.Quad;
import org.apache.jena.sparql.core.TriplePath;
import org.apache.jena.sparql.core.Var;
import org.apache.jena.sparql.path.P_Link;
-import org.apache.jena.sparql.path.Path;
import org.junit.Test;
public class WhereQuadHolderTest {
[4/8] jena git commit: removed .gitignore accidentally checked in.
Posted by cl...@apache.org.
removed .gitignore accidentally checked in.
Project: http://git-wip-us.apache.org/repos/asf/jena/repo
Commit: http://git-wip-us.apache.org/repos/asf/jena/commit/bb9c9995
Tree: http://git-wip-us.apache.org/repos/asf/jena/tree/bb9c9995
Diff: http://git-wip-us.apache.org/repos/asf/jena/diff/bb9c9995
Branch: refs/heads/master
Commit: bb9c99950c3b27c47e26978ac0cdea417822b41c
Parents: 2769156
Author: Claude Warren <cl...@xenei.com>
Authored: Fri Oct 12 21:25:36 2018 +0100
Committer: Claude Warren <cl...@xenei.com>
Committed: Fri Oct 12 21:25:36 2018 +0100
----------------------------------------------------------------------
jena-extras/jena-querybuilder/.gitignore | 1 -
1 file changed, 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/jena/blob/bb9c9995/jena-extras/jena-querybuilder/.gitignore
----------------------------------------------------------------------
diff --git a/jena-extras/jena-querybuilder/.gitignore b/jena-extras/jena-querybuilder/.gitignore
deleted file mode 100644
index d86b3db..0000000
--- a/jena-extras/jena-querybuilder/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-/.project_old
[5/8] jena git commit: Merge remote-tracking branch 'claude/master'
into 1602-fix
Posted by cl...@apache.org.
Merge remote-tracking branch 'claude/master' into 1602-fix
Project: http://git-wip-us.apache.org/repos/asf/jena/repo
Commit: http://git-wip-us.apache.org/repos/asf/jena/commit/d6dc5cd8
Tree: http://git-wip-us.apache.org/repos/asf/jena/tree/d6dc5cd8
Diff: http://git-wip-us.apache.org/repos/asf/jena/diff/d6dc5cd8
Branch: refs/heads/master
Commit: d6dc5cd870ff650e1e7b70d24372f763211afe5b
Parents: bb9c999 1f5eddd
Author: Claude Warren <cl...@xenei.com>
Authored: Fri Oct 12 21:32:56 2018 +0100
Committer: Claude Warren <cl...@xenei.com>
Committed: Fri Oct 12 21:32:56 2018 +0100
----------------------------------------------------------------------
.../main/java/org/apache/jena/query/ARQ.java | 2 +-
.../org/apache/jena/sparql/lib/Metadata.java | 111 -----------------
.../java/org/apache/jena/atlas/lib/Timer.java | 18 ++-
jena-cmds/src/main/java/arq/cmdline/CmdARQ.java | 6 +-
jena-cmds/src/main/java/tdb2/tdbloader.java | 31 ++++-
.../java/org/apache/jena/util/Metadata.java | 118 ++++++++++---------
.../jena/dboe/base/file/BlockAccessBase.java | 1 +
.../dboe/trans/data/TransBinaryDataFile.java | 1 +
.../main/java/org/apache/jena/tdb2/TDB2.java | 2 +-
.../apache/jena/tdb2/loader/LoaderFactory.java | 21 ++++
.../jena/tdb2/loader/base/LoaderBase.java | 54 +++++++--
.../apache/jena/tdb2/loader/base/LoaderOps.java | 11 +-
.../jena/tdb2/loader/base/ProgressMonitor.java | 19 ++-
.../tdb2/loader/base/ProgressMonitorBasic.java | 48 +++++++-
.../loader/base/ProgressMonitorContext.java | 61 ++++++++++
.../tdb2/loader/base/ProgressMonitorOutput.java | 108 +++++++++++++----
.../tdb2/loader/base/ProgressStreamRDF.java | 16 ---
.../jena/tdb2/loader/basic/LoaderBasic.java | 6 +-
.../jena/tdb2/loader/main/DataToTuples.java | 4 +-
.../tdb2/loader/main/DataToTuplesInline.java | 2 +-
.../jena/tdb2/loader/main/InputStage.java | 2 +-
.../jena/tdb2/loader/main/LoaderMain.java | 16 +--
.../jena/tdb2/loader/main/LoaderPlans.java | 21 ++++
.../sequential/BuilderSecondaryIndexes.java | 16 +--
.../loader/sequential/LoaderSequential.java | 8 +-
.../apache/jena/tdb2/loader/TestLoaderMain.java | 1 +
.../apache/jena/tdb2/loader/TestLoaderStd.java | 3 +
.../java/org/apache/jena/fuseki/Fuseki.java | 2 +-
.../java/org/apache/jena/fuseki/Fuseki.java | 2 +-
jena-fuseki2/jena-fuseki-main/pom.xml | 7 ++
.../jena/fuseki/main/cmds/FusekiMain.java | 2 +-
.../src/main/java/org/apache/jena/sdb/SDB.java | 2 +-
.../apache/jena/query/spatial/SpatialQuery.java | 5 +-
.../src/main/java/org/apache/jena/tdb/TDB.java | 2 +-
.../org/apache/jena/query/text/TextQuery.java | 2 +-
35 files changed, 453 insertions(+), 278 deletions(-)
----------------------------------------------------------------------
[8/8] jena git commit: removed unused code
Posted by cl...@apache.org.
removed unused code
Project: http://git-wip-us.apache.org/repos/asf/jena/repo
Commit: http://git-wip-us.apache.org/repos/asf/jena/commit/4702f974
Tree: http://git-wip-us.apache.org/repos/asf/jena/tree/4702f974
Diff: http://git-wip-us.apache.org/repos/asf/jena/diff/4702f974
Branch: refs/heads/master
Commit: 4702f9742c220ce505acf66ecdeeb8a302a1d8a7
Parents: 3dfdfa8
Author: Claude Warren <cl...@xenei.com>
Authored: Sun Oct 14 11:29:39 2018 +0100
Committer: Claude Warren <cl...@xenei.com>
Committed: Sun Oct 14 11:29:39 2018 +0100
----------------------------------------------------------------------
.../updatebuilder/CollectionQuadHolderTest.java | 86 --------------------
1 file changed, 86 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/jena/blob/4702f974/jena-extras/jena-querybuilder/src/test/java/org/apache/jena/arq/querybuilder/updatebuilder/CollectionQuadHolderTest.java
----------------------------------------------------------------------
diff --git a/jena-extras/jena-querybuilder/src/test/java/org/apache/jena/arq/querybuilder/updatebuilder/CollectionQuadHolderTest.java b/jena-extras/jena-querybuilder/src/test/java/org/apache/jena/arq/querybuilder/updatebuilder/CollectionQuadHolderTest.java
index 38be596..c822ab4 100644
--- a/jena-extras/jena-querybuilder/src/test/java/org/apache/jena/arq/querybuilder/updatebuilder/CollectionQuadHolderTest.java
+++ b/jena-extras/jena-querybuilder/src/test/java/org/apache/jena/arq/querybuilder/updatebuilder/CollectionQuadHolderTest.java
@@ -251,90 +251,4 @@ public class CollectionQuadHolderTest {
assertEquals( new Quad( Quad.defaultGraphNodeGenerated, aLst.get(0)), lst.get(0));
assertEquals( new Quad( Quad.defaultGraphNodeGenerated, aLst.get(1)), lst.get(1));
}
-
-// @Test
-// public void anonymousGraphTest_var()
-// {
-// Node g = NodeFactory.createURI( "g" );
-// Node s = NodeFactory.createURI( "s" );
-// Node p = NodeFactory.createVariable( "p" );
-// Node o = NodeFactory.createURI( "o" );
-// Triple triple = new Triple( s, p, o );
-// Quad quad = new Quad( Quad.defaultGraphNodeGenerated, s, p, o );
-// holder = new SingleQuadHolder( triple );
-// List<Quad> lst = holder.getQuads().toList();
-// assertEquals( 1, lst.size() );
-// assertEquals( quad, lst.get(0));
-//
-// Map<Var,Node> map = new HashMap<>();
-// Node p2 = NodeFactory.createURI( "p2" );
-// map.put( Var.alloc(p), p2);
-// holder.setValues( map );
-// Quad quad2 = new Quad( Quad.defaultGraphNodeGenerated, s, p2, o );
-// lst = holder.getQuads().toList();
-// assertEquals( 1, lst.size() );
-// assertEquals( quad2, lst.get(0));
-//
-// /**
-// * Constructor.
-// *
-// * @param graph
-// * the default graph name for the triples
-// * @param triples
-// * the collection of triples.
-// */
-// public CollectionQuadHolder(final Node graph, Collection<Triple> triples) {
-// this.collection = new HashSet<Triple>();
-// this.collection.addAll( triples );
-// defaultGraphName = graph;
-// }
-//
-// /**
-// * Constructor.
-// *
-// * @param graph
-// * the default graph name for the triples
-// * @param triples
-// * the iterator of triples.
-// */
-// public CollectionQuadHolder(final Node graph, Iterator<Triple> triples) {
-// this.collection = WrappedIterator.create( triples ).toSet();
-// defaultGraphName = graph;
-// }
-//
-// /**
-// * Constructor. Uses Quad.defaultGraphNodeGenerated for the graph name.
-// *
-// * @see Quad#defaultGraphNodeGenerated
-// * @param triples
-// * the collection of triples.
-// */
-// public CollectionQuadHolder(final Collection<Triple> triples) {
-// this( Quad.defaultGraphNodeGenerated, triples );
-// }
-//
-// /**
-// * Constructor.
-// *
-// * @param triples
-// * the iterator of triples.
-// */
-// public CollectionQuadHolder(Iterator<Triple> triples) {
-// this.collection = WrappedIterator.create( triples ).toSet();
-// defaultGraphName = Quad.defaultGraphNodeGenerated;
-// }
-//
-// @Override
-// public ExtendedIterator<Quad> getQuads() {
-// return WrappedIterator.create(collection.iterator())
-// .mapWith( triple -> new Quad( defaultGraphName, triple ) );
-// }
-//
-// /**
-// * This implementation does nothing.
-// */
-// @Override
-// public QuadHolder setValues(final Map<Var, Node> values) {
-// return this;
-// }
}