You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@stanbol.apache.org by su...@apache.org on 2012/04/10 08:57:10 UTC

svn commit: r1311601 - in /incubator/stanbol/trunk/commons/web/sparql/src/main: java/org/apache/stanbol/commons/web/sparql/resource/SparqlEndpointResource.java resources/org/apache/stanbol/commons/web/sparql/templates/imports/sparql.ftl

Author: suat
Date: Tue Apr 10 06:57:10 2012
New Revision: 1311601

URL: http://svn.apache.org/viewvc?rev=1311601&view=rev
Log:
STANBOL-580:
-Checked UriRef class as type of the given graph URI

Modified:
    incubator/stanbol/trunk/commons/web/sparql/src/main/java/org/apache/stanbol/commons/web/sparql/resource/SparqlEndpointResource.java
    incubator/stanbol/trunk/commons/web/sparql/src/main/resources/org/apache/stanbol/commons/web/sparql/templates/imports/sparql.ftl

Modified: incubator/stanbol/trunk/commons/web/sparql/src/main/java/org/apache/stanbol/commons/web/sparql/resource/SparqlEndpointResource.java
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/commons/web/sparql/src/main/java/org/apache/stanbol/commons/web/sparql/resource/SparqlEndpointResource.java?rev=1311601&r1=1311600&r2=1311601&view=diff
==============================================================================
--- incubator/stanbol/trunk/commons/web/sparql/src/main/java/org/apache/stanbol/commons/web/sparql/resource/SparqlEndpointResource.java (original)
+++ incubator/stanbol/trunk/commons/web/sparql/src/main/java/org/apache/stanbol/commons/web/sparql/resource/SparqlEndpointResource.java Tue Apr 10 06:57:10 2012
@@ -42,6 +42,7 @@ import javax.ws.rs.core.Response.Respons
 import javax.ws.rs.core.Response.Status;
 
 import org.apache.clerezza.rdf.core.TripleCollection;
+import org.apache.clerezza.rdf.core.UriRef;
 import org.apache.clerezza.rdf.core.access.TcManager;
 import org.apache.clerezza.rdf.core.sparql.ParseException;
 import org.apache.clerezza.rdf.core.sparql.QueryParser;
@@ -171,6 +172,9 @@ public class SparqlEndpointResource exte
         if (services != null) {
             for (ServiceReference service : services.keySet()) {
                 Object graphUri = service.getProperty(GRAPH_URI);
+                if (service.getProperty(GRAPH_URI) instanceof UriRef) {
+                    graphUri = ((UriRef) graphUri).getUnicodeString();
+                }
                 Object graphName = service.getProperty("graph.name");
                 Object graphDescription = service.getProperty("graph.description");
                 if (graphUri instanceof String && graphName instanceof String

Modified: incubator/stanbol/trunk/commons/web/sparql/src/main/resources/org/apache/stanbol/commons/web/sparql/templates/imports/sparql.ftl
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/commons/web/sparql/src/main/resources/org/apache/stanbol/commons/web/sparql/templates/imports/sparql.ftl?rev=1311601&r1=1311600&r2=1311601&view=diff
==============================================================================
--- incubator/stanbol/trunk/commons/web/sparql/src/main/resources/org/apache/stanbol/commons/web/sparql/templates/imports/sparql.ftl (original)
+++ incubator/stanbol/trunk/commons/web/sparql/src/main/resources/org/apache/stanbol/commons/web/sparql/templates/imports/sparql.ftl Tue Apr 10 06:57:10 2012
@@ -15,14 +15,19 @@
   limitations under the License.
 -->
 <#macro form>
-<#-- graph list -->
-<#if it.tripleCollectionList?size &gt; 0>
-  <select id="graphList" onChange='javascript:graphChangeHandler();'>
-  	<#list it.tripleCollectionList as tcInfo>
-  		<option value="${tcInfo.graphUri}">${tcInfo.graphUri}</option>
-  	</#list>
-  </select>
-</#if>
+<fieldset>
+  <legend>Registered TripleCollections</legend>
+  <#-- graph list -->
+  <#if it.tripleCollectionList?size &gt; 0>
+    <select id="graphList" onChange='javascript:graphChangeHandler();'>
+    	<#list it.tripleCollectionList as tcInfo>
+    		<option value="${tcInfo.graphUri}">${tcInfo.graphUri}</option>
+    	</#list>
+    </select>
+  <#else>
+    There is no registered TripleCollection.
+  </#if>
+</fieldset>
 
 <#if it.tripleCollectionList?size &gt; 0>
   <fieldset>