Author: ogrisel
Date: Sun Apr  3 18:39:29 2011
New Revision: 1088378

URL: http://svn.apache.org/viewvc?rev=1088378&view=rev
Log:
STANBOL-120: extracted the sparql endpoint into its dedicated web fragment

Added:
    
incubator/stanbol/branches/http-endpoint-refactoring/commons/web/sparql/src/main/java/org/apache/stanbol/commons/web/sparql/SparqlEndpointWebFragment.java
    
incubator/stanbol/branches/http-endpoint-refactoring/commons/web/sparql/src/main/java/org/apache/stanbol/commons/web/sparql/resource/
    
incubator/stanbol/branches/http-endpoint-refactoring/commons/web/sparql/src/main/java/org/apache/stanbol/commons/web/sparql/resource/SparqlEndpointResource.java
    
incubator/stanbol/branches/http-endpoint-refactoring/commons/web/sparql/src/main/resources/
    
incubator/stanbol/branches/http-endpoint-refactoring/commons/web/sparql/src/main/resources/org/
    
incubator/stanbol/branches/http-endpoint-refactoring/commons/web/sparql/src/main/resources/org/apache/
    
incubator/stanbol/branches/http-endpoint-refactoring/commons/web/sparql/src/main/resources/org/apache/stanbol/
    
incubator/stanbol/branches/http-endpoint-refactoring/commons/web/sparql/src/main/resources/org/apache/stanbol/commons/
    
incubator/stanbol/branches/http-endpoint-refactoring/commons/web/sparql/src/main/resources/org/apache/stanbol/commons/web/
    
incubator/stanbol/branches/http-endpoint-refactoring/commons/web/sparql/src/main/resources/org/apache/stanbol/commons/web/sparql/
    
incubator/stanbol/branches/http-endpoint-refactoring/commons/web/sparql/src/main/resources/org/apache/stanbol/commons/web/sparql/templates/
    
incubator/stanbol/branches/http-endpoint-refactoring/commons/web/sparql/src/main/resources/org/apache/stanbol/commons/web/sparql/templates/imports/
    
incubator/stanbol/branches/http-endpoint-refactoring/commons/web/sparql/src/main/resources/org/apache/stanbol/commons/web/sparql/templates/imports/sparql.ftl
    
incubator/stanbol/branches/http-endpoint-refactoring/commons/web/sparql/src/main/resources/org/apache/stanbol/commons/web/sparql/templates/imports/sparqlDescription.ftl
    
incubator/stanbol/branches/http-endpoint-refactoring/commons/web/sparql/src/main/resources/org/apache/stanbol/commons/web/sparql/templates/org/
    
incubator/stanbol/branches/http-endpoint-refactoring/commons/web/sparql/src/main/resources/org/apache/stanbol/commons/web/sparql/templates/org/apache/
    
incubator/stanbol/branches/http-endpoint-refactoring/commons/web/sparql/src/main/resources/org/apache/stanbol/commons/web/sparql/templates/org/apache/stanbol/
    
incubator/stanbol/branches/http-endpoint-refactoring/commons/web/sparql/src/main/resources/org/apache/stanbol/commons/web/sparql/templates/org/apache/stanbol/commons/
    
incubator/stanbol/branches/http-endpoint-refactoring/commons/web/sparql/src/main/resources/org/apache/stanbol/commons/web/sparql/templates/org/apache/stanbol/commons/web/
    
incubator/stanbol/branches/http-endpoint-refactoring/commons/web/sparql/src/main/resources/org/apache/stanbol/commons/web/sparql/templates/org/apache/stanbol/commons/web/sparql/
    
incubator/stanbol/branches/http-endpoint-refactoring/commons/web/sparql/src/main/resources/org/apache/stanbol/commons/web/sparql/templates/org/apache/stanbol/commons/web/sparql/resource/
    
incubator/stanbol/branches/http-endpoint-refactoring/commons/web/sparql/src/main/resources/org/apache/stanbol/commons/web/sparql/templates/org/apache/stanbol/commons/web/sparql/resource/SparqlEndpointResource/
    
