jena-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aj...@apache.org
Subject [12/44] jena git commit: Adding method impls to DatasetLib
Date Sat, 06 Jan 2018 15:17:36 GMT
Adding method impls to DatasetLib


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

Branch: refs/heads/master
Commit: d967c1efca1a2d1a5854804b17699fe3d5108c4c
Parents: ad3bcaa
Author: ajs6f <ajs6f@apache.org>
Authored: Fri Nov 3 15:25:04 2017 -0400
Committer: ajs6f <ajs6f@apache.org>
Committed: Fri Jan 5 09:26:07 2018 -0500

----------------------------------------------------------------------
 .../org/apache/jena/query/util/DatasetLib.java  | 34 +++++++++++++-------
 1 file changed, 22 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/jena/blob/d967c1ef/jena-arq/src/main/java/org/apache/jena/query/util/DatasetLib.java
----------------------------------------------------------------------
diff --git a/jena-arq/src/main/java/org/apache/jena/query/util/DatasetLib.java b/jena-arq/src/main/java/org/apache/jena/query/util/DatasetLib.java
index 8d1d789..9501375 100644
--- a/jena-arq/src/main/java/org/apache/jena/query/util/DatasetLib.java
+++ b/jena-arq/src/main/java/org/apache/jena/query/util/DatasetLib.java
@@ -1,21 +1,31 @@
 package org.apache.jena.query.util;
 
 import org.apache.jena.query.Dataset;
+import org.apache.jena.query.DatasetFactory;
+import org.apache.jena.sparql.util.Context;
+import org.apache.jena.sparql.util.DifferenceDatasetGraph;
+import org.apache.jena.sparql.util.UnionDatasetGraph;
 
 public class DatasetLib {
 
-    public static Dataset union(final Dataset d1, final Dataset d2) {
-        // TODO
-        throw new UnsupportedOperationException();
-    }
+	public static Dataset union(final Dataset d1, final Dataset d2) {
+		return DatasetFactory.wrap(new UnionDatasetGraph(d1.asDatasetGraph(), d2.asDatasetGraph()));
+	}
 
-    public static Dataset intersection(final Dataset d1, final Dataset d2) {
-        // TODO
-        throw new UnsupportedOperationException();
-    }
+	public static Dataset union(final Dataset d1, final Dataset d2, Context c) {
+		return DatasetFactory.wrap(new UnionDatasetGraph(d1.asDatasetGraph(), d2.asDatasetGraph(),
c));
+	}
 
-    public static Dataset difference(final Dataset d1, final Dataset d2) {
-        // TODO
-        throw new UnsupportedOperationException();
-    }
+	public static Dataset intersection(final Dataset d1, final Dataset d2) {
+		// TODO
+		throw new UnsupportedOperationException();
+	}
+
+	public static Dataset difference(final Dataset d1, final Dataset d2) {
+		return DatasetFactory.wrap(new DifferenceDatasetGraph(d1.asDatasetGraph(), d2.asDatasetGraph()));
+	}
+
+	public static Dataset difference(final Dataset d1, final Dataset d2, Context c) {
+		return DatasetFactory.wrap(new DifferenceDatasetGraph(d1.asDatasetGraph(), d2.asDatasetGraph(),
c));
+	}
 }


Mime
View raw message