You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jena.apache.org by an...@apache.org on 2017/08/24 21:31:31 UTC

[5/8] jena git commit: JENA-1381: Interface NamedGraph

JENA-1381: Interface NamedGraph


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

Branch: refs/heads/master
Commit: b358603f074d2991e734022abc97e94d83ea77cd
Parents: ed48b26
Author: Andy Seaborne <an...@apache.org>
Authored: Sat Aug 19 17:06:13 2017 +0100
Committer: Andy Seaborne <an...@apache.org>
Committed: Sat Aug 19 17:44:29 2017 +0100

----------------------------------------------------------------------
 .../org/apache/jena/query/text/TextQueryPF.java | 21 ++++++++++----------
 1 file changed, 11 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/jena/blob/b358603f/jena-text/src/main/java/org/apache/jena/query/text/TextQueryPF.java
----------------------------------------------------------------------
diff --git a/jena-text/src/main/java/org/apache/jena/query/text/TextQueryPF.java b/jena-text/src/main/java/org/apache/jena/query/text/TextQueryPF.java
index a4279c5..8a684c4 100644
--- a/jena-text/src/main/java/org/apache/jena/query/text/TextQueryPF.java
+++ b/jena-text/src/main/java/org/apache/jena/query/text/TextQueryPF.java
@@ -29,6 +29,7 @@ import org.apache.jena.atlas.lib.CacheFactory ;
 import org.apache.jena.atlas.logging.Log ;
 import org.apache.jena.datatypes.RDFDatatype ;
 import org.apache.jena.datatypes.xsd.XSDDatatype ;
+import org.apache.jena.graph.Graph ;
 import org.apache.jena.graph.Node ;
 import org.apache.jena.ext.com.google.common.collect.LinkedListMultimap;
 import org.apache.jena.ext.com.google.common.collect.ListMultimap;
@@ -271,18 +272,18 @@ public class TextQueryPF extends PropertyFunctionBase {
     
     private String chooseGraphURI(ExecutionContext execCxt) {
         // use the graph information in the text index if possible
-        String graph = null;
-        if (textIndex.getDocDef().getGraphField() != null
-            && execCxt.getActiveGraph() instanceof GraphView) {
-            GraphView activeGraph = (GraphView)execCxt.getActiveGraph() ;
-            if (!Quad.isUnionGraph(activeGraph.getGraphName())) {
-                graph =
-                    activeGraph.getGraphName() != null 
-                    ? TextQueryFuncs.graphNodeToString(activeGraph.getGraphName())
-                    : Quad.defaultGraphNodeGenerated.getURI() ;
+        String graphURI = null;
+        Graph activeGraph = execCxt.getActiveGraph();
+        
+        if (textIndex.getDocDef().getGraphField() != null && activeGraph instanceof NamedGraph) {
+            NamedGraph namedGraph = (NamedGraph)activeGraph ;
+            if (!Quad.isUnionGraph(namedGraph.getGraphName())) {
+                graphURI = namedGraph.getGraphName() != null 
+                        ? TextQueryFuncs.graphNodeToString(namedGraph.getGraphName())
+                        : Quad.defaultGraphNodeGenerated.getURI() ;
             }
         }
-        return graph;
+        return graphURI;
     }
     
     private ListMultimap<String,TextHit> performQuery(Node property, String queryString, String graphURI, String lang, int limit) {