incubator/stanbol/branches/http-endpoint-refactoring/commons/web/sparql/src/main/resources/org/apache/stanbol/commons/web/sparql/templates/org/apache/stanbol/commons/web/sparql/resource/SparqlEndpointResource/index.ftl
Removed:
    
incubator/stanbol/branches/http-endpoint-refactoring/enhancer/jersey/src/main/java/org/apache/stanbol/enhancer/jersey/resource/SparqlQueryResource.java
    
incubator/stanbol/branches/http-endpoint-refactoring/enhancer/jersey/src/main/resources/org/apache/stanbol/enhancer/jersey/templates/imports/sparql.ftl
    
incubator/stanbol/branches/http-endpoint-refactoring/enhancer/jersey/src/main/resources/org/apache/stanbol/enhancer/jersey/templates/org/apache/stanbol/enhancer/jersey/resource/SparqlQueryResource/
Modified:
    incubator/stanbol/branches/http-endpoint-refactoring/commons/pom.xml
    
incubator/stanbol/branches/http-endpoint-refactoring/commons/web/base/src/main/java/org/apache/stanbol/commons/web/base/JerseyEndpoint.java
    
incubator/stanbol/branches/http-endpoint-refactoring/commons/web/base/src/main/java/org/apache/stanbol/commons/web/base/JerseyEndpointApplication.java
    
incubator/stanbol/branches/http-endpoint-refactoring/commons/web/home/src/main/resources/org/apache/stanbol/commons/web/home/templates/org/apache/stanbol/commons/web/home/resource/StanbolRootResource/index.ftl
    
incubator/stanbol/branches/http-endpoint-refactoring/commons/web/sparql/pom.xml
    
incubator/stanbol/branches/http-endpoint-refactoring/enhancer/jersey/src/main/java/org/apache/stanbol/enhancer/jersey/fragment/EnhancerWebFragment.java
    
incubator/stanbol/branches/http-endpoint-refactoring/launchers/mini/src/main/bundles/list.xml

Modified: incubator/stanbol/branches/http-endpoint-refactoring/commons/pom.xml
URL: 
http://svn.apache.org/viewvc/incubator/stanbol/branches/http-endpoint-refactoring/commons/pom.xml?rev=1088378&r1=1088377&r2=1088378&view=diff
==============================================================================
--- incubator/stanbol/branches/http-endpoint-refactoring/commons/pom.xml 
(original)
+++ incubator/stanbol/branches/http-endpoint-refactoring/commons/pom.xml Sun 
Apr  3 18:39:29 2011
@@ -21,9 +21,7 @@
   <modules>
     <module>web/base</module>
     <module>web/home</module>
-    <!--
     <module>web/sparql</module>
-    -->
     <module>testing/jarexec</module>
     <module>testing/http</module>
     <module>testing/stanbol</module>

Modified: 
incubator/stanbol/branches/http-endpoint-refactoring/commons/web/base/src/main/java/org/apache/stanbol/commons/web/base/JerseyEndpoint.java
URL: 
http://svn.apache.org/viewvc/incubator/stanbol/branches/http-endpoint-refactoring/commons/web/base/src/main/java/org/apache/stanbol/commons/web/base/JerseyEndpoint.java?rev=1088378&r1=1088377&r2=1088378&view=diff
==============================================================================
--- 
incubator/stanbol/branches/http-endpoint-refactoring/commons/web/base/src/main/java/org/apache/stanbol/commons/web/base/JerseyEndpoint.java
 (original)
+++ 
incubator/stanbol/branches/http-endpoint-refactoring/commons/web/base/src/main/java/org/apache/stanbol/commons/web/base/JerseyEndpoint.java
 Sun Apr  3 18:39:29 2011
