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 2013/04/15 16:52:03 UTC

svn commit: r1468103 - /jena/trunk/jena-fuseki/src/main/java/org/apache/jena/fuseki/servlets/SPARQL_REST_R.java

Author: andy
Date: Mon Apr 15 14:52:02 2013
New Revision: 1468103

URL: http://svn.apache.org/r1468103
Log:
JENA-435
Deciding the dataset target shoudl find the longest match.

Modified:
    jena/trunk/jena-fuseki/src/main/java/org/apache/jena/fuseki/servlets/SPARQL_REST_R.java

Modified: jena/trunk/jena-fuseki/src/main/java/org/apache/jena/fuseki/servlets/SPARQL_REST_R.java
URL: http://svn.apache.org/viewvc/jena/trunk/jena-fuseki/src/main/java/org/apache/jena/fuseki/servlets/SPARQL_REST_R.java?rev=1468103&r1=1468102&r2=1468103&view=diff
==============================================================================
--- jena/trunk/jena-fuseki/src/main/java/org/apache/jena/fuseki/servlets/SPARQL_REST_R.java (original)
+++ jena/trunk/jena-fuseki/src/main/java/org/apache/jena/fuseki/servlets/SPARQL_REST_R.java Mon Apr 15 14:52:02 2013
@@ -54,8 +54,12 @@ public class SPARQL_REST_R extends SPARQ
             return null ;
         
         // Mapping a request for GSP needs to find the "best"
-        // (shortest matching) unlike service matching, 
-        // which is a matter of removing the service component.
+        // (longest matching) dataset URI.
+        // This covers local using the URI as a direct name for
+        // a graph, not just using the indirect ?graph= or ?default 
+        // forms.
+        // Service matching, which is a matter of removing the service component,
+        // would only work for indirect. 
 
         String ds = null ;
         Iterator<String> iter = DatasetRegistry.get().keys() ;
@@ -70,7 +74,7 @@ public class SPARQL_REST_R extends SPARQ
                 ds = ds2 ;
                 continue ; 
             }
-            if ( ds.length() > ds2.length() )
+            if ( ds.length() < ds2.length() )
             {
                 ds = ds2 ;
                 continue ;