commonsrdf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From st...@apache.org
Subject [13/50] incubator-commonsrdf git commit: Remove UUID-less helper methods
Date Fri, 07 Oct 2016 14:23:07 GMT
Remove UUID-less helper methods


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

Branch: refs/heads/rdf4j
Commit: 4e9b11b1f352897f0d7b9fd5334d73f3ace375e0
Parents: 7fb1d88
Author: Stian Soiland-Reyes <stain@apache.org>
Authored: Thu Sep 8 15:28:17 2016 +0100
Committer: Stian Soiland-Reyes <stain@apache.org>
Committed: Thu Sep 8 15:29:15 2016 +0100

----------------------------------------------------------------------
 .../commons/rdf/jena/impl/JenaFactory.java      | 32 ++++++++------------
 .../commons/rdf/jena/TestBlankNodeJena.java     |  6 ++--
 2 files changed, 16 insertions(+), 22 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/blob/4e9b11b1/jena/src/main/java/org/apache/commons/rdf/jena/impl/JenaFactory.java
----------------------------------------------------------------------
diff --git a/jena/src/main/java/org/apache/commons/rdf/jena/impl/JenaFactory.java b/jena/src/main/java/org/apache/commons/rdf/jena/impl/JenaFactory.java
index bc0ae0f..7a6a7ab 100644
--- a/jena/src/main/java/org/apache/commons/rdf/jena/impl/JenaFactory.java
+++ b/jena/src/main/java/org/apache/commons/rdf/jena/impl/JenaFactory.java
@@ -37,6 +37,7 @@ import org.apache.commons.rdf.jena.JenaLiteral;
 import org.apache.commons.rdf.jena.JenaQuad;
 import org.apache.commons.rdf.jena.JenaQuadLike;
 import org.apache.commons.rdf.jena.JenaRDFTerm;
+import org.apache.commons.rdf.jena.JenaRDFTermFactory;
 import org.apache.commons.rdf.jena.JenaTriple;
 import org.apache.commons.rdf.jena.JenaTripleLike;
 import org.apache.commons.rdf.jena.JenaVariable;
@@ -47,10 +48,18 @@ import org.apache.jena.sparql.core.DatasetGraph;
 import org.apache.jena.sparql.core.DatasetGraphFactory;
 import org.apache.jena.sparql.graph.GraphFactory;
 
+/**
+ * Construct Jena implementations of Commons RDF.
+ * <p>
+ * This class is primarily an internal helper class, users should instead use
+ * {@link JenaRDFTermFactory}.
+ * <p>
+ * For the purpose of blank node identity, some of 
+ * these methods require a {@link UUID} to use as a salt.
+ * See {@link BlankNode#uniqueReference()} for details.
+ * 
+ */
 public class JenaFactory {
-	public static BlankNode createBlankNode() {
-		return new BlankNodeImpl(NodeFactory.createBlankNode(), UUID.randomUUID());
-	}
 
 	public static JenaBlankNode createBlankNode(String id, UUID salt) {
 		return new BlankNodeImpl(NodeFactory.createBlankNode(id), salt);
@@ -59,21 +68,12 @@ public class JenaFactory {
 	public static JenaBlankNode createBlankNode(UUID salt) {
 		return new BlankNodeImpl(NodeFactory.createBlankNode(), salt);
 	}
-
-	public static Dataset createDataset() {
-		return createDataset(UUID.randomUUID());
-	}
-	
 	public static Dataset createDataset(UUID salt) {
 		DatasetGraph dg = DatasetGraphFactory.createGeneral();
 		// Or which createMethod() -- a bit confusing with lots of choice..
 		return new DatasetImpl(dg, salt);
 	}
 
-	public static JenaGraph createGraph() {
-		return createGraph(UUID.randomUUID());
-	}
-
 	public static JenaGraph createGraph(UUID salt) {
 		return new GraphImpl(GraphFactory.createDefaultGraph(), salt);
 	}
@@ -144,10 +144,6 @@ public class JenaFactory {
 		throw new IllegalArgumentException("Unrecognized node type: " + node);
 	}
 
-	public static JenaGraph fromJena(org.apache.jena.graph.Graph graph) {
-		return new GraphImpl(graph, UUID.randomUUID());
-	}
-
 	public static JenaGraph fromJena(org.apache.jena.graph.Graph graph, UUID salt) {
 		return new GraphImpl(graph, salt);
 	}
@@ -156,10 +152,6 @@ public class JenaFactory {
 		return new GraphImpl(model, salt);
 	}
 
-	public static JenaDataset fromJena(DatasetGraph datasetGraph) {
-		return new DatasetImpl(datasetGraph, UUID.randomUUID());
-	}
-
 	public static JenaDataset fromJena(DatasetGraph datasetGraph, UUID salt) {
 		return new DatasetImpl(datasetGraph, salt);
 	}

http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/blob/4e9b11b1/jena/src/test/java/org/apache/commons/rdf/jena/TestBlankNodeJena.java
----------------------------------------------------------------------
diff --git a/jena/src/test/java/org/apache/commons/rdf/jena/TestBlankNodeJena.java b/jena/src/test/java/org/apache/commons/rdf/jena/TestBlankNodeJena.java
index 10edd09..f37922f 100644
--- a/jena/src/test/java/org/apache/commons/rdf/jena/TestBlankNodeJena.java
+++ b/jena/src/test/java/org/apache/commons/rdf/jena/TestBlankNodeJena.java
@@ -26,12 +26,14 @@ import org.apache.commons.rdf.jena.impl.JenaFactory;
 
 public class TestBlankNodeJena extends AbstractBlankNodeTest {
 
-	
+	/** 
+	 * Fixed salt for the purpose of this test.
+	 */
     private static final UUID SALT = UUID.fromString("ccfde817-55b8-4a5f-bc2d-6bfd8eaa41ce");
 
 	@Override
     protected BlankNode getBlankNode() {
-        return JenaFactory.createBlankNode() ;
+        return JenaFactory.createBlankNode(SALT) ;
     }
     
     @Override


Mime
View raw message