jena-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a...@apache.org
Subject [03/27] jena git commit: JENA-1592: Unwrap TDB2 graphs
Date Fri, 31 Aug 2018 12:04:53 GMT
JENA-1592: Unwrap TDB2 graphs


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

Branch: refs/heads/master
Commit: 9a60253c00aec6763adbb0253588fe4dc0b484d4
Parents: d8e51a8
Author: Andy Seaborne <andy@apache.org>
Authored: Mon Aug 20 20:35:06 2018 +0100
Committer: Andy Seaborne <andy@apache.org>
Committed: Thu Aug 23 17:15:05 2018 +0100

----------------------------------------------------------------------
 .../apache/jena/tdb2/solver/StageGeneratorDirectTDB.java |  2 +-
 .../org/apache/jena/tdb2/store/GraphViewSwitchable.java  | 11 +++++++----
 2 files changed, 8 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/jena/blob/9a60253c/jena-db/jena-tdb2/src/main/java/org/apache/jena/tdb2/solver/StageGeneratorDirectTDB.java
----------------------------------------------------------------------
diff --git a/jena-db/jena-tdb2/src/main/java/org/apache/jena/tdb2/solver/StageGeneratorDirectTDB.java
b/jena-db/jena-tdb2/src/main/java/org/apache/jena/tdb2/solver/StageGeneratorDirectTDB.java
index bb9ac10..a4eba73 100644
--- a/jena-db/jena-tdb2/src/main/java/org/apache/jena/tdb2/solver/StageGeneratorDirectTDB.java
+++ b/jena-db/jena-tdb2/src/main/java/org/apache/jena/tdb2/solver/StageGeneratorDirectTDB.java
@@ -51,7 +51,7 @@ public class StageGeneratorDirectTDB implements StageGenerator
         
         if ( g instanceof GraphViewSwitchable ) {
             GraphViewSwitchable gvs = (GraphViewSwitchable)g;
-            g = gvs.getGraph();
+            g = gvs.getBaseGraph();
         }
         
         if ( ! ( g instanceof GraphTDB ) )

http://git-wip-us.apache.org/repos/asf/jena/blob/9a60253c/jena-db/jena-tdb2/src/main/java/org/apache/jena/tdb2/store/GraphViewSwitchable.java
----------------------------------------------------------------------
diff --git a/jena-db/jena-tdb2/src/main/java/org/apache/jena/tdb2/store/GraphViewSwitchable.java
b/jena-db/jena-tdb2/src/main/java/org/apache/jena/tdb2/store/GraphViewSwitchable.java
index 2a3fbf5..f008ad9 100644
--- a/jena-db/jena-tdb2/src/main/java/org/apache/jena/tdb2/store/GraphViewSwitchable.java
+++ b/jena-db/jena-tdb2/src/main/java/org/apache/jena/tdb2/store/GraphViewSwitchable.java
@@ -76,17 +76,20 @@ public class GraphViewSwitchable extends GraphView {
         return transactionHandler;
     }
     
-    /** Return the {@code DatasetGraphSwitchable} we are viewing. */
+    /** Return the {@link DatasetGraphSwitchable} we are viewing. */
     @Override
     public DatasetGraphSwitchable getDataset() {
         return getx();
     }
     
-    /** Return the {@code Graph} from the underlying switchable.
+    /** Return the {@code Graph} from the underlying DatasetGraph
      *  Do not hold onto this reference across switches. 
      */
-    public Graph getGraph() {
-        return getx().getGraph(getGraphName());
+    public Graph getBaseGraph() {
+        if ( getGraphName() == null )
+            return getDSG().getDefaultGraph();
+        else
+            return getDSG().getGraph(getGraphName());
     }
 
     // Super uses find. Override to call GraphTDB.size()


Mime
View raw message