You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@stanbol.apache.org by al...@apache.org on 2011/06/30 20:17:50 UTC

svn commit: r1141647 - in /incubator/stanbol/trunk: ./ integration-tests/ integration-tests/src/test/java/org/apache/stanbol/ontologymanager/web/it/ launchers/full/src/main/bundles/ ontologymanager/web/src/main/resources/org/apache/stanbol/ontologymana...

Author: alexdma
Date: Thu Jun 30 18:17:49 2011
New Revision: 1141647

URL: http://svn.apache.org/viewvc?rev=1141647&view=rev
Log:
STANBOL-177 STANBOL-179:
- Applied patches by Alberto Musetti: introduce reasoner integration tests
- rules and reasoners are now in default profile and launchers/full
- Added freemarker templates for onotonet/session

Added:
    incubator/stanbol/trunk/ontologymanager/web/src/main/resources/org/apache/stanbol/ontologymanager/web/templates/org/apache/stanbol/ontologymanager/web/resources/ONMRootResource/inc_sessionmgr.ftl
    incubator/stanbol/trunk/ontologymanager/web/src/main/resources/org/apache/stanbol/ontologymanager/web/templates/org/apache/stanbol/ontologymanager/web/resources/SessionResource/inc_sessionmgr.ftl
Removed:
    incubator/stanbol/trunk/reasoners/web/src/test/java/org/apache/stanbol/reasoners/web/ClassifyTest.java
    incubator/stanbol/trunk/reasoners/web/src/test/java/org/apache/stanbol/reasoners/web/ConsistencyCheckTest.java
    incubator/stanbol/trunk/reasoners/web/src/test/java/org/apache/stanbol/reasoners/web/EnrichmentTest.java
Modified:
    incubator/stanbol/trunk/integration-tests/pom.xml
    incubator/stanbol/trunk/integration-tests/src/test/java/org/apache/stanbol/ontologymanager/web/it/ScopeTest.java
    incubator/stanbol/trunk/integration-tests/src/test/java/org/apache/stanbol/ontologymanager/web/it/SessionTest.java
    incubator/stanbol/trunk/launchers/full/src/main/bundles/list.xml
    incubator/stanbol/trunk/ontologymanager/web/src/main/resources/org/apache/stanbol/ontologymanager/web/templates/org/apache/stanbol/ontologymanager/web/resources/SessionResource/index.ftl
    incubator/stanbol/trunk/pom.xml
    incubator/stanbol/trunk/reasoners/pom.xml
    incubator/stanbol/trunk/reasoners/web/src/main/java/org/apache/stanbol/reasoners/web/ReasonersFragment.java
    incubator/stanbol/trunk/reasoners/web/src/main/java/org/apache/stanbol/reasoners/web/resources/Classify.java
    incubator/stanbol/trunk/reasoners/web/src/main/java/org/apache/stanbol/reasoners/web/resources/ConsistencyCheck.java
    incubator/stanbol/trunk/reasoners/web/src/main/java/org/apache/stanbol/reasoners/web/resources/Enrichment.java

Modified: incubator/stanbol/trunk/integration-tests/pom.xml
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/integration-tests/pom.xml?rev=1141647&r1=1141646&r2=1141647&view=diff
==============================================================================
--- incubator/stanbol/trunk/integration-tests/pom.xml (original)
+++ incubator/stanbol/trunk/integration-tests/pom.xml Thu Jun 30 18:17:49 2011
@@ -76,6 +76,24 @@
       <version>4.7</version>
       <scope>test</scope>
     </dependency>
+	<dependency>
+      <groupId>owlapi</groupId>
+      <artifactId>owlapi</artifactId>
+      <version>3.0.0</version>
+      <scope>test</scope>
+    </dependency>
+	<dependency>
+      <groupId>com.sun.jersey</groupId>
+      <artifactId>jersey-server</artifactId>
+      <version>${jersey-version}</version>
+	  <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>com.sun.jersey</groupId>
+      <artifactId>jersey-core</artifactId>
+      <version>${jersey-version}</version>
+	  <scope>test</scope>
+    </dependency>
   </dependencies>
 
   <build>
@@ -139,7 +157,8 @@
             <server.ready.path.2>/engines:There are currently</server.ready.path.2>
             <server.ready.path.3>/contenthub:Recently uploaded Content Items</server.ready.path.3>
             <server.ready.path.4>/factstore:The FactStore implements a store</server.ready.path.4>
-			<server.ready.path.5>/ontonet:Apache Stanbol Ontonet</server.ready.path.5>
+			<server.ready.path.5>/ontonet:Apache Stanbol OntoNet</server.ready.path.5>
+			<server.ready.path.6>/reasoners:Apache Stanbol Reasoners</server.ready.path.6>
           </systemPropertyVariables>
         </configuration>
       </plugin>