@@ -87,10 +87,12 @@ public class JerseyEndpoint {
             app.contributeClasses(fragment.getJaxrsResourceClasses());
             app.contributeSingletons(fragment.getJaxrsResourceSingletons());
             app.contributeTemplateLoader(fragment.getTemplateLoader());
-            String resourceAlias = staticUrlRoot + '/' + fragment.getName();
-            httpService.registerResources(resourceAlias, 
fragment.getStaticResourceClassPath(),
-                new BundleHttpContext(fragment));
-            registeredAliases.add(resourceAlias);
+            String staticPath = fragment.getStaticResourceClassPath();
+            if (staticPath != null) {
+                String resourceAlias = staticUrlRoot + '/' + 
fragment.getName();
+                httpService.registerResources(resourceAlias, staticPath, new 
BundleHttpContext(fragment));
+                registeredAliases.add(resourceAlias);
+            }
         }
         Collections.sort(linkResources);
         Collections.sort(scriptResources);

Modified: 
incubator/stanbol/branches/http-endpoint-refactoring/commons/web/base/src/main/java/org/apache/stanbol/commons/web/base/JerseyEndpointApplication.java
URL: 
http://svn.apache.org/viewvc/incubator/stanbol/branches/http-endpoint-refactoring/commons/web/base/src/main/java/org/apache/stanbol/commons/web/base/JerseyEndpointApplication.java?rev=1088378&r1=1088377&r2=1088378&view=diff
==============================================================================
--- 
incubator/stanbol/branches/http-endpoint-refactoring/commons/web/base/src/main/java/org/apache/stanbol/commons/web/base/JerseyEndpointApplication.java
 (original)
+++ 
incubator/stanbol/branches/http-endpoint-refactoring/commons/web/base/src/main/java/org/apache/stanbol/commons/web/base/JerseyEndpointApplication.java
 Sun Apr  3 18:39:29 2011
@@ -62,6 +62,8 @@ public class JerseyEndpointApplication e
     }
 
     public void contributeTemplateLoader(TemplateLoader templateLoader) {
-        this.templateLoaders.add(templateLoader);
+        if (templateLoader != null) {
+            this.templateLoaders.add(templateLoader);
+        }
     }
 }

Modified: 
incubator/stanbol/branches/http-endpoint-refactoring/commons/web/home/src/main/resources/org/apache/stanbol/commons/web/home/templates/org/apache/stanbol/commons/web/home/resource/StanbolRootResource/index.ftl
URL: 
http://svn.apache.org/viewvc/incubator/stanbol/branches/http-endpoint-refactoring/commons/web/home/src/main/resources/org/apache/stanbol/commons/web/home/templates/org/apache/stanbol/commons/web/home/resource/StanbolRootResource/index.ftl?rev=1088378&r1=1088377&r2=1088378&view=diff
==============================================================================
--- 
incubator/stanbol/branches/http-endpoint-refactoring/commons/web/home/src/main/resources/org/apache/stanbol/commons/web/home/templates/org/apache/stanbol/commons/web/home/resource/StanbolRootResource/index.ftl
 (original)
+++ 
incubator/stanbol/branches/http-endpoint-refactoring/commons/web/home/src/main/resources/org/apache/stanbol/commons/web/home/templates/org/apache/stanbol/commons/web/home/resource/StanbolRootResource/index.ftl
 Sun Apr  3 18:39:29 2011
@@ -22,12 +22,6 @@ view that documents the matching RESTful
   </#if>
   </#list>
 
-  <dt><a href="sparql">/sparql</a><dt>
-  <dd>This is the <strong>SPARQL endpoint</strong> for the Stanbol store.
-     <a href="http://en.wikipedia.org/wiki/Sparql";>SPARQL</a> is the
-     standard query language the most commonly used to provide interactive
-     access to semantic knowledge bases.</dd>
-
   <dt><a href="system/console">/system/console</a><dt>
   <dd>
     <p>This is the OSGi administration console (for administrators and 
developers). The initial

