You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commonsrdf.apache.org by st...@apache.org on 2016/11/04 00:56:30 UTC

[1/3] incubator-commonsrdf git commit: rdf4j close getGraphNames() within stream

Repository: incubator-commonsrdf
Updated Branches:
  refs/heads/master 99279a135 -> 30dda0825


rdf4j close getGraphNames() within stream


Project: http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/commit/16c585c4
Tree: http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/tree/16c585c4
Diff: http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/diff/16c585c4

Branch: refs/heads/master
Commit: 16c585c44672be9e742abfcb2174a11421b55ed5
Parents: 99279a1
Author: Stian Soiland-Reyes <st...@apache.org>
Authored: Fri Nov 4 00:55:24 2016 +0000
Committer: Stian Soiland-Reyes <st...@apache.org>
Committed: Fri Nov 4 00:55:24 2016 +0000

----------------------------------------------------------------------
 .../commons/rdf/rdf4j/impl/RepositoryDatasetImpl.java   | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/blob/16c585c4/rdf4j/src/main/java/org/apache/commons/rdf/rdf4j/impl/RepositoryDatasetImpl.java
----------------------------------------------------------------------
diff --git a/rdf4j/src/main/java/org/apache/commons/rdf/rdf4j/impl/RepositoryDatasetImpl.java b/rdf4j/src/main/java/org/apache/commons/rdf/rdf4j/impl/RepositoryDatasetImpl.java
index 8c266a9..1d30769 100644
--- a/rdf4j/src/main/java/org/apache/commons/rdf/rdf4j/impl/RepositoryDatasetImpl.java
+++ b/rdf4j/src/main/java/org/apache/commons/rdf/rdf4j/impl/RepositoryDatasetImpl.java
@@ -215,14 +215,10 @@ class RepositoryDatasetImpl extends AbstractRepositoryGraphLike<Quad> implements
 
     @Override
     public Stream<BlankNodeOrIRI> getGraphNames() {
-        // FIXME: Will the below close the connection before the stream has been
-        // consumed outside?
-        try (RepositoryConnection conn = getRepositoryConnection()) {
-            RepositoryResult<Resource> contexts = conn.getContextIDs();
-            // NOTE: connection will be closed outside by the
-            // Iterations.stream()
-            return Iterations.stream(contexts).map(g -> (BlankNodeOrIRI) rdf4jTermFactory.asRDFTerm(g));
-        }
+       RepositoryConnection conn = getRepositoryConnection();
+       RepositoryResult<Resource> contexts = conn.getContextIDs();
+        return Iterations.stream(contexts).map(g -> (BlankNodeOrIRI) rdf4jTermFactory.asRDFTerm(g))
+                .onClose(conn::close);
     }
 
 }


[2/3] incubator-commonsrdf git commit: RDF4J Dataset test

Posted by st...@apache.org.
RDF4J Dataset test


Project: http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/commit/1f1f45ee
Tree: http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/tree/1f1f45ee
Diff: http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/diff/1f1f45ee

Branch: refs/heads/master
Commit: 1f1f45ee7b99ea13126e563524e75e68c95ebdbd
Parents: 16c585c
Author: Stian Soiland-Reyes <st...@apache.org>
Authored: Fri Nov 4 00:55:46 2016 +0000
Committer: Stian Soiland-Reyes <st...@apache.org>
Committed: Fri Nov 4 00:55:46 2016 +0000

----------------------------------------------------------------------
 .../apache/commons/rdf/rdf4j/DatasetTest.java   | 30 ++++++++++++++++++++
 1 file changed, 30 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/blob/1f1f45ee/rdf4j/src/test/java/org/apache/commons/rdf/rdf4j/DatasetTest.java
----------------------------------------------------------------------
diff --git a/rdf4j/src/test/java/org/apache/commons/rdf/rdf4j/DatasetTest.java b/rdf4j/src/test/java/org/apache/commons/rdf/rdf4j/DatasetTest.java
new file mode 100644
index 0000000..6008bd0
--- /dev/null
+++ b/rdf4j/src/test/java/org/apache/commons/rdf/rdf4j/DatasetTest.java
@@ -0,0 +1,30 @@
+/**
+ * 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.commons.rdf.rdf4j;
+
+import org.apache.commons.rdf.api.AbstractDatasetTest;
+import org.apache.commons.rdf.api.RDF;
+
+public class DatasetTest extends AbstractDatasetTest {
+
+    @Override
+    public RDF createFactory() {
+        return new RDF4J();
+    }
+
+}


[3/3] incubator-commonsrdf git commit: RDF4J BlankNode toString()

Posted by st...@apache.org.
RDF4J BlankNode toString()


Project: http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/commit/30dda082
Tree: http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/tree/30dda082
Diff: http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/diff/30dda082

Branch: refs/heads/master
Commit: 30dda0825c9eced235ce60f07b82d580f2173e34
Parents: 1f1f45e
Author: Stian Soiland-Reyes <st...@apache.org>
Authored: Fri Nov 4 00:56:14 2016 +0000
Committer: Stian Soiland-Reyes <st...@apache.org>
Committed: Fri Nov 4 00:56:14 2016 +0000

----------------------------------------------------------------------
 .../java/org/apache/commons/rdf/rdf4j/impl/BlankNodeImpl.java   | 5 +++++
 1 file changed, 5 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/blob/30dda082/rdf4j/src/main/java/org/apache/commons/rdf/rdf4j/impl/BlankNodeImpl.java
----------------------------------------------------------------------
diff --git a/rdf4j/src/main/java/org/apache/commons/rdf/rdf4j/impl/BlankNodeImpl.java b/rdf4j/src/main/java/org/apache/commons/rdf/rdf4j/impl/BlankNodeImpl.java
index 8c5fc30..6357f8a 100644
--- a/rdf4j/src/main/java/org/apache/commons/rdf/rdf4j/impl/BlankNodeImpl.java
+++ b/rdf4j/src/main/java/org/apache/commons/rdf/rdf4j/impl/BlankNodeImpl.java
@@ -89,4 +89,9 @@ final class BlankNodeImpl extends AbstractRDFTerm<BNode> implements RDF4JBlankNo
         UUID uuid = new UUID(saltUUIDmost, saltUUIDleast);
         return "urn:uuid:" + uuid + "#" + value.getID();
     }
+    
+    @Override
+    public String toString() {
+        return ntriplesString() + " [" + uniqueReference() + "]";
+    }
 }
\ No newline at end of file