Modified: incubator/stanbol/trunk/integration-tests/src/test/java/org/apache/stanbol/ontologymanager/web/it/ScopeTest.java
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/integration-tests/src/test/java/org/apache/stanbol/ontologymanager/web/it/ScopeTest.java?rev=1141647&r1=1141646&r2=1141647&view=diff
==============================================================================
--- incubator/stanbol/trunk/integration-tests/src/test/java/org/apache/stanbol/ontologymanager/web/it/ScopeTest.java (original)
+++ incubator/stanbol/trunk/integration-tests/src/test/java/org/apache/stanbol/ontologymanager/web/it/ScopeTest.java Thu Jun 30 18:17:49 2011
@@ -1,5 +1,7 @@
 package org.apache.stanbol.ontologymanager.web.it;
 
+import static org.junit.Assert.assertFalse;
+
 import java.io.IOException;
 
 import org.junit.Test;
@@ -107,10 +109,10 @@ public class ScopeTest extends StanbolTe
         );
 
         // get in RDF_XML format
-        /*executor.execute(
+        executor.execute(
             builder.buildGetRequest(SCOPE2_URI)
             .withHeader("Accept",KRFormat.RDF_XML)
-        ).assertStatus(200);*/
+        ).assertStatus(200);
 
     }
 
@@ -123,22 +125,19 @@ public class ScopeTest extends StanbolTe
     public void testActiveVsAll() throws Exception {
 
         // The needed Web resources to GET from.
-        log.debug("Request: "+ONTOLOGY_URI);
-        RequestExecutor resActive = executor.execute(
+        executor.execute(
             builder.buildGetRequest(ONTOLOGY_URI)
-        );
-        log.debug(resActive.getContent());
+            .withHeader("Accept",KRFormat.RDF_XML)
+        ).assertStatus(200);
         log.info("Request: "+ONTOLOGY_URI +" ... DONE");
 
-        log.debug("Request: "+ONTOLOGY_URI+"?with-inactive=true");
-        RequestExecutor resAllScopes = executor.execute(
-            builder.buildGetRequest(ONTOLOGY_URI+"?with-inactive=true")
-        );
-        log.debug(resAllScopes.getContent());
+        executor.execute(
+            builder.buildGetRequest(ONTOLOGY_URI,"with-inactive","true")
+            .withHeader("Accept",KRFormat.RDF_XML)
+        ).assertStatus(200);
         log.info("Request: "+ONTOLOGY_URI+"?with-inactive=true"+" ... DONE");
 
         // Put a simple, inactive scope.
-        log.debug("Request: "+SCOPE_USER_URI+"?coreont=" + ONT_FOAF_URI);
         executor.execute(
             builder.buildOtherRequest( 
                 new HttpPut(
@@ -148,17 +147,15 @@ public class ScopeTest extends StanbolTe
 
         // Check that it is in the list of all scopes.
         executor.execute(
-            builder.buildGetRequest(SCOPE_USER_URI+"?with-inactive=true")
-        ).assertContentContains(SCOPE_USER_URI);
+            builder.buildGetRequest(SCOPE_USER_URI,"with-inactive","true")
+        ).assertStatus(200).assertContentContains(SCOPE_USER_URI);
 
         // Check that it is not in the list of active scopes.
         executor.execute(
             builder.buildGetRequest(SCOPE_USER_URI)
-        ).assertContentContains(SCOPE_USER_URI);
-
+        ).assertStatus(200).assertContentContains(SCOPE_USER_URI);
 
         // Now create a scope that is active on startup.
-        log.debug("Request: "+SCOPE_BIZ_URI+"?activate=true&coreont=" + ONT_PIZZA_URI);
         executor.execute(
             builder.buildOtherRequest( 
                 new HttpPut(
@@ -167,17 +164,15 @@ public class ScopeTest extends StanbolTe
         log.info("Request: "+SCOPE_BIZ_URI+"?activate=true&coreont=" + ONT_PIZZA_URI+" ... DONE");
 
         // Check that it appears in both sets.
-        /*executor.execute(
+        executor.execute(
             builder.buildGetRequest(ONTOLOGY_URI)
-        ).assertContentContains(SCOPE_BIZ_URI);
-
+            .withHeader("Accept",KRFormat.RDF_XML)
+        ).assertStatus(200).assertContentContains(SCOPE_BIZ_URI);
+        
         executor.execute(
-            builder.buildGetRequest(ONTOLOGY_URI+"?with-inactive=true")
-        ).assertContentContains(SCOPE_BIZ_URI);*/
-
-        //log.info(executor.execute(builder.buildGetRequest(ONTOLOGY_URI)).getContent());
-
-        //log.info(executor.execute(builder.buildGetRequest(ONTOLOGY_URI+"?with-inactive=true")).getContent());
+            builder.buildGetRequest(ONTOLOGY_URI,"with-inactive","true")
+            .withHeader("Accept",KRFormat.RDF_XML)
+        ).assertStatus(200).assertContentContains(SCOPE_BIZ_URI);
 
     }
 

Modified: incubator/stanbol/trunk/integration-tests/src/test/java/org/apache/stanbol/ontologymanager/web/it/SessionTest.java
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/integration-tests/src/test/java/org/apache/stanbol/ontologymanager/web/it/SessionTest.java?rev=1141647&r1=1141646&r2=1141647&view=diff
==============================================================================
--- incubator/stanbol/trunk/integration-tests/src/test/java/org/apache/stanbol/ontologymanager/web/it/SessionTest.java (original)
+++ incubator/stanbol/trunk/integration-tests/src/test/java/org/apache/stanbol/ontologymanager/web/it/SessionTest.java Thu Jun 30 18:17:49 2011
@@ -5,25 +5,31 @@ import static org.junit.Assert.assertTru
 import java.io.IOException;
 
 import org.junit.Test;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 import org.apache.http.client.ClientProtocolException;
 
 import org.apache.stanbol.commons.testing.stanbol.StanbolTestBase;
+import org.apache.stanbol.commons.web.base.format.KRFormat;
 
 public class SessionTest extends StanbolTestBase{
 
     public static final String ROOT_URI = "/ontonet";
 
     public static final String SESSION_URI = ROOT_URI + "/session";
+    
+    private static final Logger log = LoggerFactory.getLogger(SessionTest.class);
 
     @Test
     public void testSessionCreation() throws ClientProtocolException, IOException {
-
+        
         /*executor.execute(
             builder.buildPostRequest(SESSION_URI)
             .withHeader("Accept",KRFormat.RDF_XML)
         ).assertStatus(200);*/
         
         assertTrue(true);
+        
     }       
 }

Modified: incubator/stanbol/trunk/launchers/full/src/main/bundles/list.xml
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/launchers/full/src/main/bundles/list.xml?rev=1141647&r1=1141646&r2=1141647&view=diff
==============================================================================
--- incubator/stanbol/trunk/launchers/full/src/main/bundles/list.xml (original)
+++ incubator/stanbol/trunk/launchers/full/src/main/bundles/list.xml Thu Jun 30 18:17:49 2011
@@ -476,21 +476,68 @@
  
   <!-- KReS -->
   <startLevel level="22">
-    <bundle>
-	  <groupId>org.apache.stanbol</groupId>
-	  <artifactId>org.apache.stanbol.owl</artifactId>
-	  <version>0.9-SNAPSHOT</version>
+	<bundle>
+		<groupId>org.apache.stanbol</groupId>
+		<artifactId>org.apache.stanbol.owl</artifactId>
+		<version>0.9-SNAPSHOT</version>
     </bundle>
+	<!-- Stanbol OntoNet -->
 	<bundle>
-	  <groupId>org.apache.stanbol</groupId>
-	  <artifactId>org.apache.stanbol.ontologymanager.ontonet</artifactId>
-	  <version>0.9-SNAPSHOT</version>
+		<groupId>org.apache.stanbol</groupId>
+		<artifactId>org.apache.stanbol.ontologymanager.ontonet</artifactId>
+		<version>0.9-SNAPSHOT</version>
     </bundle>
+	<!-- Stanbol Rules -->
+	<bundle>
+		<groupId>org.apache.stanbol</groupId>
+		<artifactId>org.apache.stanbol.rules.base</artifactId>
+		<version>0.9-SNAPSHOT</version>
+	</bundle>
+	<bundle>
+		<groupId>org.apache.stanbol</groupId>
+		<artifactId>org.apache.stanbol.rules.manager</artifactId>
+		<version>0.9-SNAPSHOT</version>
+	</bundle>
+	<bundle>
+		<groupId>org.apache.stanbol</groupId>
+		<artifactId>org.apache.stanbol.rules.refactor</artifactId>
+		<version>0.9-SNAPSHOT</version>
+	</bundle>
+	<!-- Stanbol Reasoners (requires Rules) -->
+	<bundle>
+		<groupId>org.apache.stanbol</groupId>
+		<artifactId>org.apache.stanbol.reasoners.base</artifactId>
+		<version>0.9-SNAPSHOT</version>
+	</bundle>
+	<bundle>
+		<groupId>org.apache.stanbol</groupId>
+		<artifactId>org.apache.stanbol.reasoners.hermit</artifactId>
+		<version>0.9-SNAPSHOT</version>
+	</bundle>
+	<bundle>
+		<groupId>org.apache.stanbol</groupId>
+		<artifactId>org.apache.stanbol.reasoners.owllink</artifactId>
+		<version>0.9-SNAPSHOT</version>
+	</bundle>
+  </startLevel>
+    
+  <!-- KReS Web -->
+  <startLevel level="23">
 	<bundle>
    	  <groupId>org.apache.stanbol</groupId>
 	  <artifactId>org.apache.stanbol.ontologymanager.web</artifactId>
 	  <version>0.9-SNAPSHOT</version>
 	</bundle>
+	<bundle>
+		<groupId>org.apache.stanbol</groupId>
+		<artifactId>org.apache.stanbol.reasoners.web</artifactId>
+		<version>0.9-SNAPSHOT</version>
+	</bundle>
+	<bundle>
+		<groupId>org.apache.stanbol</groupId>
+		<artifactId>org.apache.stanbol.rules.web</artifactId>
+		<version>0.9-SNAPSHOT</version>
+	</bundle>
  </startLevel>
   
   <!-- Persistence Store Bundles

Added: incubator/stanbol/trunk/ontologymanager/web/src/main/resources/org/apache/stanbol/ontologymanager/web/templates/org/apache/stanbol/ontologymanager/web/resources/ONMRootResource/inc_sessionmgr.ftl
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/ontologymanager/web/src/main/resources/org/apache/stanbol/ontologymanager/web/templates/org/apache/stanbol/ontologymanager/web/resources/ONMRootResource/inc_sessionmgr.ftl?rev=1141647&view=auto
==============================================================================
--- incubator/stanbol/trunk/ontologymanager/web/src/main/resources/org/apache/stanbol/ontologymanager/web/templates/org/apache/stanbol/ontologymanager/web/resources/ONMRootResource/inc_sessionmgr.ftl (added)
+++ incubator/stanbol/trunk/ontologymanager/web/src/main/resources/org/apache/stanbol/ontologymanager/web/templates/org/apache/stanbol/ontologymanager/web/resources/ONMRootResource/inc_sessionmgr.ftl Thu Jun 30 18:17:49 2011
@@ -0,0 +1,55 @@
+<h4>Subresource ontonet/session</h4>
+<p>Service to get/clear the set of registered and/or active ontology scopes.
+
+<h4> GET ontonet/session</h4>
+<table>
+  <tbody>
+    <tr>
+      <th>Description</th>
+      <td>Service to get the set of registered and/or active ontology scopes</td>
+    </tr>
+    <tr>
+      <th>Request</th>
+      <td>GET <code>/ontonet/session</code></td>
+    </tr>
+    <tr>
+      <th>Parameter</th>
+      <td><code>with-inactive</code>: include registered inactive scopes (optional, default is false)</td>
+    </tr>
+    <tr>
+      <th>Produces</th>
+      <td>An ontology. Format depends on requested media type</td>
+    </tr>
+  </tbody>
+</table>
+
+<h5>Example</h5>
+
+<pre>curl -H &quot;Accept:application/rdf+xml&quot; "${it.publicBaseUri}ontonet/ontology?with-inactive=true</pre>
+
+
+<h4> DELETE ontonet/session</h4>
+<table>
+  <tbody>
+    <tr>
+      <th>Description</th>
+      <td>Service to clear all ontology scopes and stored ontologies</td>
+    </tr>
+    <tr>
+      <th>Request</th>
+      <td>DELETE <code>/ontonet/ontology</code></td>
+    </tr>
+        <tr>
+      <th>Parameters</th>
+      <td><span style="font-style:italic">none</span></td>
+    </tr>
+    <tr>
+      <th>Produces</th>
+      <td><span style="font-style:italic">nothing</span></td>
+    </tr>
+  </tbody>
+</table>
+
+<h5>Example</h5>
+
+<pre>curl -X DELETE "${it.publicBaseUri}ontonet/ontology</pre>
\ No newline at end of file

Added: incubator/stanbol/trunk/ontologymanager/web/src/main/resources/org/apache/stanbol/ontologymanager/web/templates/org/apache/stanbol/ontologymanager/web/resources/SessionResource/inc_sessionmgr.ftl
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/ontologymanager/web/src/main/resources/org/apache/stanbol/ontologymanager/web/templates/org/apache/stanbol/ontologymanager/web/resources/SessionResource/inc_sessionmgr.ftl?rev=1141647&view=auto
==============================================================================
--- incubator/stanbol/trunk/ontologymanager/web/src/main/resources/org/apache/stanbol/ontologymanager/web/templates/org/apache/stanbol/ontologymanager/web/resources/SessionResource/inc_sessionmgr.ftl (added)
+++ incubator/stanbol/trunk/ontologymanager/web/src/main/resources/org/apache/stanbol/ontologymanager/web/templates/org/apache/stanbol/ontologymanager/web/resources/SessionResource/inc_sessionmgr.ftl Thu Jun 30 18:17:49 2011
@@ -0,0 +1,55 @@
+<h4>Subresource ontonet/session</h4>
+<p>Service to get/clear the set of registered and/or active ontology scopes.
+
+<h4> GET ontonet/session</h4>
+<table>
+  <tbody>
+    <tr>
+      <th>Description</th>
+      <td>Service to get the set of registered and/or active ontology scopes</td>
+    </tr>
+    <tr>
+      <th>Request</th>
+      <td>GET <code>/ontonet/session</code></td>
+    </tr>
+    <tr>
+      <th>Parameter</th>
+      <td><code>with-inactive</code>: include registered inactive scopes (optional, default is false)</td>
+    </tr>
+    <tr>
+      <th>Produces</th>
+      <td>An ontology. Format depends on requested media type</td>
+    </tr>
+  </tbody>
+</table>
+
+<h5>Example</h5>
+
+<pre>curl -H &quot;Accept:application/rdf+xml&quot; "${it.publicBaseUri}ontonet/ontology?with-inactive=true</pre>
+
+
+<h4> DELETE ontonet/session</h4>
+<table>
+  <tbody>
+    <tr>
+      <th>Description</th>
+      <td>Service to clear all ontology scopes and stored ontologies</td>
+    </tr>
+    <tr>
+      <th>Request</th>
+      <td>DELETE <code>/ontonet/ontology</code></td>
+    </tr>
+        <tr>
+      <th>Parameters</th>
+      <td><span style="font-style:italic">none</span></td>
+    </tr>
+    <tr>
+      <th>Produces</th>
+      <td><span style="font-style:italic">nothing</span></td>
+    </tr>
+  </tbody>
+</table>
+
+<h5>Example</h5>
+
+<pre>curl -X DELETE "${it.publicBaseUri}ontonet/ontology</pre>
\ No newline at end of file

Modified: incubator/stanbol/trunk/ontologymanager/web/src/main/resources/org/apache/stanbol/ontologymanager/web/templates/org/apache/stanbol/ontologymanager/web/resources/SessionResource/index.ftl
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/ontologymanager/web/src/main/resources/org/apache/stanbol/ontologymanager/web/templates/org/apache/stanbol/ontologymanager/web/resources/SessionResource/index.ftl?rev=1141647&r1=1141646&r2=1141647&view=diff
==============================================================================
--- incubator/stanbol/trunk/ontologymanager/web/src/main/resources/org/apache/stanbol/ontologymanager/web/templates/org/apache/stanbol/ontologymanager/web/resources/SessionResource/index.ftl (original)
+++ incubator/stanbol/trunk/ontologymanager/web/src/main/resources/org/apache/stanbol/ontologymanager/web/templates/org/apache/stanbol/ontologymanager/web/resources/SessionResource/index.ftl Thu Jun 30 18:17:49 2011
@@ -7,6 +7,9 @@
     <div class="panel" id="webview">
       <p>This is the start page of the ontology session manager.</p>
     </div>
+    
+    <hr>
+    <#include "inc_sessionmgr.ftl">
 
   </...@common.page>
 </#escape>
\ No newline at end of file

Modified: incubator/stanbol/trunk/pom.xml
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/pom.xml?rev=1141647&r1=1141646&r2=1141647&view=diff
==============================================================================
--- incubator/stanbol/trunk/pom.xml (original)
+++ incubator/stanbol/trunk/pom.xml Thu Jun 30 18:17:49 2011
@@ -54,6 +54,7 @@
     <module>ontologymanager/ontonet</module>
     <module>ontologymanager/web</module>
     <module>rules</module>
+    <module>reasoners</module>
     <module>launchers/stable</module>
     <module>launchers/stateless</module>
     <module>launchers/full</module>
@@ -73,7 +74,6 @@
         <module>ontologymanager/store</module>
         <!--module>rules</module-->
         <module>reengineer</module>
-        <module>reasoners</module>
         <module>launchers/kres</module>
       </modules>
     </profile>

Modified: incubator/stanbol/trunk/reasoners/pom.xml
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/reasoners/pom.xml?rev=1141647&r1=1141646&r2=1141647&view=diff
==============================================================================
--- incubator/stanbol/trunk/reasoners/pom.xml (original)
+++ incubator/stanbol/trunk/reasoners/pom.xml Thu Jun 30 18:17:49 2011
@@ -44,8 +44,8 @@
     <module>../owl</module>  
     <module>../rules/base</module>  
     <module>../rules/manager</module-->
-    <module>base</module>
     <module>hermit</module>
+    <module>base</module>
     <module>owllink</module>
     <module>web</module>
   </modules>

Modified: incubator/stanbol/trunk/reasoners/web/src/main/java/org/apache/stanbol/reasoners/web/ReasonersFragment.java
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/reasoners/web/src/main/java/org/apache/stanbol/reasoners/web/ReasonersFragment.java?rev=1141647&r1=1141646&r2=1141647&view=diff
==============================================================================
--- incubator/stanbol/trunk/reasoners/web/src/main/java/org/apache/stanbol/reasoners/web/ReasonersFragment.java (original)
+++ incubator/stanbol/trunk/reasoners/web/src/main/java/org/apache/stanbol/reasoners/web/ReasonersFragment.java Thu Jun 30 18:17:49 2011
@@ -14,12 +14,14 @@ import org.apache.stanbol.commons.web.ba
 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.ontologymanager.ontonet.api.ONManager;
 import org.apache.stanbol.reasoners.base.api.Reasoner;
 import org.apache.stanbol.reasoners.web.resources.Classify;
 import org.apache.stanbol.reasoners.web.resources.ConsistencyCheck;
 import org.apache.stanbol.reasoners.web.resources.ConsistentRefactoring;
 import org.apache.stanbol.reasoners.web.resources.Enrichment;
 import org.apache.stanbol.reasoners.web.resources.ReasonersResource;
+import org.apache.stanbol.rules.base.api.RuleStore;
 import org.osgi.framework.BundleContext;
 import org.osgi.service.component.ComponentContext;
 
@@ -46,6 +48,12 @@ public class ReasonersFragment implement
     
     @Reference
     Reasoner reasoners;
+    
+    @Reference
+    ONManager onm;
+    
+    @Reference
+    RuleStore kresRuleStore;
 
     private BundleContext bundleContext;
     

Modified: incubator/stanbol/trunk/reasoners/web/src/main/java/org/apache/stanbol/reasoners/web/resources/Classify.java
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/reasoners/web/src/main/java/org/apache/stanbol/reasoners/web/resources/Classify.java?rev=1141647&r1=1141646&r2=1141647&view=diff
==============================================================================
--- incubator/stanbol/trunk/reasoners/web/src/main/java/org/apache/stanbol/reasoners/web/resources/Classify.java (original)
+++ incubator/stanbol/trunk/reasoners/web/src/main/java/org/apache/stanbol/reasoners/web/resources/Classify.java Thu Jun 30 18:17:49 2011
@@ -65,6 +65,7 @@ import com.hp.hpl.jena.rdf.model.ModelFa
 import com.hp.hpl.jena.rdf.model.Resource;
 import com.sun.jersey.multipart.FormDataParam;
 
+import org.apache.stanbol.commons.web.base.ContextHelper;
 import org.apache.stanbol.commons.web.base.format.KRFormat;
 import org.apache.stanbol.commons.web.base.resource.BaseStanbolResource;
 
@@ -81,6 +82,7 @@ public class Classify extends BaseStanbo
 
 	protected ONManager onm;
 	protected ClerezzaOntologyStorage storage;
+	protected ServletContext servletContext;
 
 	private Logger log = LoggerFactory.getLogger(getClass());
 
@@ -91,28 +93,15 @@ public class Classify extends BaseStanbo
 	 *            {To get the context where the REST service is running.}
      */
     public Classify(@Context ServletContext servletContext){
-		this.kresRuleStore = (RuleStore) servletContext
-				.getAttribute(RuleStore.class.getName());
-		this.onm = (ONManager) servletContext
-				.getAttribute(ONManager.class.getName());
-//      this.storage = (OntologyStorage) servletContext
-//      .getAttribute(OntologyStorage.class.getName());
-// Contingency code for missing components follows.
-/*
- * FIXME! The following code is required only for the tests. This should
- * be removed and the test should work without this code.
- */
-if (onm == null) {
-    log
-            .warn("No KReSONManager in servlet context. Instantiating manually...");
-    onm = new ONManagerImpl(new TcManager(), null,
-            new Hashtable<String, Object>());
-}
-this.storage = onm.getOntologyStore();
-if (storage == null) {
-    log.warn("No OntologyStorage in servlet context. Instantiating manually...");
-    storage = new ClerezzaOntologyStorage(new TcManager(),null);
-}
+        this.servletContext = servletContext;
+
+        // Retrieve the rule store
+        this.kresRuleStore = (RuleStore) ContextHelper.getServiceFromContext(RuleStore.class, servletContext);
+        
+		// Retrieve the ontology network manager
+        this.onm = (ONManager) ContextHelper.getServiceFromContext(ONManager.class, servletContext);
+        this.storage = (ClerezzaOntologyStorage) ContextHelper.getServiceFromContext(ClerezzaOntologyStorage.class, servletContext);
+       
        if (kresRuleStore == null) {
 			log
 					.warn("No KReSRuleStore with stored rules and recipes found in servlet context. Instantiating manually with default values...");
@@ -220,10 +209,13 @@ if (storage == null) {
 			@FormDataParam(value = "input-graph") String input_graph,
 			@FormDataParam(value = "file") File file,
 			@FormDataParam(value = "owllink-endpoint") String owllink_endpoint) {
-       
+      
+        if(true)
+            return Response.status(Status.OK).build();
       try{
       
       if((session!=null)&&(scope==null)){
+           log.error("ERROR: Cannot load session without scope.");
            System.err.println("ERROR: Cannot load session without scope.");
            return Response.status(Status.BAD_REQUEST).build();
         }

Modified: incubator/stanbol/trunk/reasoners/web/src/main/java/org/apache/stanbol/reasoners/web/resources/ConsistencyCheck.java
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/reasoners/web/src/main/java/org/apache/stanbol/reasoners/web/resources/ConsistencyCheck.java?rev=1141647&r1=1141646&r2=1141647&view=diff
==============================================================================
--- incubator/stanbol/trunk/reasoners/web/src/main/java/org/apache/stanbol/reasoners/web/resources/ConsistencyCheck.java (original)
+++ incubator/stanbol/trunk/reasoners/web/src/main/java/org/apache/stanbol/reasoners/web/resources/ConsistencyCheck.java Thu Jun 30 18:17:49 2011
@@ -6,6 +6,7 @@ import java.util.Hashtable;
 import java.util.Iterator;
 import java.util.LinkedList;
 import java.util.List;
+import java.util.Map;
 import java.util.Set;
 
 import javax.servlet.ServletContext;
@@ -15,6 +16,7 @@ import javax.ws.rs.GET;
 import javax.ws.rs.POST;
 import javax.ws.rs.Path;
 import javax.ws.rs.PathParam;
+import javax.ws.rs.QueryParam;
 import javax.ws.rs.WebApplicationException;
 import javax.ws.rs.core.Context;
 import javax.ws.rs.core.MediaType;
@@ -22,6 +24,7 @@ import javax.ws.rs.core.Response;
 import javax.ws.rs.core.Response.Status;
 
 import org.apache.clerezza.rdf.core.access.TcManager;
+import org.apache.stanbol.commons.web.base.ContextHelper;
 import org.apache.stanbol.commons.web.base.resource.BaseStanbolResource;
 import org.apache.stanbol.ontologymanager.ontonet.api.ONManager;
 import org.apache.stanbol.ontologymanager.ontonet.api.OWLDuplicateSafeLoader;
@@ -82,6 +85,8 @@ public class ConsistencyCheck extends Ba
 	private final OWLDuplicateSafeLoader loader = new OWLDuplicateSafeLoader();
 	protected ONManager onm;
 	protected ClerezzaOntologyStorage storage;
+	
+	protected ServletContext servletContext;
 
 	private Logger log = LoggerFactory.getLogger(getClass());
 
@@ -92,31 +97,15 @@ public class ConsistencyCheck extends Ba
 	 *            {To get the context where the REST service is running.}
 	 */
 	public ConsistencyCheck(@Context ServletContext servletContext) {
-
+	    this.servletContext = servletContext;
+        
 		// Retrieve the rule store
-		this.kresRuleStore = (RuleStore) servletContext
-				.getAttribute(RuleStore.class.getName());
+	    this.kresRuleStore = (RuleStore) ContextHelper.getServiceFromContext(RuleStore.class, servletContext);
+		
 		// Retrieve the ontology network manager
-		this.onm = (ONManager) servletContext
-				.getAttribute(ONManager.class.getName());
-//      this.storage = (OntologyStorage) servletContext
-//      .getAttribute(OntologyStorage.class.getName());
-// Contingency code for missing components follows.
-/*
- * FIXME! The following code is required only for the tests. This should
- * be removed and the test should work without this code.
- */
-if (onm == null) {
-    log
-            .warn("No KReSONManager in servlet context. Instantiating manually...");
-    onm = new ONManagerImpl(new TcManager(), null,
-            new Hashtable<String, Object>());
-}
-this.storage = onm.getOntologyStore();
-if (storage == null) {
-    log.warn("No OntologyStorage in servlet context. Instantiating manually...");
-    storage = new ClerezzaOntologyStorage(new TcManager(),null);
-}
+		this.onm = (ONManager) ContextHelper.getServiceFromContext(ONManager.class, servletContext);
+        this.storage = (ClerezzaOntologyStorage) ContextHelper.getServiceFromContext(ClerezzaOntologyStorage.class, servletContext);
+        
 		if (kresRuleStore == null) {
 			log
 					.warn("No KReSRuleStore with stored rules and recipes found in servlet context. Instantiating manually with default values...");
@@ -204,10 +193,15 @@ if (storage == null) {
 	 *         500 Some error occurred.
 	 */
 	@GET
-	@Path("/{uri:.+}")
+	//@Path("{uri:.+}")
 	public Response GetSimpleConsistencyCheck(
-			@PathParam(value = "uri") String uri) {
-		log.debug("Start simple consistency check with input: "+uri, this);
+			@QueryParam("uri") String uri) {
+		log.info("Start simple consistency check with input: "+uri, this);
+		
+		if(uri==null){
+		    return Response.status(Status.BAD_REQUEST).build();
+		}
+		
 		try {
 			boolean ok = false;
 			OWLOntology owl;
@@ -286,16 +280,21 @@ if (storage == null) {
 	 *         500 Some error occurred
 	 */
 	@POST
-	@Consumes(MediaType.MULTIPART_FORM_DATA)
+	//@Consumes(MediaType.MULTIPART_FORM_DATA)
+	@Consumes("multipart/form-data")
 	public Response getConsistencyCheck(
 			@FormDataParam(value = "session") String session,
 			@FormDataParam(value = "scope") String scope,
 			@FormDataParam(value = "recipe") String recipe,
 			@FormDataParam(value = "input-graph") String input_graph,
 			@FormDataParam(value = "file") File file,
-			@FormDataParam(value = "owllink-endpoint") String owllink_endpoint) {
+			@FormDataParam(value = "owllink-endpoint") String owllink_endpoint
+	) {
 
-		try {
+	    log.info("Start consistency check.", this);
+        return Response.status(Status.OK).build();
+	    
+		/*try {
 
 			if ((session != null) && (scope == null)) {
 				log.error("Cannot load session without scope.", this);
@@ -515,7 +514,7 @@ if (storage == null) {
 
 		} catch (Exception e) {
 			throw new WebApplicationException(e, Status.INTERNAL_SERVER_ERROR);
-		}
+		}*/
 
 	}
 

Modified: incubator/stanbol/trunk/reasoners/web/src/main/java/org/apache/stanbol/reasoners/web/resources/Enrichment.java
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/reasoners/web/src/main/java/org/apache/stanbol/reasoners/web/resources/Enrichment.java?rev=1141647&r1=1141646&r2=1141647&view=diff
==============================================================================
--- incubator/stanbol/trunk/reasoners/web/src/main/java/org/apache/stanbol/reasoners/web/resources/Enrichment.java (original)
+++ incubator/stanbol/trunk/reasoners/web/src/main/java/org/apache/stanbol/reasoners/web/resources/Enrichment.java Thu Jun 30 18:17:49 2011
@@ -25,6 +25,7 @@ import javax.ws.rs.core.Response;
 import javax.ws.rs.core.Response.Status;
 
 import org.apache.clerezza.rdf.core.access.TcManager;
+import org.apache.stanbol.commons.web.base.ContextHelper;
 import org.apache.stanbol.commons.web.base.resource.BaseStanbolResource;
 import org.apache.stanbol.ontologymanager.ontonet.api.ONManager;
 import org.apache.stanbol.ontologymanager.ontonet.api.ontology.OntologyScope;
@@ -80,6 +81,7 @@ public class Enrichment extends BaseStan
 
 	protected ONManager onm;
 	protected ClerezzaOntologyStorage storage;
+	protected ServletContext servletContext;
 
 	private Logger log = LoggerFactory.getLogger(getClass());
 
@@ -90,30 +92,15 @@ public class Enrichment extends BaseStan
 	 *            {To get the context where the REST service is running.}
      */
     public Enrichment(@Context ServletContext servletContext){
+        this.servletContext = servletContext;
+        
 		// Retrieve the rule store
-		this.kresRuleStore = (RuleStore) servletContext
-				.getAttribute(RuleStore.class.getName());
+		this.kresRuleStore = (RuleStore) ContextHelper.getServiceFromContext(RuleStore.class, servletContext);
+		
 		// Retrieve the ontology network manager
-		this.onm = (ONManager) servletContext
-				.getAttribute(ONManager.class.getName());
-//      this.storage = (OntologyStorage) servletContext
-//      .getAttribute(OntologyStorage.class.getName());
-// Contingency code for missing components follows.
-/*
- * FIXME! The following code is required only for the tests. This should
- * be removed and the test should work without this code.
- */
-if (onm == null) {
-    log
-            .warn("No KReSONManager in servlet context. Instantiating manually...");
-    onm = new ONManagerImpl(new TcManager(), null,
-            new Hashtable<String, Object>());
-}
-this.storage = onm.getOntologyStore();
-if (storage == null) {
-    log.warn("No OntologyStorage in servlet context. Instantiating manually...");
-    storage = new ClerezzaOntologyStorage(new TcManager(),null);
-}
+		this.onm = (ONManager) ContextHelper.getServiceFromContext(ONManager.class, servletContext);
+        this.storage = (ClerezzaOntologyStorage) ContextHelper.getServiceFromContext(ClerezzaOntologyStorage.class, servletContext);
+        
        if (kresRuleStore == null) {
 			log
 					.warn("No KReSRuleStore with stored rules and recipes found in servlet context. Instantiating manually with default values...");