Modified: 
incubator/stanbol/branches/http-endpoint-refactoring/commons/web/sparql/pom.xml
URL: 
http://svn.apache.org/viewvc/incubator/stanbol/branches/http-endpoint-refactoring/commons/web/sparql/pom.xml?rev=1088378&r1=1088377&r2=1088378&view=diff
==============================================================================
--- 
incubator/stanbol/branches/http-endpoint-refactoring/commons/web/sparql/pom.xml 
(original)
+++ 
incubator/stanbol/branches/http-endpoint-refactoring/commons/web/sparql/pom.xml 
Sun Apr  3 18:39:29 2011
@@ -53,6 +53,10 @@
   <dependencies>
     <dependency>
       <groupId>org.apache.stanbol</groupId>
+      <artifactId>org.apache.stanbol.enhancer.servicesapi</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.stanbol</groupId>
       <artifactId>org.apache.stanbol.commons.web.base</artifactId>
     </dependency>
 
@@ -73,6 +77,10 @@
       <groupId>javax.servlet</groupId>
       <artifactId>servlet-api</artifactId>
     </dependency>
+    <dependency>
+      <groupId>org.freemarker</groupId>
+      <artifactId>freemarker</artifactId>
+    </dependency>
 
     <!-- generic tax -->
     <dependency>
@@ -102,6 +110,24 @@
       <artifactId>org.apache.felix.scr.annotations</artifactId>
     </dependency>
 
+    <!-- Clerezza dependencies -->
+    <dependency>
+      <groupId>org.apache.clerezza</groupId>
+      <artifactId>org.apache.clerezza.rdf.core</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.clerezza</groupId>
+      <artifactId>org.apache.clerezza.jaxrs.rdf.providers</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.clerezza</groupId>
+      <artifactId>org.apache.clerezza.rdf.jena.serializer</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.clerezza</groupId>
+      <artifactId>org.apache.clerezza.rdf.jena.parser</artifactId>
+    </dependency>
+
   </dependencies>
 
 </project>

Added: 
incubator/stanbol/branches/http-endpoint-refactoring/commons/web/sparql/src/main/java/org/apache/stanbol/commons/web/sparql/SparqlEndpointWebFragment.java
URL: 
http://svn.apache.org/viewvc/incubator/stanbol/branches/http-endpoint-refactoring/commons/web/sparql/src/main/java/org/apache/stanbol/commons/web/sparql/SparqlEndpointWebFragment.java?rev=1088378&view=auto
==============================================================================
--- 
incubator/stanbol/branches/http-endpoint-refactoring/commons/web/sparql/src/main/java/org/apache/stanbol/commons/web/sparql/SparqlEndpointWebFragment.java
 (added)
+++ 
incubator/stanbol/branches/http-endpoint-refactoring/commons/web/sparql/src/main/java/org/apache/stanbol/commons/web/sparql/SparqlEndpointWebFragment.java
 Sun Apr  3 18:39:29 2011
@@ -0,0 +1,91 @@
+package org.apache.stanbol.commons.web.sparql;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+import org.apache.felix.scr.annotations.Activate;
+import org.apache.felix.scr.annotations.Component;
+import org.apache.felix.scr.annotations.Service;
+import org.apache.stanbol.commons.web.base.LinkResource;
+import org.apache.stanbol.commons.web.base.NavigationLink;
+import org.apache.stanbol.commons.web.base.ScriptResource;
+import org.apache.stanbol.commons.web.base.WebFragment;
+import org.apache.stanbol.commons.web.sparql.resource.SparqlEndpointResource;
+import org.osgi.framework.BundleContext;
+import org.osgi.service.component.ComponentContext;
+
+import freemarker.cache.ClassTemplateLoader;
+import freemarker.cache.TemplateLoader;
+
+/**
+ * Statically define the list of available resources and providers to be 
contributed to the the Stanbol JAX-RS
+ * Endpoint.
+ */
+@Component(immediate = true, metatype = true)
+@Service
+public class SparqlEndpointWebFragment implements WebFragment {
+
+    private static final String NAME = "sparql";
+
+    private static final String TEMPLATE_PATH = 
"/org/apache/stanbol/commons/web/sparql/templates";
+
+    private BundleContext bundleContext;
+
+    @Override
+    public String getName() {
+        return NAME;
+    }
+
+    @Activate
+    protected void activate(ComponentContext ctx) {
+        this.bundleContext = ctx.getBundleContext();
+    }
+
+    @Override
+    public Set<Class<?>> getJaxrsResourceClasses() {
+        Set<Class<?>> classes = new HashSet<Class<?>>();
+        classes.add(SparqlEndpointResource.class);
+        return classes;
+    }
+
+    @Override
+    public Set<Object> getJaxrsResourceSingletons() {
+        return Collections.emptySet();
+    }
+
+    @Override
+    public String getStaticResourceClassPath() {
+        return null;
+    }
+
+    @Override
+    public TemplateLoader getTemplateLoader() {
+        return new ClassTemplateLoader(getClass(), TEMPLATE_PATH);
+    }
+
+    @Override
+    public List<LinkResource> getLinkResources() {
+        return Collections.emptyList();
+    }
+
+    @Override
+    public List<ScriptResource> getScriptResources() {
+        return Collections.emptyList();
+    }
+
+    @Override
+    public List<NavigationLink> getNavigationLinks() {
+        List<NavigationLink> links = new ArrayList<NavigationLink>();
+        links.add(new NavigationLink("sparql", "/sparql", 
"/imports/sparqlDescription.ftl", 50));
+        return links;
+    }
+
+    @Override
+    public BundleContext getBundleContext() {
+        return bundleContext;
+    }
+
+}

Added: 
incubator/stanbol/branches/http-endpoint-refactoring/commons/web/sparql/src/main/java/org/apache/stanbol/commons/web/sparql/resource/SparqlEndpointResource.java
URL: 
http://svn.apache.org/viewvc/incubator/stanbol/branches/http-endpoint-refactoring/commons/web/sparql/src/main/java/org/apache/stanbol/commons/web/sparql/resource/SparqlEndpointResource.java?rev=1088378&view=auto
==============================================================================
--- 
incubator/stanbol/branches/http-endpoint-refactoring/commons/web/sparql/src/main/java/org/apache/stanbol/commons/web/sparql/resource/SparqlEndpointResource.java
 (added)
+++ 
incubator/stanbol/branches/http-endpoint-refactoring/commons/web/sparql/src/main/java/org/apache/stanbol/commons/web/sparql/resource/SparqlEndpointResource.java
 Sun Apr  3 18:39:29 2011
@@ -0,0 +1,78 @@
+package org.apache.stanbol.commons.web.sparql.resource;
+
+import javax.servlet.ServletContext;
+import javax.ws.rs.Consumes;
+import javax.ws.rs.FormParam;
+import javax.ws.rs.GET;
+import javax.ws.rs.POST;
+import javax.ws.rs.Path;
+import javax.ws.rs.Produces;
+import javax.ws.rs.QueryParam;
+import javax.ws.rs.core.Context;
+import javax.ws.rs.core.Response;
+
+import org.apache.clerezza.rdf.core.access.TcManager;
+import org.apache.clerezza.rdf.core.sparql.ParseException;
+import org.apache.clerezza.rdf.core.sparql.QueryParser;
+import org.apache.clerezza.rdf.core.sparql.query.ConstructQuery;
+import org.apache.clerezza.rdf.core.sparql.query.DescribeQuery;
+import org.apache.clerezza.rdf.core.sparql.query.Query;
+import org.apache.stanbol.commons.web.base.ContextHelper;
+import org.apache.stanbol.commons.web.base.resource.BaseStanbolResource;
+import org.apache.stanbol.enhancer.servicesapi.Store;
+import 
org.apache.stanbol.enhancer.servicesapi.SparqlQueryEngine.SparqlQueryEngineException;
+
+import com.sun.jersey.api.view.Viewable;
+
+import static javax.ws.rs.core.MediaType.APPLICATION_FORM_URLENCODED;
+import static javax.ws.rs.core.MediaType.APPLICATION_XML;
+import static javax.ws.rs.core.MediaType.TEXT_HTML;
+
+/**
+ * Implementation of a SPARQL endpoint as defined by the W3C:
+ * 
+ * http://www.w3.org/TR/rdf-sparql-protocol/
+ * 
+ * (Might not be 100% compliant yet, please report bugs/missing features in 
the issue tracker).
+ * 
+ * If the "query" parameter is not present, then fallback to display and HTML 
view with an ajax-ified form to
+ * test the SPARQL endpoint from the browser.
+ */
+@Path("/sparql")
+public class SparqlEndpointResource extends BaseStanbolResource {
+
+    protected Store store;
+
+    protected TcManager tcManager;
+
+    public SparqlEndpointResource(@Context ServletContext ctx) {
+        tcManager = ContextHelper.getServiceFromContext(TcManager.class, ctx);
+        store = ContextHelper.getServiceFromContext(Store.class, ctx);
+    }
+
+    @GET
+    @Consumes(APPLICATION_FORM_URLENCODED)
+    @Produces({TEXT_HTML + ";qs=2", "application/sparql-results+xml", 
"application/rdf+xml", APPLICATION_XML})
+    public Object sparql(@QueryParam(value = "query") String sparqlQuery) 
throws SparqlQueryEngineException,
+                                                                         
ParseException {
+        if (sparqlQuery == null) {
+            return Response.ok(new Viewable("index", this), TEXT_HTML).build();
+        }
+        Query query = QueryParser.getInstance().parse(sparqlQuery);
+        String mediaType = "application/sparql-results+xml";
+        if (query instanceof DescribeQuery || query instanceof ConstructQuery) 
{
+            mediaType = "application/rdf+xml";
+        }
+        Object result = tcManager.executeSparqlQuery(query, 
store.getEnhancementGraph());
+        return Response.ok(result, mediaType).build();
+    }
+
+    @POST
+    @Consumes(APPLICATION_FORM_URLENCODED)
+    @Produces({"application/sparql-results+xml", "application/rdf+xml", 
APPLICATION_XML})
+    public Object postSparql(@FormParam("query") String sparqlQuery) throws 
SparqlQueryEngineException,
+                                                                    
ParseException {
+        return sparql(sparqlQuery);
+    }
+
+}

Added: 
incubator/stanbol/branches/http-endpoint-refactoring/commons/web/sparql/src/main/resources/org/apache/stanbol/commons/web/sparql/templates/imports/sparql.ftl
URL: 
http://svn.apache.org/viewvc/incubator/stanbol/branches/http-endpoint-refactoring/commons/web/sparql/src/main/resources/org/apache/stanbol/commons/web/sparql/templates/imports/sparql.ftl?rev=1088378&view=auto
==============================================================================
--- 
incubator/stanbol/branches/http-endpoint-refactoring/commons/web/sparql/src/main/resources/org/apache/stanbol/commons/web/sparql/templates/imports/sparql.ftl
 (added)
+++ 
incubator/stanbol/branches/http-endpoint-refactoring/commons/web/sparql/src/main/resources/org/apache/stanbol/commons/web/sparql/templates/imports/sparql.ftl
 Sun Apr  3 18:39:29 2011
@@ -0,0 +1,49 @@
+<#macro form>
+<form id="sparql" action="${it.publicBaseUri}sparql" method="GET"
+ enctype="application/x-www-form-urlencoded"
+ accept="application/sparql-results+xml, application/rdf+xml">
+<textarea class="query" rows="11" name="query">
+PREFIX fise: &lt;http://fise.iks-project.eu/ontology/&gt;
+PREFIX dc:   &lt;http://purl.org/dc/terms/&gt;
+SELECT distinct ?enhancement ?content ?engine ?extraction_time
+WHERE {
+  ?enhancement a fise:Enhancement .
+  ?enhancement fise:extracted-from ?content .
+  ?enhancement dc:creator ?engine .
+  ?enhancement dc:created ?extraction_time .
+}
+ORDER BY DESC(?extraction_time) LIMIT 5
+</textarea>
+<p><input type="submit" class="submit" value="Run SPARQL query" /></p>
+<pre class="prettyprint result" style="max-height: 200px; display: none" 
disabled="disabled">
+</pre>
+</form>
+<script language="javascript">
+function registersSparqlHandler() {
+   $("#sparql input.submit", this).click(function(e) {
+     // disable regular form click
+     e.preventDefault();
+     
+     // clean the result area
+     $("#sparql textarea.result").text('');
+     
+     // submit sparql query using Ajax
+     $.ajax({
+       type: "POST",
+       url: "${it.publicBaseUri}sparql",
+       data: {query: $("#sparql textarea.query").val()},
+       dataType: "html",
+       cache: false,
+       success: function(result) {
+         $("#sparql pre.result").text(result).css("display", "block");
+         prettyPrint();
+       },
+       error: function(result) {
+         $("#sparql pre.result").text('Invalid query.').css("display", 
"block");
+       }
+     });
+   });
+ }
+ $(document).ready(registersSparqlHandler);
+</script>
+</#macro>
\ No newline at end of file

Added: 
incubator/stanbol/branches/http-endpoint-refactoring/commons/web/sparql/src/main/resources/org/apache/stanbol/commons/web/sparql/templates/imports/sparqlDescription.ftl
URL: 
http://svn.apache.org/viewvc/incubator/stanbol/branches/http-endpoint-refactoring/commons/web/sparql/src/main/resources/org/apache/stanbol/commons/web/sparql/templates/imports/sparqlDescription.ftl?rev=1088378&view=auto
==============================================================================
--- 
incubator/stanbol/branches/http-endpoint-refactoring/commons/web/sparql/src/main/resources/org/apache/stanbol/commons/web/sparql/templates/imports/sparqlDescription.ftl
 (added)
+++ 
incubator/stanbol/branches/http-endpoint-refactoring/commons/web/sparql/src/main/resources/org/apache/stanbol/commons/web/sparql/templates/imports/sparqlDescription.ftl
 Sun Apr  3 18:39:29 2011
@@ -0,0 +1,4 @@
+This is the <strong>SPARQL endpoint</strong> for the Stanbol store.
+<a href="http://en.wikipedia.org/wiki/Sparql";>SPARQL</a> is the
+standard query language the most commonly used to provide interactive
+access to semantic knowledge bases.
\ No newline at end of file

Added: 
incubator/stanbol/branches/http-endpoint-refactoring/commons/web/sparql/src/main/resources/org/apache/stanbol/commons/web/sparql/templates/org/apache/stanbol/commons/web/sparql/resource/SparqlEndpointResource/index.ftl
URL: 
http://svn.apache.org/viewvc/incubator/stanbol/branches/http-endpoint-refactoring/commons/web/sparql/src/main/resources/org/apache/stanbol/commons/web/sparql/templates/org/apache/stanbol/commons/web/sparql/resource/SparqlEndpointResource/index.ftl?rev=1088378&view=auto
==============================================================================
--- 
incubator/stanbol/branches/http-endpoint-refactoring/commons/web/sparql/src/main/resources/org/apache/stanbol/commons/web/sparql/templates/org/apache/stanbol/commons/web/sparql/resource/SparqlEndpointResource/index.ftl
 (added)
+++ 
incubator/stanbol/branches/http-endpoint-refactoring/commons/web/sparql/src/main/resources/org/apache/stanbol/commons/web/sparql/templates/org/apache/stanbol/commons/web/sparql/resource/SparqlEndpointResource/index.ftl
 Sun Apr  3 18:39:29 2011
@@ -0,0 +1,21 @@
+<#import "/imports/common.ftl" as common>
+<#import "/imports/sparql.ftl" as sparql>
+<#escape x as x?html>
+<@common.page title="SPARQL Endpoint" hasrestapi=false>
+
+  <p><a href="http://en.wikipedia.org/wiki/Sparql";>SPARQL</a> is the
+    standard query language the most commonly used to provide interactive
+    access to semantic knowledge bases.</p>
+    
+  <p>A SPARQL endpoint is a standardized HTTP access to perform SPARQL queries.
+    Developers of REST clients will find all the necessary documentation in the
+    official <a 
href="http://www.w3.org/TR/rdf-sparql-protocol/#query-bindings-http";>W3C
+    page for the RDF SPARQL protocol</a>.
+       
+  <p>The Stanbol enhancer SPARQL endpoint gives access to all the semantic
+    enhancements related to content items from the Stanbol enhancer <a 
href="/store">store</a>.</p>
+
+  <@sparql.form/>
+
+</@common.page>
+</#escape>

Modified: 
incubator/stanbol/branches/http-endpoint-refactoring/enhancer/jersey/src/main/java/org/apache/stanbol/enhancer/jersey/fragment/EnhancerWebFragment.java
URL: 
http://svn.apache.org/viewvc/incubator/stanbol/branches/http-endpoint-refactoring/enhancer/jersey/src/main/java/org/apache/stanbol/enhancer/jersey/fragment/EnhancerWebFragment.java?rev=1088378&r1=1088377&r2=1088378&view=diff
==============================================================================
--- 
incubator/stanbol/branches/http-endpoint-refactoring/enhancer/jersey/src/main/java/org/apache/stanbol/enhancer/jersey/fragment/EnhancerWebFragment.java
 (original)
+++ 
incubator/stanbol/branches/http-endpoint-refactoring/enhancer/jersey/src/main/java/org/apache/stanbol/enhancer/jersey/fragment/EnhancerWebFragment.java
 Sun Apr  3 18:39:29 2011
@@ -14,7 +14,6 @@ import org.apache.stanbol.commons.web.ba
 import org.apache.stanbol.commons.web.base.ScriptResource;
 import org.apache.stanbol.commons.web.base.WebFragment;
 import org.apache.stanbol.enhancer.jersey.resource.EnginesRootResource;
-import org.apache.stanbol.enhancer.jersey.resource.SparqlQueryResource;
 import org.apache.stanbol.enhancer.jersey.resource.StoreRootResource;
 import org.osgi.framework.BundleContext;
 import org.osgi.service.component.ComponentContext;
@@ -54,7 +53,6 @@ public class EnhancerWebFragment impleme
         // resources
         classes.add(EnginesRootResource.class);
         classes.add(StoreRootResource.class);
-        classes.add(SparqlQueryResource.class);
         return classes;
     }
 

Modified: 
incubator/stanbol/branches/http-endpoint-refactoring/launchers/mini/src/main/bundles/list.xml
URL: 
http://svn.apache.org/viewvc/incubator/stanbol/branches/http-endpoint-refactoring/launchers/mini/src/main/bundles/list.xml?rev=1088378&r1=1088377&r2=1088378&view=diff
==============================================================================
--- 
incubator/stanbol/branches/http-endpoint-refactoring/launchers/mini/src/main/bundles/list.xml
 (original)
+++ 
incubator/stanbol/branches/http-endpoint-refactoring/launchers/mini/src/main/bundles/list.xml
 Sun Apr  3 18:39:29 2011
@@ -155,6 +155,11 @@
                </bundle>
                <bundle>
                        <groupId>org.apache.stanbol</groupId>
+                       
<artifactId>org.apache.stanbol.commons.web.sparql</artifactId>
+                       <version>0.9-SNAPSHOT</version>
+               </bundle>
+               <bundle>
+                       <groupId>org.apache.stanbol</groupId>
                        
<artifactId>org.apache.stanbol.enhancer.standalone</artifactId>
                        <version>0.9-SNAPSHOT</version>
                </bundle>


Reply via email to