You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@stanbol.apache.org by co...@apache.org on 2011/06/14 13:12:37 UTC

svn commit: r1135486 [12/12] - in /incubator/stanbol/trunk: launchers/kres/ ontologymanager/ontonet/src/main/java/org/apache/stanbol/ontologymanager/ontonet/impl/renderers/ ontologymanager/web/src/main/java/org/apache/stanbol/ontologymanager/web/resour...

Added: incubator/stanbol/trunk/reasoners/demo/integritycheck/src/main/resources/META-INF/templates/org/apache/stanbol/intcheck/resource/RESTfulResource/index.ftl
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/reasoners/demo/integritycheck/src/main/resources/META-INF/templates/org/apache/stanbol/intcheck/resource/RESTfulResource/index.ftl?rev=1135486&view=auto
==============================================================================
--- incubator/stanbol/trunk/reasoners/demo/integritycheck/src/main/resources/META-INF/templates/org/apache/stanbol/intcheck/resource/RESTfulResource/index.ftl (added)
+++ incubator/stanbol/trunk/reasoners/demo/integritycheck/src/main/resources/META-INF/templates/org/apache/stanbol/intcheck/resource/RESTfulResource/index.ftl Tue Jun 14 11:12:32 2011
@@ -0,0 +1,1520 @@
+<#import "/imports/common.ftl" as common>
+<#escape x as x?html>
+<@common.page title="RESTful services">
+
+<!-- start of file -->
+<style type="text/css">
+
+table {
+    border-collapse:collapse;
+    border: 1px solid;
+}
+table th,
+table td{
+    padding: 5px;
+    font-size: 0.8em;
+   }
+pre{
+    margin:10px 0px;
+    overflow:auto;
+}
+</style>
+
+<UL class="indent">
+<LI><A NAME="tex2html559"
+  HREF="#SECTION000114100000000000000">/ontonet/ontology</A>
+<UL>
+<LI><A NAME="tex2html560"
+  HREF="#SECTION000114110000000000000">GET</A>
+<LI><A NAME="tex2html561"
+  HREF="#SECTION000114120000000000000">PUT</A>
+<LI><A NAME="tex2html562"
+  HREF="#SECTION000114130000000000000">POST</A>
+<LI><A NAME="tex2html563"
+  HREF="#SECTION000114140000000000000">DELETE</A>
+</UL>
+<BR>
+<LI><A NAME="tex2html564"
+  HREF="#SECTION000114200000000000000">/ontonet/session</A>
+<UL>
+<LI><A NAME="tex2html565"
+  HREF="#SECTION000114210000000000000">GET</A>
+<LI><A NAME="tex2html566"
+  HREF="#SECTION000114220000000000000">POST</A>
+<LI><A NAME="tex2html567"
+  HREF="#SECTION000114230000000000000">PUT</A>
+<LI><A NAME="tex2html568"
+  HREF="#SECTION000114240000000000000">DELETE</A>
+</UL>
+<BR>
+<LI><A NAME="tex2html569"
+  HREF="#SECTION000114300000000000000">/rule</A>
+<UL>
+<LI><A NAME="tex2html570"
+  HREF="#SECTION000114310000000000000">GET</A>
+<LI><A NAME="tex2html571"
+  HREF="#SECTION000114320000000000000">POST</A>
+<LI><A NAME="tex2html572"
+  HREF="#SECTION000114330000000000000">DELETE</A>
+</UL>
+<BR>
+<LI><A NAME="tex2html573"
+  HREF="#SECTION000114400000000000000">/recipe</A>
+<UL>
+<LI><A NAME="tex2html574"
+  HREF="#SECTION000114410000000000000">GET</A>
+<LI><A NAME="tex2html575"
+  HREF="#SECTION000114420000000000000">POST</A>
+<LI><A NAME="tex2html576"
+  HREF="#SECTION000114430000000000000">DELETE</A>
+</UL>
+<BR>
+<LI><A NAME="tex2html577"
+  HREF="#SECTION000114500000000000000">/reasoner/classify</A>
+<LI><A NAME="tex2html578"
+  HREF="#SECTION000114600000000000000">/reasoner/check-consistency</A>
+<UL>
+<LI><A NAME="tex2html579"
+  HREF="#SECTION000114610000000000000">GET</A>
+<LI><A NAME="tex2html580"
+  HREF="#SECTION000114620000000000000">POST</A>
+</UL>
+<BR>
+<LI><A NAME="tex2html581"
+  HREF="#SECTION000114700000000000000">/reasoner/enrich</A>
+<LI><A NAME="tex2html582"
+  HREF="#SECTION000114800000000000000">/refactor (/lazy and /consistent)</A>
+<UL>
+<LI><A NAME="tex2html583"
+  HREF="#SECTION000114810000000000000">GET</A>
+<LI><A NAME="tex2html584"
+  HREF="#SECTION000114820000000000000">POST</A>
+</UL>
+<BR>
+<LI><A NAME="tex2html585"
+  HREF="#SECTION000114900000000000000">/reengineer/reengineer</A>
+<UL>
+<LI><A NAME="tex2html586"
+  HREF="#SECTION000114910000000000000">Input is a document (Mime-type based)</A>
+<LI><A NAME="tex2html587"
+  HREF="#SECTION000114920000000000000">Input is a DBMS connection</A>
+</UL></UL>
+<!--End of Table of Child-Links-->
+<HR>
+
+<H3><A NAME="SECTION000114000000000000000"></A>
+<A NAME="sec:restful"></A>
+<BR>
+
+<FONT COLOR="#000000">RESTful services</FONT>
+</H3>
+KReS functionalities can be exploited by client applications through a set of RESTful services. In this section we give an overview of the services, with few examples on how can be queried using the command line tool <TT>cURL</TT><A NAME="tex2html75"
+  HREF="footnode.html#foot1829"><SUP>36</SUP></A> (the syntax and supported options can change depending on the tool version and operating system). All services returns data in RDF compliant formats.
+
+<P>
+
+<H3><A NAME="SECTION000114100000000000000">
+/ontonet/ontology</A>
+</H3>
+This service provides access and management to ontology scopes in KReS. With this service, client applications can add, remove or modify scopes. Such modifications are globally shared, since they are performed internally in the <I>custom</I> space. Ontologies added at scope creation time can also be placed in the <I>core</I> space, and are then not removable. All changes in the network performed by this service are shared globally by any KReS component. In the future, this services will be probably restricted to a sub-set of users with controlled policies.
+
+<P>
+Supported HTTP methods are: <B>GET</B>, <B>PUT</B>, <B>POST</B>, <B>DELETE</B>
+
+<P>
+
+<H4><A NAME="SECTION000114110000000000000">
+GET</A>
+</H4> method provides access to scopes and ontologies. This method can be used to obtain the globally shared version of the scope (it represents the <I>custom</I> space):
+
+<OL>
+<LI>The active scopes
+</LI>
+<LI>All the scopes
+</LI>
+<LI>A particular ontology
+</LI>
+</OL>
+
+<P>
+Supported parameters for <B>GET</B> requests are: 
+<BR><TABLE CELLPADDING=3 BORDER="1" WIDTH="100%">
+<TR><TH ALIGN="LEFT"><B>Parameter</B></TH>
+<TH ALIGN="LEFT"><B>Mandatory</B></TH>
+<TH ALIGN="LEFT" VALIGN="TOP" WIDTH=283><B>Description</B></TH>
+</TR>
+<TR><TH ALIGN="LEFT"><I>with-inactive</I></TH>
+<TD ALIGN="LEFT">N</TD>
+<TD ALIGN="LEFT" VALIGN="TOP" WIDTH=283>If set to <B>true</B> will obtain information about all the scopes</TD>
+</TR>
+<TR><TH ALIGN="LEFT"><I>session</I></TH>
+<TD ALIGN="LEFT">N</TD>
+<TD ALIGN="LEFT" VALIGN="TOP" WIDTH=283>If set will return a specific session space over the scope</TD>
+</TR>
+</TABLE>
+
+<P>
+The following are three examples on how to obtain information about the scopes:
+<PRE>
+ $ curl -X GET -H "Accept: text/turtle" \
+     http://localhost:8080/ontonet/ontology
+
+ $ curl -X GET -H "Accept: text/turtle" \
+     http://localhost:8080/ontonet/ontology?with-inactive=true
+</PRE>
+
+<P>
+Get the root ontology for the scope 'User'.
+<PRE>
+ $ curl -X GET -H "Accept: text/turtle" \
+     http://localhost:8080/ontonet/ontology/User
+</PRE>
+
+<P>
+Next, the exact version of ontology FOAF that is loaded within scope 'User':
+
+<P>
+<PRE>
+ $ curl -X GET -H "Accept: text/turtle" \
+	http://localhost:8080/ontonet/ontology/User/http://xmlns.com/foaf/0.1/
+</PRE>
+
+<P>
+Notice how FOAF must be addressed to by its logical URI, not the physical one (as could be, for instance, <TT><A NAME="tex2html77"
+  HREF="http://xmlns.com/foaf/spec/index.rdf">http://xmlns.com/foaf/spec/index.rdf</A></TT>).
+
+<P>
+The last requests GETs an ontology within the network, regardless of the scope where it is loaded:
+<PRE>
+ $ curl -X GET -H "Accept: text/turtle" \
+http://localhost:8080/ontonet/ontology/get
+    ?iri=http://www.ontologydesignpatterns.org/cp/owl/agentrole.owl
+</PRE>
+
+<P>
+In all cases the following responses can be obtained:
+<DL>
+<DT><STRONG>200</STRONG></DT>
+<DD>Data is retrieved
+ 
+</DD>
+<DT><STRONG>404</STRONG></DT>
+<DD>The scope/ontology does not exists in the network
+ 
+</DD>
+<DT><STRONG>500</STRONG></DT>
+<DD>Some error occurred
+</DD>
+</DL>
+
+<P>
+
+<H4><A NAME="SECTION000114120000000000000">
+PUT</A>
+</H4> method is used to create a new ontology scope. Ontologies can be added as single or referring to an ontology registry.
+
+<P>
+Supported parameters for <B>PUT</B> request: 
+<BR>
+<P>
+<TABLE CELLPADDING=3 BORDER="1" WIDTH="100%">
+<TR><TH ALIGN="LEFT"><B>Parameter</B></TH>
+<TH ALIGN="LEFT"><B>Mandatory</B></TH>
+<TH ALIGN="LEFT" VALIGN="TOP" WIDTH=283><B>Description</B></TH>
+</TR>
+<TR><TH ALIGN="LEFT"><I>coreont</I></TH>
+<TD ALIGN="LEFT">N</TD>
+<TD ALIGN="LEFT" VALIGN="TOP" WIDTH=283>An ontology to be added in the core space of the newly created scope (immutable) 
+
+<P>
+<B>Cannot be used in conjunction with <I>corereg</I></B>.</TD>
+</TR>
+<TR><TH ALIGN="LEFT"><I>corereg</I></TH>
+<TD ALIGN="LEFT">N</TD>
+<TD ALIGN="LEFT" VALIGN="TOP" WIDTH=283>An ontology registry to be added in the core space of the scope (immutable)
+
+<P>
+<B>Cannot be used in conjunction with <I>coreont</I></B>.</TD>
+</TR>
+<TR><TH ALIGN="LEFT"><I>customont</I></TH>
+<TD ALIGN="LEFT">N</TD>
+<TD ALIGN="LEFT" VALIGN="TOP" WIDTH=283>An ontology to be added in the custom space of the newly created scope (mutable) 
+
+<P>
+<B>Cannot be used in conjunction with <I>customreg</I></B>.</TD>
+</TR>
+<TR><TH ALIGN="LEFT"><I>customreg</I></TH>
+<TD ALIGN="LEFT">N</TD>
+<TD ALIGN="LEFT" VALIGN="TOP" WIDTH=283>An ontology registry to be added in the custom space of the scope (mutable)
+
+<P>
+<B>Cannot be used in conjunction with <I>corereg</I></B>.</TD>
+</TR>
+<TR><TH ALIGN="LEFT"><I>activate</I></TH>
+<TD ALIGN="LEFT">N</TD>
+<TD ALIGN="LEFT" VALIGN="TOP" WIDTH=283>[true|false] Wheather activate the newly created. Default value is false.  <I>scope</I></TD>
+</TR>
+</TABLE>
+
+<P>
+The following creates the <I>User</I> scope and adds the FOAF ontology to the core space:
+
+<P>
+<PRE>
+  $ curl -X PUT -G \
+   -d coreont="http://xmlns.com/foaf/spec/index.rdf" \
+     http://localhost:8080/ontonet/ontology/User
+</PRE>
+
+<P>
+The next example creates the new ontology scope 'User' with the FOAF vocabulary as a core ontology and the ontologies from the 'KReStest' registry as custom ontologies:
+
+<P>
+<PRE>
+ $ curl -X PUT  -G \
+   -d coreont="http://xmlns.com/foaf/spec/index.rdf" \
+   -d customreg="http://www.ontologydesignpatterns.org/registry/krestest.owl" \
+     http://localhost:8080/ontonet/ontology/User
+</PRE>
+
+<P>
+
+<H4><A NAME="SECTION000114130000000000000">
+POST</A>
+</H4>
+Ontologies can be added to a scope through the POST request. Modifications have affect in the <I>custom space</I>, this means that the ontology can then be removed by a DELETE request.
+
+<P>
+Supported parameters for <B>POST</B> requests are: 
+<BR><TABLE CELLPADDING=3 BORDER="1" WIDTH="100%">
+<TR><TH ALIGN="LEFT"><B>Parameter</B></TH>
+<TH ALIGN="LEFT"><B>Mandatory</B></TH>
+<TH ALIGN="LEFT" VALIGN="TOP" WIDTH=283><B>Description</B></TH>
+</TR>
+<TR><TH ALIGN="LEFT"><I>location</I></TH>
+<TD ALIGN="LEFT">Y</TD>
+<TD ALIGN="LEFT" VALIGN="TOP" WIDTH=283>The physical IRI of the ontology to load in the scope.</TD>
+</TR>
+</TABLE>
+
+<P>
+Here is an example with the dummy scope User:
+
+<P>
+Load an ontology into the custom space of ontology scope 'User':
+<PRE>
+ $ curl -X POST \
+	-F location="http://www.ontologydesignpatterns.org/cp/owl/agentrole.owl" \
+	http://localhost:8080/ontonet/ontology/User
+</PRE>
+
+<P>
+Possible responses can be:
+<DL>
+<DT><STRONG>200</STRONG></DT>
+<DD>The ontology has been loaded
+ 
+</DD>
+<DT><STRONG>404</STRONG></DT>
+<DD>The ontology to be loaded does not exists or the target scope is not available
+ 
+</DD>
+<DT><STRONG>500</STRONG></DT>
+<DD>Some error occurred 
+</DD>
+</DL>
+
+<P>
+
+<H4><A NAME="SECTION000114140000000000000">
+DELETE</A>
+</H4> method ca be used to unload resources from the ontology network manager. To unload an ontology from a Scope the following request is sufficient:
+
+<P>
+<PRE>
+ $ curl -X DELETE -G \
+	http://localhost:8080/ontonet/ontology/User/http://xmlns.com/foaf/0.1/
+</PRE>
+
+<P>
+To deregister (=&gt;deactivate and remove) a scope 'User':
+<PRE>
+ $ curl -X DELETE \
+	http://localhost:8080/ontonet/ontology/User
+</PRE>
+
+<P>
+Possible responses can be:
+<DL>
+<DT><STRONG>204</STRONG></DT>
+<DD>The ontology/scope has been deleted
+ 
+</DD>
+<DT><STRONG>500</STRONG></DT>
+<DD>Some error occurred 
+</DD>
+</DL>
+
+<P>
+
+<H3><A NAME="SECTION000114200000000000000">
+/ontonet/session</A>
+</H3>
+Sessions can be created and used for accessing ontology scopes without making the changes to the model to be shared by other applications or components.
+
+<P>
+The session IRI can then be used as parameter in addition of the scope (to indicate the space to be read from) in other high level services (such classification or enrichment).
+
+<P>
+Supported HTTP methods: <B>GET</B>, to retrieve a session; <B>POST</B>, to create sessions; <B>PUT</B>, to add ontologies to the session;   <B>DELETE</B>, to remove ontologies from the session or to delete the session. 
+<BR>
+<P>
+
+<H4><A NAME="SECTION000114210000000000000">
+GET</A>
+</H4> can be used to retrieve the session metadata. The session IRI must follow the base IRI of the service in this way:
+
+<P>
+<PRE>
+ $ curl -X GET http://localhost:8080/ontonet/session/http://session-iri
+</PRE>
+
+<P>
+
+<H4><A NAME="SECTION000114220000000000000">
+POST</A>
+</H4> request creates a new session.
+
+<P>
+Supported parameters are: 
+<BR>
+<P>
+<TABLE CELLPADDING=3 BORDER="1" WIDTH="100%">
+<TR><TH ALIGN="LEFT"><B>Parameter</B></TH>
+<TH ALIGN="LEFT"><B>Mandatory</B></TH>
+<TH ALIGN="LEFT" VALIGN="TOP" WIDTH=283><B>Description</B></TH>
+</TR>
+<TR><TH ALIGN="LEFT"><I>scope</I></TH>
+<TD ALIGN="LEFT">Y</TD>
+<TD ALIGN="LEFT" VALIGN="TOP" WIDTH=283>the scope IRI on which the session must be created.</TD>
+</TR>
+</TABLE>
+
+<P>
+The following call will create a new session over the 'User' scope:
+<PRE>
+ $ curl -X POST \
+-F scope="http://localhost:8080/ontonet/ontology/User"
+	http://localhost:8080/ontonet/session
+</PRE>
+
+<P>
+The result will be an OWL description of the session. Client application must take note of the session IRI to refer to it in further REST calls. It is important that client applications close the session with a DELETE call after the whole task is performed.
+
+<P>
+
+<H4><A NAME="SECTION000114230000000000000">
+PUT</A>
+</H4> can add ontologies to the session. Ontologies can be added by pointing to a dereferencable IRI or by attaching the file stream to the request.
+
+<P>
+Supported parameters are: 
+<BR>
+<P>
+<TABLE CELLPADDING=3 BORDER="1" WIDTH="100%">
+<TR><TH ALIGN="LEFT"><B>Parameter</B></TH>
+<TH ALIGN="LEFT"><B>Mandatory</B></TH>
+<TH ALIGN="LEFT" VALIGN="TOP" WIDTH=283><B>Description</B></TH>
+</TR>
+<TR><TH ALIGN="LEFT"><I>scope</I></TH>
+<TD ALIGN="LEFT">Y</TD>
+<TD ALIGN="LEFT" VALIGN="TOP" WIDTH=283>the scope IRI on which the session is opened.</TD>
+</TR>
+<TR><TH ALIGN="LEFT"><I>session</I></TH>
+<TD ALIGN="LEFT">Y</TD>
+<TD ALIGN="LEFT" VALIGN="TOP" WIDTH=283>The IRI of the session</TD>
+</TR>
+<TR><TH ALIGN="LEFT"><I>location</I></TH>
+<TD ALIGN="LEFT">N</TD>
+<TD ALIGN="LEFT" VALIGN="TOP" WIDTH=283>The IRI of the ontology to import within the session</TD>
+</TR>
+</TABLE>
+
+<P>
+The following call will add the ontology 'Situation' to the session, loading from its public location:
+<PRE>
+ $ curl -X PUT -G \
+-d location="http://ontologydesignpatterns.org/owl/cp/situation.owl" \
+-d session="http://session-iri"
+-d scope="http://localhost:8080/ontonet/ontology/User"
+	http://localhost:8080/ontonet/session
+</PRE>
+
+<P>
+In alternative, a file stream can be attached to the request:
+<PRE>
+ $ curl -X PUT -G \
+-d session="http://session-iri" \
+-d scope="http://localhost:8080/ontonet/ontology/User" \
+-T /User/ontologies/myOntology.owl
+	http://localhost:8080/ontonet/session
+</PRE>
+
+<P>
+Possible responses:
+<DL>
+<DT><STRONG>200</STRONG></DT>
+<DD>The ontology has been added.
+ 
+</DD>
+<DT><STRONG>404</STRONG></DT>
+<DD>Some resource does not exists or cannot be loaded
+ 
+</DD>
+<DT><STRONG>500</STRONG></DT>
+<DD>Some error occurred
+</DD>
+</DL>
+
+<P>
+
+<H4><A NAME="SECTION000114240000000000000">
+DELETE</A>
+</H4> can be used to remove ontologies from the session or to delete the session:
+
+<P>
+Supported parameters are: 
+<BR>
+<P>
+<TABLE CELLPADDING=3 BORDER="1" WIDTH="100%">
+<TR><TH ALIGN="LEFT"><B>Parameter</B></TH>
+<TH ALIGN="LEFT"><B>Mandatory</B></TH>
+<TH ALIGN="LEFT" VALIGN="TOP" WIDTH=283><B>Description</B></TH>
+</TR>
+<TR><TH ALIGN="LEFT"><I>scope</I></TH>
+<TD ALIGN="LEFT">Y</TD>
+<TD ALIGN="LEFT" VALIGN="TOP" WIDTH=283>the scope IRI on which the session is opened.</TD>
+</TR>
+<TR><TH ALIGN="LEFT"><I>session</I></TH>
+<TD ALIGN="LEFT">Y</TD>
+<TD ALIGN="LEFT" VALIGN="TOP" WIDTH=283>The IRI of the session</TD>
+</TR>
+<TR><TH ALIGN="LEFT"><I>delete</I></TH>
+<TD ALIGN="LEFT">N</TD>
+<TD ALIGN="LEFT" VALIGN="TOP" WIDTH=283>The IRI of the ontology to remove from the session. <B>If this parameter is not provided the session is closed by the system and cannot be retrieved.</B></TD>
+</TR>
+</TABLE>
+
+<P>
+This requests remove the ontology 'Situation' from the session:
+<PRE>
+ $ curl -X DELETE -G \
+  -d scope="http://localhost:8080/ontonet/ontology/User" \
+  -d session="http://session-iri" \
+  -d delete="http://ontologydesignpatterns.org/owl/cp/situation.owl" \
+http://localhost:8080/ontonet/session
+</PRE>
+
+<P>
+This one, removes the whole session:
+<PRE>
+ $ curl -X DELETE -G \
+  -d scope="http://localhost:8080/ontonet/ontology/User" \
+  -d session="http://session-iri" \
+http://localhost:8080/ontonet/session
+</PRE>
+
+<P>
+Possible responses:
+<DL>
+<DT><STRONG>200</STRONG></DT>
+<DD>The deletion has been executed.
+ 
+</DD>
+<DT><STRONG>500</STRONG></DT>
+<DD>Some error occurred 
+</DD>
+</DL>
+
+<P>
+
+<H3><A NAME="SECTION000114300000000000000">
+/rules/rule</A>
+</H3>
+This service is targeted at rule management.
+
+<P>
+Supported HTTP methods are: <B>GET</B>: to retrieve details about a rule; <B>POST</B>: to create a rule; <B>DELETE</B>: to delete a rule.
+
+<P>
+
+<H4><A NAME="SECTION000114310000000000000">
+GET</A>
+</H4> requests will obtain all the rules.
+The call can be followed by the IRI of a rule to obtain the single rule details.
+
+<P>
+Get the list of all the available rules.
+<PRE>
+$ curl -X GET -H "Accept: application/rdf+xml" \ 
+	http://localhost:8080/rule/all
+</PRE>
+
+<P>
+Get the recipe definition with all embedded rules:
+<PRE>
+$ curl -X GET -H "Accept: application/rdf+xml" \
+     http://localhost:8080/rule/http://my-rule-iri
+</PRE>
+
+<P>
+Possible responses:
+<DL>
+<DT><STRONG>200</STRONG></DT>
+<DD>The rule is retrieved
+ 
+</DD>
+<DT><STRONG>404</STRONG></DT>
+<DD>The rule does not exists in KReS
+ 
+</DD>
+<DT><STRONG>500</STRONG></DT>
+<DD>Some error occurred 
+</DD>
+</DL>
+
+<P>
+
+<H4><A NAME="SECTION000114320000000000000">
+POST</A>
+</H4> requests can add a rule to a recipe or simply add a rule. If the recipe is omitted then the rule is simple added to the ontology, instead if the rule is already inside the ontology just to give the rule IRI and the recipe IRI. When all parameters are used then the rule is added both recipe and ontology.
+
+<P>
+Supported parameters are: 
+<BR>
+<P>
+<TABLE CELLPADDING=3 BORDER="1" WIDTH="100%">
+<TR><TH ALIGN="LEFT"><B>Parameter</B></TH>
+<TH ALIGN="LEFT"><B>Mandatory</B></TH>
+<TH ALIGN="LEFT" VALIGN="TOP" WIDTH=283><B>Description</B></TH>
+</TR>
+<TR><TH ALIGN="LEFT"><I>rule</I></TH>
+<TD ALIGN="LEFT">Y</TD>
+<TD ALIGN="LEFT" VALIGN="TOP" WIDTH=283>the rule name (or full IRI) to create. If a simple string is provided, the default base IRI is applied.</TD>
+</TR>
+<TR><TH ALIGN="LEFT"><I>recipe</I></TH>
+<TD ALIGN="LEFT">N</TD>
+<TD ALIGN="LEFT" VALIGN="TOP" WIDTH=283>the recipe name (or full IRI) where to add the rule.</TD>
+</TR>
+<TR><TH ALIGN="LEFT"><I>description</I></TH>
+<TD ALIGN="LEFT">Y</TD>
+<TD ALIGN="LEFT" VALIGN="TOP" WIDTH=283>A description of the rule.</TD>
+</TR>
+<TR><TH ALIGN="LEFT"><I>kres-syntax</I></TH>
+<TD ALIGN="LEFT">Y</TD>
+<TD ALIGN="LEFT" VALIGN="TOP" WIDTH=283>The rule serialized as KReS rule syntax.</TD>
+</TR>
+</TABLE>
+
+<P>
+Add a rule:
+<PRE>
+$ curl -X POST \ 
+ -F rule = http://my-rule-iri
+ -F recipe = http://my-recipe-iri
+ -F description
+ -F kres-syntax
+	http://localhost:8080/rule
+</PRE>
+
+<P>
+Note: If the rule is already inside the ontology and all parameters are set the process will try to add the rule to the ontology but it gives an error because the IRI of the rule is already inside the ontology.
+
+<P>
+Possible responses:
+<DL>
+<DT><STRONG>200</STRONG></DT>
+<DD>The rule has been added.
+ 
+</DD>
+<DT><STRONG>204</STRONG></DT>
+<DD>The rule has not been added.
+ 
+</DD>
+<DT><STRONG>400</STRONG></DT>
+<DD>The rule and recipe are not specified.
+ 
+</DD>
+<DT><STRONG>404</STRONG></DT>
+<DD>Recipe or rule not found.
+ 
+</DD>
+<DT><STRONG>409</STRONG></DT>
+<DD>A conflict occurred.
+ 
+</DD>
+<DT><STRONG>500</STRONG></DT>
+<DD>Some error occurred.
+</DD>
+</DL>
+
+<P>
+
+<H4><A NAME="SECTION000114330000000000000">
+DELETE</A>
+</H4> method can be used to delete a rule from the recipe.
+
+<P>
+This is the example with cURL (Note: If the recipe is omitted the rule is deleted from the ontology.):
+<PRE>
+$ curl -X -G \ 
+-d recipe=http://recipe-iri
+-d rule=htto://my.rule-iri
+ http://localhost:8080/rule
+ (Note: this delates the rule from the recipe)
+
+$ curl -X -G \ 
+-d rule=htto://my.rule-iri
+ http://localhost:8080/rule
+ (Note: this delates the rule from the ontology)
+</PRE>
+
+<P>
+Possible responses:
+<DL>
+<DT><STRONG>200</STRONG></DT>
+<DD>The rule has been deleted
+ 
+</DD>
+<DT><STRONG>204</STRONG></DT>
+<DD>The rule has not been deleted
+ 
+</DD>
+<DT><STRONG>404</STRONG></DT>
+<DD>Recipe or rule not found.
+ 
+</DD>
+<DT><STRONG>409</STRONG></DT>
+<DD>A conflict occurred.
+ 
+</DD>
+<DT><STRONG>500</STRONG></DT>
+<DD>Some error occurred.
+</DD>
+</DL>
+
+<P>
+
+<H3><A NAME="SECTION000114400000000000000">
+/recipe</A>
+</H3>
+The <I>/recipe</I> service provides recipe access, creation and deletion. 
+
+<P>
+Supported HTTP methods: <B>GET</B>; to retrive the recipes; <B>POST</B> to create a new recipe; <B>DELETE</B>, to delete a recipe.
+
+<P>
+
+<H4><A NAME="SECTION000114410000000000000">
+GET</A>
+</H4> requests returns the description of a recipe. With <I>/recipe/all</I> it returns the list of all available recipes.
+The call can be followed by the IRI of a recipe to obtain the details (and rules) loaded in.
+
+<P>
+Get the list of all the available recipes:
+<PRE>
+$ curl -X GET -H "Accept: application/rdf+xml" \ 
+	http://localhost:8080/recipe/all
+</PRE>
+
+<P>
+Get the recipe definition with all embedded rules:
+<PRE>
+$ curl -X GET -H "Accept: application/rdf+xml" \
+     http://localhost:8080/recipe/http://recipe-iri
+</PRE>
+
+<P>
+Possible responses:
+<DL>
+<DT><STRONG>200</STRONG></DT>
+<DD>The recipe is retrieved
+ 
+</DD>
+<DT><STRONG>404</STRONG></DT>
+<DD>The recipe does not exists
+ 
+</DD>
+<DT><STRONG>500</STRONG></DT>
+<DD>Some error occurred 
+</DD>
+</DL>
+
+<P>
+
+<H4><A NAME="SECTION000114420000000000000">
+POST</A>
+</H4> requests can add a recipe. 
+
+<P>
+Supported parameters are: 
+<BR>
+<P>
+<TABLE CELLPADDING=3 BORDER="1" WIDTH="100%">
+<TR><TH ALIGN="LEFT"><B>Parameter</B></TH>
+<TH ALIGN="LEFT"><B>Mandatory</B></TH>
+<TH ALIGN="LEFT" VALIGN="TOP" WIDTH=283><B>Description</B></TH>
+</TR>
+<TR><TH ALIGN="LEFT"><I>recipe</I></TH>
+<TD ALIGN="LEFT">Y</TD>
+<TD ALIGN="LEFT" VALIGN="TOP" WIDTH=283>the recipe name (or full IRI) to create. If a simple string is provided, the default base IRI is applied.</TD>
+</TR>
+<TR><TH ALIGN="LEFT"><I>description</I></TH>
+<TD ALIGN="LEFT">Y</TD>
+<TD ALIGN="LEFT" VALIGN="TOP" WIDTH=283>A description of the recipe.</TD>
+</TR>
+</TABLE>
+
+<P>
+Add a recipe (Note: the recipe is added without any rule.):
+<PRE>
+$ curl -X POST \ 
+ -F recipe = http://recipe-iri
+ -F description
+	http://localhost:8080/recipe
+</PRE>
+
+<P>
+Possible responses:
+<DL>
+<DT><STRONG>200</STRONG></DT>
+<DD>The recipe has been created.
+ 
+</DD>
+<DT><STRONG>409</STRONG></DT>
+<DD>A conflict occurred. Probably the recipe already exists, so it cannot be created.
+ 
+</DD>
+<DT><STRONG>500</STRONG></DT>
+<DD>Some error occurred 
+</DD>
+</DL>
+
+<P>
+
+<H4><A NAME="SECTION000114430000000000000">
+DELETE</A>
+</H4> method can be used to delete a recipe.
+
+<P>
+This is the example with cURL (Note: only the recipe is deleted but not the rules of the recipe.):
+<PRE>
+$ curl -X -G \ 
+-d recipe="http://my-recipe-iri"
+ http://localhost:8080/recipe
+</PRE>
+
+<P>
+Possible responses:
+<DL>
+<DT><STRONG>200</STRONG></DT>
+<DD>The recipe has been removed.
+ 
+</DD>
+<DT><STRONG>409</STRONG></DT>
+<DD>A conflict occurred. Probably the recipe not exists, so it cannot be deleted.
+ 
+</DD>
+<DT><STRONG>500</STRONG></DT>
+<DD>Some error occurred 
+</DD>
+</DL>
+
+<P>
+
+<H3><A NAME="SECTION000114500000000000000">
+/reasoner/classify</A>
+</H3>
+This service returns a set of axioms which is the result of classification process from a given input (can be a file or the IRI of a graph in the knowledge store) with respect to a scope and recipe. Supported HTTP method is <B>POST</B>.
+
+<P>
+Supported parameters are: 
+<BR>
+<P>
+<TABLE CELLPADDING=3 BORDER="1" WIDTH="100%">
+<TR><TH ALIGN="LEFT"><B>Parameter</B></TH>
+<TH ALIGN="LEFT"><B>Mandatory</B></TH>
+<TH ALIGN="LEFT" VALIGN="TOP" WIDTH=283><B>Description</B></TH>
+</TR>
+<TR><TH ALIGN="LEFT"><I>scope</I></TH>
+<TD ALIGN="LEFT">Y</TD>
+<TD ALIGN="LEFT" VALIGN="TOP" WIDTH=283>the scope IRI used to classify the input.</TD>
+</TR>
+<TR><TH ALIGN="LEFT"><I>session</I></TH>
+<TD ALIGN="LEFT">Y</TD>
+<TD ALIGN="LEFT" VALIGN="TOP" WIDTH=283>the session IRI used to classify the input.</TD>
+</TR>
+<TR><TH ALIGN="LEFT"><I>recipe</I></TH>
+<TD ALIGN="LEFT">N</TD>
+<TD ALIGN="LEFT" VALIGN="TOP" WIDTH=283>the recipe IRI to apply</TD>
+</TR>
+<TR><TH ALIGN="LEFT"><I>file</I></TH>
+<TD ALIGN="LEFT">N</TD>
+<TD ALIGN="LEFT" VALIGN="TOP" WIDTH=283>A file to be given as input classified
+
+<P>
+<B>Cannot be used in conjunction with <I>input-graph</I></B>.</TD>
+</TR>
+<TR><TH ALIGN="LEFT"><I>input-graph</I></TH>
+<TD ALIGN="LEFT">N</TD>
+<TD ALIGN="LEFT" VALIGN="TOP" WIDTH=283>a reference to a graph IRI in the knowledge store 
+
+<P>
+<B>Cannot be used in conjunction with <I>file</I></B>.</TD>
+</TR>
+<TR><TH ALIGN="LEFT"><I>owllink-endpoint</I></TH>
+<TD ALIGN="LEFT">N</TD>
+<TD ALIGN="LEFT" VALIGN="TOP" WIDTH=283>The reasoner server end-point URL. 
+
+<P>
+If this parameter is not provided, the system will use the built-in reasoner.</TD>
+</TR>
+</TABLE>
+
+<P>
+The following request asks the service to classify the entities in the input file with relation to a certain scope (and recipe) using the built-in reasoner (HermiT): 
+<PRE>
+$ curl -X POST -H "Accept: application/rdf+xml" \
+ -F scope="http://localhost:8080/ontonet/ontology/http://scope-iri/MyScope" \
+ -F recipe="http://localhost:8080/recipe/http://recipe-iri/MyRecipe" \
+ -F file=@/Users/enricodaga/foaf.rdf \
+ 	http://localhost:8080/reasoner/classify/
+</PRE>
+
+<P>
+In the next case, the input file is classified with relation to a certain session using a reasoner via owl-link server end-point:
+<PRE>
+$ curl -X POST -H "Accept: application/rdf+xml" \
+ -F session="http://localhost:8080/ontonet/ontology/User" \ 
+ -F file=@/Users/enricodaga/foaf.rdf \	
+ -F owllink-endpoint="http://reasoning.org/" \	
+	http://localhost:8080/reasoner/classify/
+</PRE>
+
+<P>
+The entities in the input graph are classified with relation to a certain scope using the built-in reasoner:
+<PRE>
+$ curl -X POST -H "Accept: application/rdf+xml" \
+ -F scope="http://localhost:8080/ontonet/ontology/http://scope-iri/MyScope" \ 
+ -F input-graph="http://cmsusers/" \		
+ 	http://localhost:8080/reasoner/classify/
+</PRE>
+
+<P>
+In the last example the classification process includes the entities in the input graph with relation to a certain scope (and recipe) using a reasoner via owl-link server end-point:
+<PRE>
+$ curl -X POST -H "Accept: application/rdf+xml" \
+ -F session="http://kres.iks-project.eu/session/1283861908122" \
+ -F recipe="http://localhost:8080/recipe/http://recipe-iri/MyRecipe" \ 
+ -F input-graph=http://wikinews/enhanced \
+ -F owllink-endpoint="http://reasoning.org/" \
+	http://localhost:8080/reasoner/classify/
+</PRE>
+
+<P>
+Is due to note that only one kind of input (file or input-graph) at once is allowed, elsewhere the request will produce a 409 HTTP response code (Conflict). If the session is used then use of a scope is mandatory otherwise the request will produce a 400 HTTP response code (Bad request).
+
+<P>
+Possible responses:
+<DL>
+<DT><STRONG>200</STRONG></DT>
+<DD>The ontology is retrieved, containing only new axioms result of the classification
+ 
+</DD>
+<DT><STRONG>400</STRONG></DT>
+<DD>To run the session is needed the scope
+ 
+</DD>
+<DT><STRONG>404</STRONG></DT>
+<DD>No data is retrieved
+ 
+</DD>
+<DT><STRONG>409</STRONG></DT>
+<DD>Conflicts in parameters. Too much inputs.
+ 
+</DD>
+<DT><STRONG>500</STRONG></DT>
+<DD>Some error occurred
+</DD>
+</DL>
+
+<P>
+
+<H3><A NAME="SECTION000114600000000000000">
+/reasoner/check-consistency</A>
+</H3>
+This service provides consistency check. Supported HTTP methods are <B>GET</B>, <B>POST</B>.
+
+<P>
+
+<H4><A NAME="SECTION000114610000000000000">
+GET</A>
+</H4> requests will access a light-weight service, which will check the consistency of the dereferenciable resource IRI provided. 
+
+<P>
+For example, the following request:
+<PRE>
+$ curl -X [GET -H "Accept: text/turtle"] \ 
+	http://localhost:8080/reasoner/classify/fileIri
+</PRE>
+
+<P>
+Possible responses are:
+<DL>
+<DT><STRONG>200</STRONG></DT>
+<DD>No data is retrieved, the graph IS consistent
+ 
+</DD>
+<DT><STRONG>204</STRONG></DT>
+<DD>No data is retrieved, the graph IS NOT consistent
+ 
+</DD>
+<DT><STRONG>404</STRONG></DT>
+<DD>Recipe/Scope/Ontology/InputFile doesn't exist
+ 
+</DD>
+<DT><STRONG>500</STRONG></DT>
+<DD>Some error occurred
+</DD>
+</DL>
+
+<P>
+
+<H4><A NAME="SECTION000114620000000000000">
+POST</A>
+</H4> requests can ask for consistency check with relation to a scope, a session and a recipe, providing an input file or a input graph IRI.
+
+<P>
+Supported parameters for POST are:
+<BR><TABLE CELLPADDING=3 BORDER="1" WIDTH="100%">
+<TR><TH ALIGN="LEFT"><B>Parameter</B></TH>
+<TH ALIGN="LEFT"><B>Mandatory</B></TH>
+<TH ALIGN="LEFT" VALIGN="TOP" WIDTH=283><B>Description</B></TH>
+</TR>
+<TR><TH ALIGN="LEFT"><I>scope</I></TH>
+<TD ALIGN="LEFT">Y</TD>
+<TD ALIGN="LEFT" VALIGN="TOP" WIDTH=283>the scope IRI used to classify the input 
+
+<P>
+<B>Cannot be used in conjunction with <I>session</I></B>.</TD>
+</TR>
+<TR><TH ALIGN="LEFT"><I>session</I></TH>
+<TD ALIGN="LEFT">Y</TD>
+<TD ALIGN="LEFT" VALIGN="TOP" WIDTH=283>the session IRI used to classify the input 
+
+<P>
+<B>Cannot be used in conjunction with <I>scope</I></B>.</TD>
+</TR>
+<TR><TH ALIGN="LEFT"><I>recipe</I></TH>
+<TD ALIGN="LEFT">N</TD>
+<TD ALIGN="LEFT" VALIGN="TOP" WIDTH=283>the recipe IRI to apply</TD>
+</TR>
+<TR><TH ALIGN="LEFT"><I>file</I></TH>
+<TD ALIGN="LEFT">N</TD>
+<TD ALIGN="LEFT" VALIGN="TOP" WIDTH=283>A file to be given as input classified
+
+<P>
+<B>Cannot be used in conjunction with <I>input-graph</I></B>.</TD>
+</TR>
+<TR><TH ALIGN="LEFT"><I>input-graph</I></TH>
+<TD ALIGN="LEFT">N</TD>
+<TD ALIGN="LEFT" VALIGN="TOP" WIDTH=283>a reference to a graph IRI in the knowledge store 
+
+<P>
+<B>Cannot be used in conjunction with <I>file</I></B>.</TD>
+</TR>
+<TR><TH ALIGN="LEFT"><I>owllink-endpoint</I></TH>
+<TD ALIGN="LEFT">N</TD>
+<TD ALIGN="LEFT" VALIGN="TOP" WIDTH=283>The reasoner server end-point URL. 
+
+<P>
+If this parameter is not provided, the system will use the built-in reasoner (Hermit).</TD>
+</TR>
+</TABLE>
+
+<P>
+In the following example the service checks the consistency of the given RDF input with relation to a certain scope (and recipe) using the built-in reasoner (Hermit):
+<PRE>
+$ curl -X POST -H "Accept: application/rdf+xml" H "Content-type: text/turtle" \
+ -F scope="http://localhost:8080/ontonet/ontology/http://scope-iri/MyScope" \
+ -F recipe="http://localhost:8080/recipe/http://recipe-iri/MyRecipe" \
+ -F file=@/Users/enricodaga/foaf.rdf \
+     http://localhost:8080/reasoner/check-consistency/
+</PRE>
+
+<P>
+The next checks the consistency of the given graph with relation to a certain scope (and recipe) using a reasoner via owl-link server end-point:
+<PRE>
+$ curl -X POST -H "Accept: application/rdf+" \
+ -F scope="http://localhost:8080/ontonet/ontology/http://scope-iri/MyScope" \ 
+ -F recipe="http://localhost:8080/recipe/http://recipe-iri/MyRecipe" \ 
+ -F input-graph="http://cmsusers/" \
+ -F owllink-endpoint="http://reasoning.org/" \
+     http://localhost:8080/reasoner/check-consistency/
+</PRE>
+
+<P>
+Possible responses are:
+<DL>
+<DT><STRONG>200</STRONG></DT>
+<DD>No data is retrieved, the graph IS consistent
+ 
+</DD>
+<DT><STRONG>204</STRONG></DT>
+<DD>No data is retrieved, the graph IS NOT consistent
+ 
+</DD>
+<DT><STRONG>404</STRONG></DT>
+<DD>Scope either Ontology or recipe or RDF input not found
+ 
+</DD>
+<DT><STRONG>409</STRONG></DT>
+<DD>Conflicts in parameters
+ 
+</DD>
+<DT><STRONG>500</STRONG></DT>
+<DD>Some error occurred
+</DD>
+</DL>
+
+<P>
+
+<H3><A NAME="SECTION000114700000000000000">
+/reasoner/enrich</A>
+</H3>
+This service runs the reasoner over the input data applying the given scope, a session and recipe and returns all the inferred knowledge.
+
+<P>
+Supported HTTP method is <B>POST</B>.
+<BR>
+Supported parameters are the following:
+<BR><TABLE CELLPADDING=3 BORDER="1" WIDTH="100%">
+<TR><TH ALIGN="LEFT"><B>Parameter</B></TH>
+<TH ALIGN="LEFT"><B>Mandatory</B></TH>
+<TH ALIGN="LEFT" VALIGN="TOP" WIDTH=283><B>Description</B></TH>
+</TR>
+<TR><TH ALIGN="LEFT"><I>scope</I></TH>
+<TD ALIGN="LEFT">Y</TD>
+<TD ALIGN="LEFT" VALIGN="TOP" WIDTH=283>the scope IRI used to classify the input.</TD>
+</TR>
+<TR><TH ALIGN="LEFT"><I>session</I></TH>
+<TD ALIGN="LEFT">Y</TD>
+<TD ALIGN="LEFT" VALIGN="TOP" WIDTH=283>the session IRI used to classify the input.</TD>
+</TR>
+<TR><TH ALIGN="LEFT"><I>recipe</I></TH>
+<TD ALIGN="LEFT">N</TD>
+<TD ALIGN="LEFT" VALIGN="TOP" WIDTH=283>the recipe IRI to apply</TD>
+</TR>
+<TR><TH ALIGN="LEFT"><I>file</I></TH>
+<TD ALIGN="LEFT">N</TD>
+<TD ALIGN="LEFT" VALIGN="TOP" WIDTH=283>A file to be given as input classified
+
+<P>
+<B>Cannot be used in conjunction with <I>input-graph</I></B>.</TD>
+</TR>
+<TR><TH ALIGN="LEFT"><I>input-graph</I></TH>
+<TD ALIGN="LEFT">N</TD>
+<TD ALIGN="LEFT" VALIGN="TOP" WIDTH=283>a reference to a graph IRI in the knowledge store 
+
+<P>
+<B>Cannot be used in conjunction with <I>file</I></B>.</TD>
+</TR>
+<TR><TH ALIGN="LEFT"><I>owllink-endpoint</I></TH>
+<TD ALIGN="LEFT">N</TD>
+<TD ALIGN="LEFT" VALIGN="TOP" WIDTH=283>The reasoner server end-point URL. 
+
+<P>
+If this parameter is not provided, the system will use the built-in reasoner (Hermit).</TD>
+</TR>
+</TABLE>
+
+<P>
+The following HTTP request explodes the given recipe with relation to a given input and session:
+<PRE>
+$ curl -X POST -H "Accept: application/rdf+xml" \
+ -H "Content-type: application/rdf+xml" \
+ -F session="http://kres.iks-project.eu/session/1283861908122" \
+ -F recipe="http://localhost:8080/recipe/http://recipe/SameWorkplaceGeneration" \
+ -F input=@/Users/enricodaga/foaf.rdf \
+     http://localhost:8080/reasoner/enrich/
+</PRE>
+
+<P>
+Explode the given recipe with relation to a given graph and scope:
+<PRE>
+$ curl -X POST -H "Accept: application/rdf+xml" \
+ -F scope="http://localhost:8080/ontonet/ontology/MyScope" \
+ -F recipe="http://localhost:8080/recipe/http://recipe-iri/MyRecipe" \ 
+ -F input-graph=http://input-graph-iri \
+ -F owllink-endpoint="http://reasoning.org/" \
+     http://localhost:8080/reasoner/enrich/
+</PRE>
+
+<P>
+Possible responses are:
+<DL>
+<DT><STRONG>200</STRONG></DT>
+<DD>Returns a graph with the enrichments
+ 
+</DD>
+<DT><STRONG>204</STRONG></DT>
+<DD>No enrichments have been produced from the given graph
+ 
+</DD>
+<DT><STRONG>404</STRONG></DT>
+<DD>The recipe/ontology/scope/input doesn't exist in the network
+ 
+</DD>
+<DT><STRONG>409</STRONG></DT>
+<DD>Conflicts in parameters
+ 
+</DD>
+<DT><STRONG>500</STRONG></DT>
+<DD>Some error occurred
+</DD>
+</DL>
+
+<P>
+
+<H3><A NAME="SECTION000114800000000000000">
+/refactor (/lazy and /consistent)</A>
+</H3>
+Supported HTTP methods: <B>GET</B>, made for getting the input from the knowledge store; <B>POST</B>, which implies an attached RDF file to be sent as input. The ontology network to be used can be pointed with the <I>scope</I> parameter only, to use a globally shared version of the network or providing also the <I>session</I> parameter, with the IRI of a user defined session obtained from the <I>/kres/session</I> service (described above).
+
+<P>
+For both HTTP methods, two modalities are provided: 
+
+<OL>
+<LI>the /refactor/lazy applies refactoring without considering consistency check;
+</LI>
+<LI>the /refactor/consistent applies refactoring considering consistency check;
+</LI>
+</OL>
+
+<P>
+
+<H4><A NAME="SECTION000114810000000000000">
+GET</A>
+</H4>
+
+<P>
+Supported parameters for GET requets: 
+<BR><TABLE CELLPADDING=3 BORDER="1" WIDTH="100%">
+<TR><TH ALIGN="LEFT"><B>Parameter</B></TH>
+<TH ALIGN="LEFT"><B>Mandatory</B></TH>
+<TH ALIGN="LEFT" VALIGN="TOP" WIDTH=283><B>Description</B></TH>
+</TR>
+<TR><TH ALIGN="LEFT"><I>recipe</I></TH>
+<TD ALIGN="LEFT">Y</TD>
+<TD ALIGN="LEFT" VALIGN="TOP" WIDTH=283>The IRI of the recipe to apply</TD>
+</TR>
+<TR><TH ALIGN="LEFT"><I>input-graph</I></TH>
+<TD ALIGN="LEFT">Y</TD>
+<TD ALIGN="LEFT" VALIGN="TOP" WIDTH=283>The IRI of the graph to be refactored</TD>
+</TR>
+<TR><TH ALIGN="LEFT"><I>output-graph</I></TH>
+<TD ALIGN="LEFT">N</TD>
+<TD ALIGN="LEFT" VALIGN="TOP" WIDTH=283>The IRI of the graph to fill with refactored data. If the output-graph param is present, the output is put in the graph; elsewhere is returned back.</TD>
+</TR>
+</TABLE>
+
+<P>
+The following request process the input and produce the refactored data as output according to a given recipe:
+
+<P>
+<PRE>
+$ curl -X GET -H "Accept: text/turtle" \
+ -G -d recipe="http://localhost:8080/recipe/myRecipe" \
+ -d input-graph="http://torefactor/graph" \
+ -d output-graph="http://torefactor/output-graph" \
+     http://localhost:8080/refactor/lazy
+</PRE>
+
+<P>
+In the above case output is put in the graph "http://torefactor/output-graph". If the graph does not exist it is created otherwise a reference to the existing graph is taken. No consistency checking is performed to test the consistency of the refactored data set. While if 
+the request is the following:
+
+<P>
+<PRE>
+$ curl -X GET -H "Accept: text/turtle" \
+ -G -d recipe="http://localhost:8080/recipe/http://recipes/MyRecipe" \
+ -d input-graph="http://torefactor/graph" \
+ -d output-graph="http://refactored/output-graph" \
+     http://localhost:8080/refactor/consistent
+</PRE>
+
+<P>
+also a consistency checking is required on the data set generated by the refactoring.
+
+<P>
+
+<H4><A NAME="SECTION000114820000000000000">
+POST</A>
+</H4> requests perform refactoring over a file given as input.
+
+<P>
+Supported parameters for POST requets are: 
+<BR><TABLE CELLPADDING=3 BORDER="1" WIDTH="100%">
+<TR><TH ALIGN="LEFT"><B>Parameter</B></TH>
+<TH ALIGN="LEFT"><B>Mandatory</B></TH>
+<TH ALIGN="LEFT" VALIGN="TOP" WIDTH=283><B>Description</B></TH>
+</TR>
+<TR><TH ALIGN="LEFT"><I>recipe</I></TH>
+<TD ALIGN="LEFT">Y</TD>
+<TD ALIGN="LEFT" VALIGN="TOP" WIDTH=283>The IRI of the recipe to apply</TD>
+</TR>
+<TR><TH ALIGN="LEFT"><I>input</I></TH>
+<TD ALIGN="LEFT">Y</TD>
+<TD ALIGN="LEFT" VALIGN="TOP" WIDTH=283>The file containing the RDF data to be refactored</TD>
+</TR>
+</TABLE>
+
+<P>
+Next possible request is
+
+<P>
+<PRE>
+$ curl -X POST -H "Accept: text/turtle" \
+ -F recipe="http://localhost:8080/recipe/toMyOntology" \
+ -F input=@/Users/enricodaga/foaf.rdf \
+     http://localhost:8080/refactor/lazy
+</PRE>
+Here output returns back without consistency checking.
+
+<P>
+While
+
+<P>
+<PRE>
+$ curl -X POST -H "Accept: text/turtle" \
+ -F recipe="http://localhost:8080/recipe/toMyOntology" \
+ -F input=@/Users/enricodaga/foaf.rdf \
+     http://localhost:8080/refactor/consistent
+</PRE>
+
+<P>
+returns back with consistency checking.
+
+<P>
+<DL>
+<DT><STRONG>200</STRONG></DT>
+<DD>Data has been refactored. Returns a RDF graph with the refactored data if -output-graph is not defined, else returns nothing.
+ 
+</DD>
+<DT><STRONG>204</STRONG></DT>
+<DD>The defined recipe does not exists
+ 
+</DD>
+<DT><STRONG>404</STRONG></DT>
+<DD>The recipe|input graph deos not exist (Some resource has not been found)
+ 
+</DD>
+<DT><STRONG>415</STRONG></DT>
+<DD>Media type is not supported (only POST)
+ 
+</DD>
+<DT><STRONG>500</STRONG></DT>
+<DD>Some error occurred
+</DD>
+</DL>
+
+<P>
+
+<H3><A NAME="SECTION000114900000000000000">
+/reengineer/reengineer</A>
+</H3>
+For each input a dedicated service is provided:
+
+<P>
+
+<H4><A NAME="SECTION000114910000000000000">
+Input is a document (Mime-type based)</A>
+</H4>.
+
+<P>
+This service process the input and produce the reengineered data as output.
+
+<P>
+Supported HTTP method: <B>POST</B>
+
+<P>
+Supported parameters: 
+<BR><TABLE CELLPADDING=3 BORDER="1" WIDTH="100%">
+<TR><TH ALIGN="LEFT"><B>Parameter</B></TH>
+<TH ALIGN="LEFT"><B>Mandatory</B></TH>
+<TH ALIGN="LEFT" VALIGN="TOP" WIDTH=283><B>Description</B></TH>
+</TR>
+<TR><TH ALIGN="LEFT"><I>input-type</I></TH>
+<TD ALIGN="LEFT">N</TD>
+<TD ALIGN="LEFT" VALIGN="TOP" WIDTH=283>The mime type is used for detecting the reengineering engine to run. If the input-type is omitted, then the system tries to detect it.</TD>
+</TR>
+<TR><TH ALIGN="LEFT"><I>input</I></TH>
+<TD ALIGN="LEFT">Y</TD>
+<TD ALIGN="LEFT" VALIGN="TOP" WIDTH=283>The input file to reengineer</TD>
+</TR>
+<TR><TH ALIGN="LEFT"><I>recipe</I></TH>
+<TD ALIGN="LEFT">N</TD>
+<TD ALIGN="LEFT" VALIGN="TOP" WIDTH=283>If present, the requested recipe will be applied</TD>
+</TR>
+<TR><TH ALIGN="LEFT"><I>output-graph</I></TH>
+<TD ALIGN="LEFT">N</TD>
+<TD ALIGN="LEFT" VALIGN="TOP" WIDTH=283>If present, the result is fed in the given graph</TD>
+</TR>
+</TABLE>
+
+<P>
+Both the following examples are valid requests:
+
+<P>
+<PRE>
+$ curl -X POST -H "Accept: text/turtle" \
+ -F input-type="application/rdf+xml"
+ -F input=@/Users/enricodaga/profile.xml \
+     http://localhost:8080/reengineer/reengineer/
+
+$ curl -X POST -H "Accept: text/turtle" \
+ -F recipe="http://localhost:8080/recipe/xml2owl" \
+ -F input=@/Users/enricodaga/profile.xml \
+     http://localhost:8080/reengineer/reengineer/
+</PRE>
+
+<P>
+Possible responses: 
+<BR><DL>
+<DT><STRONG>200</STRONG></DT>
+<DD>Data has been reengineered. Returns a graph with the reengineered data if -output-graph is not defined, else returns nothing.
+ 
+</DD>
+<DT><STRONG>204</STRONG></DT>
+<DD>The following things can happen:
+
+<P>
+- No recipes have been found for the input given 
+
+<P>
+- The defined recipe cannot be applied to such content
+ 
+</DD>
+<DT><STRONG>404</STRONG></DT>
+<DD>The recipe|output graph deos not exist (Some resource has not been found)
+ 
+</DD>
+<DT><STRONG>500</STRONG></DT>
+<DD>Some error occurred
+</DD>
+</DL>
+
+<P>
+
+<H4><A NAME="SECTION000114920000000000000">
+Input is a DBMS connection</A>
+</H4>. 
+
+<P>
+This service is available in the sub-path <B>/dbsource</B>. It connects to the database, extract the data and put it in the given graph.
+
+<P>
+Supported HTTP method: <B>POST</B>
+
+<P>
+Supported parameters: 
+<BR><TABLE CELLPADDING=3 BORDER="1" WIDTH="100%">
+<TR><TH ALIGN="LEFT"><B>Parameter</B></TH>
+<TH ALIGN="LEFT"><B>Mandatory</B></TH>
+<TH ALIGN="LEFT" VALIGN="TOP" WIDTH=283><B>Description</B></TH>
+</TR>
+<TR><TH ALIGN="LEFT"><I>db</I></TH>
+<TD ALIGN="LEFT">Y</TD>
+<TD ALIGN="LEFT" VALIGN="TOP" WIDTH=283>The name of the database</TD>
+</TR>
+<TR><TH ALIGN="LEFT"><I>namespace</I></TH>
+<TD ALIGN="LEFT">Y</TD>
+<TD ALIGN="LEFT" VALIGN="TOP" WIDTH=283>The base namespace for the reengineering</TD>
+</TR>
+<TR><TH ALIGN="LEFT"><I>jdbc</I></TH>
+<TD ALIGN="LEFT">Y</TD>
+<TD ALIGN="LEFT" VALIGN="TOP" WIDTH=283>JDBC driver to use for the connection</TD>
+</TR>
+<TR><TH ALIGN="LEFT"><I>protocol</I></TH>
+<TD ALIGN="LEFT">Y</TD>
+<TD ALIGN="LEFT" VALIGN="TOP" WIDTH=283>Protocol part of the DB connection</TD>
+</TR>
+<TR><TH ALIGN="LEFT"><I>host</I></TH>
+<TD ALIGN="LEFT">Y</TD>
+<TD ALIGN="LEFT" VALIGN="TOP" WIDTH=283>Host of the DBMS</TD>
+</TR>
+<TR><TH ALIGN="LEFT"><I>port</I></TH>
+<TD ALIGN="LEFT">Y</TD>
+<TD ALIGN="LEFT" VALIGN="TOP" WIDTH=283>Port</TD>
+</TR>
+<TR><TH ALIGN="LEFT"><I>username</I></TH>
+<TD ALIGN="LEFT">Y</TD>
+<TD ALIGN="LEFT" VALIGN="TOP" WIDTH=283>User of the DBMS</TD>
+</TR>
+<TR><TH ALIGN="LEFT"><I>password</I></TH>
+<TD ALIGN="LEFT">Y</TD>
+<TD ALIGN="LEFT" VALIGN="TOP" WIDTH=283>Password</TD>
+</TR>
+<TR><TH ALIGN="LEFT"><I>output-graph</I></TH>
+<TD ALIGN="LEFT">N</TD>
+<TD ALIGN="LEFT" VALIGN="TOP" WIDTH=283>The IRI of the graph to fed with the result</TD>
+</TR>
+<TR><TH ALIGN="LEFT"><I>recipe</I></TH>
+<TD ALIGN="LEFT">N</TD>
+<TD ALIGN="LEFT" VALIGN="TOP" WIDTH=283>The IRI of the recipe to apply</TD>
+</TR>
+</TABLE>
+
+<P>
+<PRE>
+$ curl -X POST -H "Accept: text/plain" \
+ -F db="customer" \
+ -F namespace="http://reengineeringexample/entity/customer/" \
+ -F jdbc="com.mysql.jdbc.Driver" \
+ -F protocol="jdbc:mysql://" \
+ -F host="127.0.0.1" \
+ -F port="3306" \
+ -F username="admin" \
+ -F password="password" \
+ -F output-graph="http://reengineeringexample/" \
+ -F recipe="http://localhost:8080/recipe/mydbschema2owl" \
+     http://localhost:8080/reengineer/reengineer/dbsource
+</PRE>
+
+<P>
+Possible responses:
+<DL>
+<DT><STRONG>200</STRONG></DT>
+<DD>Data has been reengineered. Returns a graph with the reengineered data if -output-graph is not defined, else returns nothing.
+ 
+</DD>
+<DT><STRONG>204</STRONG></DT>
+<DD>The defined recipe cannot be applied to such content
+ 
+</DD>
+<DT><STRONG>404</STRONG></DT>
+<DD>The recipe|output graph deos not exist (Some resource has not been found)
+ 
+</DD>
+<DT><STRONG>415</STRONG></DT>
+<DD>Media type is not supported
+ 
+</DD>
+<DT><STRONG>500</STRONG></DT>
+<DD>Some error occurred
+</DD>
+</DL>
+
+<!-- end of file -->
+</...@common.page>
+</#escape>

Propchange: incubator/stanbol/trunk/reasoners/demo/integritycheck/src/main/resources/META-INF/templates/org/apache/stanbol/intcheck/resource/RESTfulResource/index.ftl
------------------------------------------------------------------------------
    svn:executable = *

Added: incubator/stanbol/trunk/reasoners/demo/integritycheck/src/main/resources/META-INF/templates/org/apache/stanbol/intcheck/resource/RecipeResource/index.ftl
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/reasoners/demo/integritycheck/src/main/resources/META-INF/templates/org/apache/stanbol/intcheck/resource/RecipeResource/index.ftl?rev=1135486&view=auto
==============================================================================
--- incubator/stanbol/trunk/reasoners/demo/integritycheck/src/main/resources/META-INF/templates/org/apache/stanbol/intcheck/resource/RecipeResource/index.ftl (added)
+++ incubator/stanbol/trunk/reasoners/demo/integritycheck/src/main/resources/META-INF/templates/org/apache/stanbol/intcheck/resource/RecipeResource/index.ftl Tue Jun 14 11:12:32 2011
@@ -0,0 +1,12 @@
+<#import "/imports/common.ftl" as common>
+<#escape x as x?html>
+<@common.page title="Recipes and Rules">
+
+<div class="contentTag">
+<div class="menuLeft">Recipes stored <span id="addRecipe" class="hide"><a href="javascript:var recipe = new Recipe(); recipe.displayAddBox()" alt="add recipe"><img src="/intcheck/static/images/add.gif"</a><span></div>
+<div class="menuRightText"><a id="action" href="javascript:listRecipes()">view</a></div>
+<div id="recipeList"></div>
+</div>
+
+</...@common.page>
+</#escape>

Propchange: incubator/stanbol/trunk/reasoners/demo/integritycheck/src/main/resources/META-INF/templates/org/apache/stanbol/intcheck/resource/RecipeResource/index.ftl
------------------------------------------------------------------------------
    svn:executable = *

Added: incubator/stanbol/trunk/reasoners/demo/integritycheck/src/main/resources/META-INF/templates/org/apache/stanbol/intcheck/resource/ReengineerResource/index.ftl
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/reasoners/demo/integritycheck/src/main/resources/META-INF/templates/org/apache/stanbol/intcheck/resource/ReengineerResource/index.ftl?rev=1135486&view=auto
==============================================================================
--- incubator/stanbol/trunk/reasoners/demo/integritycheck/src/main/resources/META-INF/templates/org/apache/stanbol/intcheck/resource/ReengineerResource/index.ftl (added)
+++ incubator/stanbol/trunk/reasoners/demo/integritycheck/src/main/resources/META-INF/templates/org/apache/stanbol/intcheck/resource/ReengineerResource/index.ftl Tue Jun 14 11:12:32 2011
@@ -0,0 +1,28 @@
+<#import "/imports/common.ftl" as common>
+<#escape x as x?html>
+<@common.page title="KReS Semion Reengineer">
+
+  <p>The Semion Reengineer helps users to transform structured non-RDF data sources into RDF ones.
+  Currently supported data sources are:</p>
+  <ul class="kressList">
+  <li> Relational Databases
+  <li> XML
+  </ul>
+  <p>Next developing will support:</p>
+  <ul class="kressList">
+  <li> RSS
+  <li> iCalendar
+  </ul>
+	
+<p>Tranform a data source</p>
+<select name="data-source-type" onchange="showReengineer(this.selectedIndex)">
+<option value="empty">
+<option value="rdb">Relational DB
+<option value="xml">Document
+</select><br/>
+
+<div id="data-source-form">
+</div>
+
+</...@common.page>
+</#escape>

Propchange: incubator/stanbol/trunk/reasoners/demo/integritycheck/src/main/resources/META-INF/templates/org/apache/stanbol/intcheck/resource/ReengineerResource/index.ftl
------------------------------------------------------------------------------
    svn:executable = *

Added: incubator/stanbol/trunk/reasoners/demo/integritycheck/src/main/resources/META-INF/templates/org/apache/stanbol/intcheck/resource/RefactorerResource/index.ftl
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/reasoners/demo/integritycheck/src/main/resources/META-INF/templates/org/apache/stanbol/intcheck/resource/RefactorerResource/index.ftl?rev=1135486&view=auto
==============================================================================
--- incubator/stanbol/trunk/reasoners/demo/integritycheck/src/main/resources/META-INF/templates/org/apache/stanbol/intcheck/resource/RefactorerResource/index.ftl (added)
+++ incubator/stanbol/trunk/reasoners/demo/integritycheck/src/main/resources/META-INF/templates/org/apache/stanbol/intcheck/resource/RefactorerResource/index.ftl Tue Jun 14 11:12:32 2011
@@ -0,0 +1,15 @@
+<#import "/imports/common.ftl" as common>
+<#escape x as x?html>
+<@common.page title="KReS Semiom Refactorer">
+
+<p>What graph do you want to refactor</p>
+
+<div class="contentTag">
+<input type="radio" name="from" onClick="javascript:var refactorer=new Refactorer(); refactorer.showRefactoring(0, '${it.namespace}')"> Stateful refactoring<br>
+<input type="radio" name="from" onClick="javascript:var refactorer=new Refactorer(); refactorer.showRefactoring(1, '${it.namespace}')"> Stateless refactoring<br>
+</div>
+
+<div id="refactoring" class="contentTagNoShow"></div> 
+
+</...@common.page>
+</#escape>

Propchange: incubator/stanbol/trunk/reasoners/demo/integritycheck/src/main/resources/META-INF/templates/org/apache/stanbol/intcheck/resource/RefactorerResource/index.ftl
------------------------------------------------------------------------------
    svn:executable = *

Added: incubator/stanbol/trunk/reasoners/demo/integritycheck/src/main/resources/META-INF/templates/org/apache/stanbol/intcheck/resource/RootResource/index.ftl
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/reasoners/demo/integritycheck/src/main/resources/META-INF/templates/org/apache/stanbol/intcheck/resource/RootResource/index.ftl?rev=1135486&view=auto
==============================================================================
--- incubator/stanbol/trunk/reasoners/demo/integritycheck/src/main/resources/META-INF/templates/org/apache/stanbol/intcheck/resource/RootResource/index.ftl (added)
+++ incubator/stanbol/trunk/reasoners/demo/integritycheck/src/main/resources/META-INF/templates/org/apache/stanbol/intcheck/resource/RootResource/index.ftl Tue Jun 14 11:12:32 2011
@@ -0,0 +1,23 @@
+<#import "/imports/common.ftl" as common>
+<#escape x as x?html>
+<@common.page title="About KReS...">
+
+<p>The Knowledge Representation and Reasoning System (or short KReS) is a standalone set of software components 
+targeted at the realization of the vast majority of functionalities and requirements belonging to the IKS knowledge 
+management tier, as per IKS Deliverable D3.2 . The rationale behind it is to provide a controlled environment for 
+CMS developers and administrators to execute KR, rule management and reasoning tasks for managing their content. 
+Here, the notion of "controlled environment" indicates the ability to provide each user with all and only the knowledge 
+and semantic services required within their business setting, despite the fact that KReS as a whole is always able to 
+deliver additional services on demand.</p>
+
+<p>The knowledge representation and reasoning capabilities of KReS span from loading, querying, storing and applying 
+OWL ontologies and SWRL rule sets to executing rules and applying simple and composite Description Logic reasoning, 
+along with reengineering and alignment of Linked Data and other models (such as DOM trees and relational databases) 
+with the content stored by a CMS.</p>
+
+<p>The initial KReS alpha provides both Java and RESTful APIs for the most basic functionalities that allow for some 
+knowledge representation and reasoning capabilities along with an early, strictly closed-compartment-like implementation 
+of the controlled environment management of ontologies and rules.</p>
+
+</...@common.page>
+</#escape>

Added: incubator/stanbol/trunk/reasoners/demo/integritycheck/src/main/resources/META-INF/templates/org/apache/stanbol/intcheck/resource/SessionResource/index.ftl
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/reasoners/demo/integritycheck/src/main/resources/META-INF/templates/org/apache/stanbol/intcheck/resource/SessionResource/index.ftl?rev=1135486&view=auto
==============================================================================
--- incubator/stanbol/trunk/reasoners/demo/integritycheck/src/main/resources/META-INF/templates/org/apache/stanbol/intcheck/resource/SessionResource/index.ftl (added)
+++ incubator/stanbol/trunk/reasoners/demo/integritycheck/src/main/resources/META-INF/templates/org/apache/stanbol/intcheck/resource/SessionResource/index.ftl Tue Jun 14 11:12:32 2011
@@ -0,0 +1,15 @@
+<#import "/imports/common.ftl" as common>
+<#escape x as x?html>
+<@common.page title="Active Sessions">
+  
+
+<div id="session" class="contentTag">
+<ul class="indent">
+<#list it.sessionsAsStringArray as session>
+<li>${session}
+</#list>
+<ul>
+</div>
+
+</...@common.page>
+</#escape>

Propchange: incubator/stanbol/trunk/reasoners/demo/integritycheck/src/main/resources/META-INF/templates/org/apache/stanbol/intcheck/resource/SessionResource/index.ftl
------------------------------------------------------------------------------
    svn:executable = *

Added: incubator/stanbol/trunk/reasoners/demo/integritycheck/src/main/resources/META-INF/templates/org/apache/stanbol/intcheck/resource/WIkinewsDemoResource/index.ftl
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/reasoners/demo/integritycheck/src/main/resources/META-INF/templates/org/apache/stanbol/intcheck/resource/WIkinewsDemoResource/index.ftl?rev=1135486&view=auto
==============================================================================
--- incubator/stanbol/trunk/reasoners/demo/integritycheck/src/main/resources/META-INF/templates/org/apache/stanbol/intcheck/resource/WIkinewsDemoResource/index.ftl (added)
+++ incubator/stanbol/trunk/reasoners/demo/integritycheck/src/main/resources/META-INF/templates/org/apache/stanbol/intcheck/resource/WIkinewsDemoResource/index.ftl Tue Jun 14 11:12:32 2011
@@ -0,0 +1,34 @@
+<#import "/imports/common.ftl" as common>
+<#escape x as x?html>
+<@common.page title="Integrity Check for Remote Data Fusion">
+
+<div class="contentTag">
+
+<p>
+This demo shows an application for performing integrity check on remote data (e.g. from LOD) before storing such data on a local knowledge base to the aim of enriching it.
+Performances are being improved, the system is continuously evolving.
+</p>
+<p>
+How to use the demo:
+<ol class="indent">
+<li/>Paste a text in the box and click "start".<br>
+<li/>The list you got back is a list of resources related to text and gathered from DBPedia and GeoNames LOD datasets
+<li/>Click on "create scope" and wait that all entities are checked. It is fetching all resources and their associated semantic graph. 
+It doesn't matter if some of them are red-checked, it means the server might be down.
+<li/>Click "add to the ON". It means all the fetched datasets are loaded in an ontonet session where the validation will be computed.
+<li/>Click on "add a new rule for the integrity check" and define your calidation rule. Use the pre-defined rule as template or go to 
+<a href="http://stlab.istc.cnr.it/stlab/KReS/KReSRuleLanguage">RuleSyntax page</a> if you want more details on the syntax
+<li/>Check that your rule is correct then click on "check integrity".
+A reasoner is run, it will allow also to gather all sameAs entities.
+<li/>The resources you got back are those ones that passed the integrity check based on your validity rule.
+</ol>
+</p>
+<textarea id="textInput" name="textInput" cols=70 rows=20>Sony Corporation is the electronics business unit and the parent company of the Sony Group, which is engaged in business through its eight operating segments. Consumer Products & Devices (CPD), Networked Products & Services (NPS), B2B & Disc Manufacturing (B2B & Disc), Pictures, Music, Financial Services, Sony Ericsson and All Other.These make Sony one of the most comprehensive entertainment companies in the world. Sony's principal business operations include Sony Corporation (Sony Electronics in the U.S.), Sony Pictures Entertainment, Sony Computer Entertainment, Sony Music Entertainment, Sony Ericsson, and Sony Financial. As a semiconductor maker, Sony is among the Worldwide Top 20 Semiconductor Sales Leaders.</textarea>
+<br><br>
+<input type="button" id="submit" value="start" onClick="javascript:var demo=new Demo(); demo.enhance();">
+<input type="button" value="reset" onclick="window.location.href='/intcheck/demo';"/>
+<div id="fiseResult" class="hide"></div>
+</div>
+
+</...@common.page>
+</#escape>

Propchange: incubator/stanbol/trunk/reasoners/demo/integritycheck/src/main/resources/META-INF/templates/org/apache/stanbol/intcheck/resource/WIkinewsDemoResource/index.ftl
------------------------------------------------------------------------------
    svn:executable = *

Modified: incubator/stanbol/trunk/rules/manager/src/main/java/org/apache/stanbol/rules/manager/changes/RemoveRule.java
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/rules/manager/src/main/java/org/apache/stanbol/rules/manager/changes/RemoveRule.java?rev=1135486&r1=1135485&r2=1135486&view=diff
==============================================================================
--- incubator/stanbol/trunk/rules/manager/src/main/java/org/apache/stanbol/rules/manager/changes/RemoveRule.java (original)
+++ incubator/stanbol/trunk/rules/manager/src/main/java/org/apache/stanbol/rules/manager/changes/RemoveRule.java Tue Jun 14 11:12:32 2011
@@ -12,8 +12,6 @@ import java.util.Iterator;
 import java.util.LinkedList;
 import java.util.List;
 import java.util.Vector;
-import java.util.logging.Level;
-import java.util.logging.Logger;
 
 import org.apache.stanbol.rules.base.api.RuleStore;
 import org.semanticweb.owlapi.apibinding.OWLManager;
@@ -29,7 +27,9 @@ import org.semanticweb.owlapi.model.OWLO
 import org.semanticweb.owlapi.model.OWLOntologyChange;
 import org.semanticweb.owlapi.model.OWLOntologyCreationException;
 import org.semanticweb.owlapi.model.OWLOntologyManager;
+import org.semanticweb.owlapi.model.OWLOntologyStorageException;
 import org.semanticweb.owlapi.util.OWLEntityRemover;
+import org.slf4j.LoggerFactory;
 
 /**
  * This class will remove a rule from the KReSRuleStore used as input.<br/>
@@ -95,7 +95,7 @@ public class RemoveRule {
             if(additions.size()>0)
                 owlmanager.applyChanges(additions);
         } catch (OWLOntologyCreationException ex) {
-            ex.printStackTrace();
+            LoggerFactory.getLogger(RemoveRule.class).error("Problem to clone ontology",ex);
         }
 
     }
@@ -159,14 +159,14 @@ public class RemoveRule {
                         owlmanager.applyChanges(remover.getChanges());
                         remover.reset();
                     }else{
-                         System.err.println("The rule cannot be deleted because is used by some recipes. Pleas check the following recipes:");
-                         System.err.println(usage.toString());
+                         LoggerFactory.getLogger(RemoveRule.class).error("The rule cannot be deleted because is used by some recipes. Pleas check the following recipes:\n"+usage.toString());
                          ok = false;
                          return(ok);
                  }
 
            if(owlmodel.containsAxiom(factory.getOWLClassAssertionAxiom(ontocls, ontoind))){
-               System.err.println("Some error occurs during deletion.");
+               LoggerFactory.getLogger(RemoveRule.class).error("Some error occurs during deletion.");
+               
                ok = false;
                return(ok);
            }else{
@@ -174,13 +174,14 @@ public class RemoveRule {
            }
 
        }else{
-           System.err.println("The rule with name "+ruleName+" is not inside the ontology. Pleas check the name.");
+           LoggerFactory.getLogger(RemoveRule.class).error("The rule with name "+ruleName+" is not inside the ontology. Pleas check the name.");
            ok =false;
            return(ok);
        }
 
-       if(ok)
-           this.storeaux.setStore(owlmodel);
+       if(ok){
+            this.storeaux.setStore(owlmodel);
+       }
 
        return ok;
    }
@@ -218,14 +219,13 @@ public class RemoveRule {
                         owlmanager.applyChanges(remover.getChanges());
                         remover.reset();
                     }else{
-                         System.err.println("The rule cannot be deleted because is used by some recipes. Pleas check the following recipes:");
-                         System.err.println(usage.toString());
+                         LoggerFactory.getLogger(RemoveRule.class).error("The rule cannot be deleted because is used by some recipes. Pleas check the following recipes:\n"+usage.toString());
                          ok = false;
                          return(ok);
                  }
 
            if(owlmodel.containsAxiom(factory.getOWLClassAssertionAxiom(ontocls, ontoind))){
-               System.err.println("Some error occurs during deletion.");
+               LoggerFactory.getLogger(RemoveRule.class).error("Some error occurs during deletion.");
                ok = false;
                return(ok);
            }else{
@@ -233,13 +233,14 @@ public class RemoveRule {
            }
 
        }else{
-           System.err.println("The rule with name "+ruleName+" is not inside the ontology. Pleas check the name.");
+           LoggerFactory.getLogger(RemoveRule.class).error("The rule with name "+ruleName+" is not inside the ontology. Pleas check the name.");
            ok =false;
            return(ok);
        }
 
-       if(ok)
-           this.storeaux.setStore(owlmodel);
+       if(ok){
+            this.storeaux.setStore(owlmodel);
+       }
 
        return ok;
 
@@ -268,9 +269,9 @@ public class RemoveRule {
          OWLNamedIndividual recipe = factory.getOWLNamedIndividual(recipeName);
 
          if(!owlmodel.containsAxiom(factory.getOWLClassAssertionAxiom(ontoclsrule, rule))){
-              System.err.println("The rule with name "+ruleName+" is not inside the ontology. Pleas check the name.");
+              LoggerFactory.getLogger(RemoveRule.class).error("The rule with name "+ruleName+" is not inside the ontology. Pleas check the name.");
               if(!owlmodel.containsAxiom(factory.getOWLClassAssertionAxiom(ontoclsrecipe, recipe))){
-                System.err.println("The rule with name "+recipeName+" is not inside the ontology. Pleas check the name.");
+                LoggerFactory.getLogger(RemoveRule.class).error("The rule with name "+recipeName+" is not inside the ontology. Pleas check the name.");
                 return false;
               }
               return false;
@@ -287,28 +288,28 @@ public class RemoveRule {
 
         String desc = getrecipe.getDescription(recipeName);
         if(desc.isEmpty()){
-            System.err.println("Description for "+recipeName+" not found");
+            LoggerFactory.getLogger(RemoveRule.class).error("Description for "+recipeName+" not found");
                 return false;
         }
 
         if(ruleseq.contains(ruleName))
             ruleseq.remove(ruleseq.indexOf(ruleName));
         else{
-            System.err.println("The rule with name "+ruleName+" is not inside the ontology. Pleas check the name.");
+            LoggerFactory.getLogger(RemoveRule.class).error("The rule with name "+ruleName+" is not inside the ontology. Pleas check the name.");
             return false;
         }
 
             //Remove the old recipe
             RemoveRecipe remove;
             try {
-            remove = new RemoveRecipe(storeaux);
+                remove = new RemoveRecipe(storeaux);
                 ok = remove.removeRecipe(recipeName);
             } catch (Exception ex) {
-                Logger.getLogger(RemoveRule.class.getName()).log(Level.SEVERE, null, ex);
+                LoggerFactory.getLogger(RemoveRule.class).error(null,ex);
             }
             
             if(!ok){
-                System.err.println("Some errors occured when delete "+ruleName+" in recipe "+recipeName);
+                LoggerFactory.getLogger(RemoveRule.class).error("Some errors occured when delete "+ruleName+" in recipe "+recipeName);
                 return false;
             }
 

Modified: incubator/stanbol/trunk/rules/manager/src/main/java/org/apache/stanbol/rules/manager/changes/RuleStoreImpl.java
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/rules/manager/src/main/java/org/apache/stanbol/rules/manager/changes/RuleStoreImpl.java?rev=1135486&r1=1135485&r2=1135486&view=diff
==============================================================================
--- incubator/stanbol/trunk/rules/manager/src/main/java/org/apache/stanbol/rules/manager/changes/RuleStoreImpl.java (original)
+++ incubator/stanbol/trunk/rules/manager/src/main/java/org/apache/stanbol/rules/manager/changes/RuleStoreImpl.java Tue Jun 14 11:12:32 2011
@@ -9,9 +9,6 @@ import java.io.File;
 import java.io.FileNotFoundException;
 import java.io.FileOutputStream;
 import java.io.IOException;
-import java.io.InputStream;
-import java.net.URI;
-import java.net.URL;
 import java.util.Collections;
 import java.util.Dictionary;
 import java.util.HashSet;
@@ -107,7 +104,7 @@ public class RuleStoreImpl implements Ru
     public RuleStoreImpl(ONManager onm, Dictionary<String,Object> configuration) {
         this();
         this.onManager = onm;
-        activate(configuration);
+        //activate(configuration);
     }
 
     /**
@@ -131,8 +128,8 @@ public class RuleStoreImpl implements Ru
                 Properties configProps = System.getProperties();
                 String userdir = configProps.getProperty("user.dir");
                 
-                String respath = "src/main/resources/";
-                String filepath2 = "RuleOntology/rmi_config.owl";
+                String respath = "KReSConf/";//"src/main/resources/";
+                String filepath2 ="rmi_config.owl"; //"RuleOntology/rmi_config.owl";
 //                userdir = userdir.substring(0, userdir.lastIndexOf("kres.") + 5) + "rules/";
              
                 userdir += "/";
@@ -232,24 +229,32 @@ public class RuleStoreImpl implements Ru
     }
 
     protected void activate(Dictionary<String,Object> configuration) {
-
+        
         this.file = (String) configuration.get(RULE_ONTOLOGY);
         this.ruleOntologyNS = (String) configuration.get(RULE_ONTOLOGY_NAMESPACE);
-
+        
         if (file == null || file.equals("")) {
-            // InputStream ontologyStream =
-            // this.getClass().getResourceAsStream("/META-INF/conf/KReSOntologyRules.owl");
-            IRI inputontology = IRI.create("http://ontologydesignpatterns.org/ont/iks/kres/rmi_config.owl");
-            // if (inputontology == null) {
-            // log.err("Input ontology is null");
-            // }
-            try {
-                owlmodel = OWLManager.createOWLOntologyManager().loadOntologyFromOntologyDocument(
-                    inputontology);
-            } catch (OWLOntologyCreationException e) {
-                log.error("Cannot create the ontology " + inputontology.toString(), e);
-            } catch (Exception e) {
+            String sep = System.getProperty("file.separator");
+            String filedir = System.getProperty("user.dir")+sep+"KReSConf"+sep+"rmi_config.owl";
+            
+            if((new File(filedir)).exists()){
+                this.file = filedir;
+                try {
+                    owlmodel = OWLManager.createOWLOntologyManager().loadOntologyFromOntologyDocument(new File(file));
+                } catch (OWLOntologyCreationException e) {
+                    log.error("Cannot create the ontology " + filedir.toString(), e);
+                } catch (Exception e) {
+                    log.error("1 Rule Store: no rule ontology available.");
+                }
+            }else{    
+                IRI inputontology = IRI.create("http://ontologydesignpatterns.org/ont/iks/kres/rmi_config.owl");
+                try {
+                    owlmodel = OWLManager.createOWLOntologyManager().loadOntologyFromOntologyDocument(inputontology);
+                } catch (OWLOntologyCreationException e) {
+                    log.error("Cannot create the ontology " + inputontology.toString(), e);
+                } catch (Exception e) {
                 log.error("Rule Store: no rule ontology available.");
+                }
             }
 
             if (owlmodel != null) {
@@ -270,7 +275,7 @@ public class RuleStoreImpl implements Ru
                 }
             }
         } else {
-            IRI pathIri = IRI.create(file);
+            File pathIri = new File(file);
             try {
                 owlmodel = OWLManager.createOWLOntologyManager().loadOntologyFromOntologyDocument(pathIri);
             } catch (OWLOntologyCreationException e) {
@@ -387,7 +392,7 @@ public class RuleStoreImpl implements Ru
                     ruleList = generateKnowledgeBase(kReSRulesInKReSSyntax);
                 }
 
-                recipe = new RecipeImpl(recipeIRI, recipeDescription, ruleList);
+                recipe = (Recipe) new RecipeImpl(recipeIRI, recipeDescription, ruleList);
 
             } else {
                 throw new NoSuchRecipeException(recipeIRI);
@@ -435,12 +440,11 @@ public class RuleStoreImpl implements Ru
      */
     @Override
     public void saveOntology() {
-//        try {
+        try {
             FileOutputStream fos;
-//            if (this.file.isEmpty()) {
-                File dirs = new File("./KReSConf");
-                if (!dirs.exists()) dirs.mkdir();
-                file = "./KReSConf/rmi_config.owl";
+            if (this.file.isEmpty()) {
+                String sep = System.getProperty("file.separator");
+                this.file = System.getProperty("user.dir")+sep+"KReSConf"+sep+"rmi_config.owl";
                 try {
                     fos = new FileOutputStream(file);
                     OWLManager.createOWLOntologyManager().saveOntology(owlmodel,
@@ -450,16 +454,16 @@ public class RuleStoreImpl implements Ru
                 } catch (OWLOntologyStorageException e) {
                     log.error("Cannot store the ontology ", e);
                 }
-//            } else {
-//                fos = new FileOutputStream(file);
-//                this.owlmodel.getOWLOntologyManager().saveOntology(owlmodel, fos);
-//            }
-
-//        } catch (OWLOntologyStorageException ex) {
-//            log.error("Cannot store the ontology ", ex);
-//        } catch (FileNotFoundException ex) {
-//            log.error("Cannot store the ontology ", ex);
-//        }
+            } else {
+                fos = new FileOutputStream(file);
+                this.owlmodel.getOWLOntologyManager().saveOntology(owlmodel, fos);
+            }
+
+        } catch (OWLOntologyStorageException ex) {
+            log.error("Cannot store the ontology ", ex);
+        } catch (FileNotFoundException ex) {
+            log.error("Cannot store the ontology ", ex);
+        }
 
     }
 

Modified: incubator/stanbol/trunk/rules/web/pom.xml
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/rules/web/pom.xml?rev=1135486&r1=1135485&r2=1135486&view=diff
==============================================================================
--- incubator/stanbol/trunk/rules/web/pom.xml (original)
+++ incubator/stanbol/trunk/rules/web/pom.xml Tue Jun 14 11:12:32 2011
@@ -7,7 +7,7 @@
     <groupId>org.apache.stanbol</groupId>
     <artifactId>stanbol-parent</artifactId>
     <version>0.9-SNAPSHOT</version>
-    <relativePath>../../../parent</relativePath>
+    <relativePath>../../parent</relativePath>
   </parent>
 
   <groupId>org.apache.stanbol</groupId>

Modified: incubator/stanbol/trunk/rules/web/src/main/java/org/apache/stanbol/rules/web/resources/RecipeResource.java
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/rules/web/src/main/java/org/apache/stanbol/rules/web/resources/RecipeResource.java?rev=1135486&r1=1135485&r2=1135486&view=diff
==============================================================================
--- incubator/stanbol/trunk/rules/web/src/main/java/org/apache/stanbol/rules/web/resources/RecipeResource.java (original)
+++ incubator/stanbol/trunk/rules/web/src/main/java/org/apache/stanbol/rules/web/resources/RecipeResource.java Tue Jun 14 11:12:32 2011
@@ -35,7 +35,6 @@ import org.apache.stanbol.commons.web.ba
 import org.apache.stanbol.ontologymanager.ontonet.api.ONManager;
 import org.apache.stanbol.ontologymanager.ontonet.impl.ONManagerImpl;
 import org.apache.stanbol.ontologymanager.ontonet.impl.io.ClerezzaOntologyStorage;
-import org.apache.stanbol.rules.base.api.RuleStore;
 import org.apache.stanbol.rules.manager.changes.AddRecipe;
 import org.apache.stanbol.rules.manager.changes.GetRecipe;
 import org.apache.stanbol.rules.manager.changes.RemoveRecipe;
@@ -50,6 +49,7 @@ import org.semanticweb.owlapi.model.OWLN
 import org.semanticweb.owlapi.model.OWLObjectProperty;
 import org.semanticweb.owlapi.model.OWLOntology;
 import org.semanticweb.owlapi.model.OWLOntologyChange;
+import org.semanticweb.owlapi.model.OWLOntologyCreationException;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -66,7 +66,7 @@ public class RecipeResource extends Base
 
     private Logger log = LoggerFactory.getLogger(getClass());
 
-    private RuleStore kresRuleStore;
+    private RuleStoreImpl kresRuleStore;
     private ClerezzaOntologyStorage storage;
 
     /**
@@ -76,7 +76,7 @@ public class RecipeResource extends Base
      *            {To get the context where the REST service is running.}
      */
     public RecipeResource(@Context ServletContext servletContext) {
-        this.kresRuleStore = (RuleStore) servletContext.getAttribute(RuleStore.class.getName());
+        this.kresRuleStore = (RuleStoreImpl) servletContext.getAttribute(RuleStoreImpl.class.getName());
         this.onm = (ONManager) servletContext.getAttribute(ONManager.class.getName());
         //      this.storage = (OntologyStorage) servletContext
         //      .getAttribute(OntologyStorage.class.getName());
@@ -118,20 +118,16 @@ public class RecipeResource extends Base
      */
     @GET
     @Path("/{uri:.+}")
-    @Produces(value = {KRFormat.RDF_XML, KRFormat.TURTLE, KRFormat.OWL_XML, KRFormat.FUNCTIONAL_OWL,
-                       KRFormat.MANCHESTER_OWL, KRFormat.RDF_JSON})
-    public Response getRecipe(@PathParam("uri") String uri) {
+    @Produces(value = {KRFormat.RDF_XML, KRFormat.RDF_JSON, KRFormat.OWL_XML, KRFormat.FUNCTIONAL_OWL,KRFormat.MANCHESTER_OWL, KRFormat.TURTLE})
+    public Response getRecipe(@PathParam("uri") String uri) throws OWLOntologyCreationException {
         try {
-
-            GetRecipe rule = new GetRecipe(kresRuleStore);
-
+        
+            GetRecipe rule = new GetRecipe(kresRuleStore);;    
             // String ID =
             // kresRuleStore.getOntology().getOntologyID().toString().replace(">","").replace("<","")+"#";
 
             if (uri.equals("all")) {
-
                 Vector<IRI> recipe = rule.getGeneralRecipes();
-
                 if (recipe == null) {
                     // The recipe does not exists in the manager
                     return Response.status(Status.NOT_FOUND).build();
@@ -173,7 +169,6 @@ public class RecipeResource extends Base
                     // // TODO Auto-generated catch block
                     // e.printStackTrace();
                     // }
-
                     return Response.ok(newmodel).build();
                 }
 
@@ -257,11 +252,9 @@ public class RecipeResource extends Base
      *         500 Some error occurred
      */
     @POST
-    @Consumes(MediaType.MULTIPART_FORM_DATA)
-    @Produces(value = {KRFormat.RDF_XML, KRFormat.TURTLE, KRFormat.OWL_XML, KRFormat.FUNCTIONAL_OWL,
-                       KRFormat.MANCHESTER_OWL, KRFormat.RDF_JSON})
-    public Response addRecipe(@FormParam(value = "recipe") String recipe,
-                              @FormParam(value = "description") String description) {
+    @Consumes(MediaType.APPLICATION_FORM_URLENCODED)
+    @Produces(value = {KRFormat.RDF_XML, KRFormat.TURTLE, KRFormat.OWL_XML, KRFormat.FUNCTIONAL_OWL,KRFormat.MANCHESTER_OWL, KRFormat.RDF_JSON})
+    public Response addRecipe(@FormParam(value = "recipe") String recipe, @FormParam(value = "description") String description) {
 
         try {
 

Modified: incubator/stanbol/trunk/rules/web/src/main/java/org/apache/stanbol/rules/web/resources/RuleResource.java
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/rules/web/src/main/java/org/apache/stanbol/rules/web/resources/RuleResource.java?rev=1135486&r1=1135485&r2=1135486&view=diff
==============================================================================
--- incubator/stanbol/trunk/rules/web/src/main/java/org/apache/stanbol/rules/web/resources/RuleResource.java (original)
+++ incubator/stanbol/trunk/rules/web/src/main/java/org/apache/stanbol/rules/web/resources/RuleResource.java Tue Jun 14 11:12:32 2011
@@ -92,25 +92,19 @@ public class RuleResource extends BaseSt
 		 * 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>());
+            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) {
+            if (storage == null) {
             log.warn("No OntologyStorage in servlet context. Instantiating manually...");
             storage = new ClerezzaOntologyStorage(new TcManager(),null);
 		}
 
        if (kresRuleStore == null) {
-			log
-					.warn("No KReSRuleStore with stored rules and recipes found in servlet context. Instantiating manually with default values...");
-			this.kresRuleStore = new RuleStoreImpl(onm,
-					new Hashtable<String, Object>(), "");
-			log
-					.debug("PATH TO OWL FILE LOADED: "
-							+ kresRuleStore.getFilePath());
+			log.warn("No KReSRuleStore with stored rules and recipes found in servlet context. Instantiating manually with default values...");
+			this.kresRuleStore = new RuleStoreImpl(onm, new Hashtable<String, Object>(), "");
+			log.debug("PATH TO OWL FILE LOADED: "+ kresRuleStore.getFilePath());
         }
     }
 
@@ -131,8 +125,7 @@ public class RuleResource extends BaseSt
      */
     @GET
     @Path("/{uri:.+}")
-	@Produces(value = { KRFormat.RDF_XML, KRFormat.TURTLE,
-			KRFormat.OWL_XML })
+    @Produces(value = { KRFormat.RDF_XML, KRFormat.TURTLE, KRFormat.OWL_XML, KRFormat.RDF_JSON, KRFormat.FUNCTIONAL_OWL, KRFormat.MANCHESTER_OWL})
     public Response getRule(@PathParam("uri") String uri){
  
       try{
@@ -255,7 +248,7 @@ public class RuleResource extends BaseSt
     
     @GET
     @Path("/of-recipe/{uri:.+}")
-	@Produces(value = { KRFormat.RDF_XML, KRFormat.RDF_JSON })
+    @Produces(value = {KRFormat.RDF_XML, KRFormat.TURTLE, KRFormat.OWL_XML, KRFormat.FUNCTIONAL_OWL,KRFormat.MANCHESTER_OWL, KRFormat.RDF_JSON})
     public Response getRulesOfRecipe(@PathParam("uri") String recipeURI){
     	
     	GetRule kReSGetRule = new GetRule(kresRuleStore);
@@ -307,7 +300,8 @@ public class RuleResource extends BaseSt
      *      500 Some error occurred
      */
     @POST
-    @Consumes(MediaType.MULTIPART_FORM_DATA)
+    @Consumes(MediaType.APPLICATION_FORM_URLENCODED)
+    @Produces(value = {KRFormat.RDF_XML, KRFormat.TURTLE, KRFormat.OWL_XML, KRFormat.FUNCTIONAL_OWL,KRFormat.MANCHESTER_OWL, KRFormat.RDF_JSON})
 	public Response addRuleToRecipe(@FormParam(value = "recipe") String recipe,
 			@FormParam(value = "rule") String rule,
 			@FormParam(value = "kres-syntax") String kres_syntax,
@@ -381,8 +375,7 @@ public class RuleResource extends BaseSt
          if((kres_syntax!=null)&(description!=null)){
             //Get the rule
             AddRule inrule = new AddRule(kresRuleStore);
-				boolean ok = inrule.addRule(IRI.create(rule), kres_syntax,
-						description);
+            boolean ok = inrule.addRule(IRI.create(rule), kres_syntax, description);
             if(!ok){
                 System.err.println("PROBLEM TO ADD: "+rule);
                 return Response.status(Status.CONFLICT).build();
@@ -486,9 +479,10 @@ public class RuleResource extends BaseSt
                 return Response.status(Status.NOT_FOUND).build();
             }
             
+            //Remove rule from recipe
             RemoveRule remove = new RemoveRule(kresRuleStore);
-				ok = remove.removeRuleFromRecipe(IRI.create(rule), IRI
-						.create(recipe));
+            ok = remove.removeRuleFromRecipe(IRI.create(rule), IRI.create(recipe));
+                                                   
             if(ok){
                 kresRuleStore.saveOntology();
                 return Response.status(Status.OK).build();
@@ -507,13 +501,12 @@ public class RuleResource extends BaseSt
                 return Response.status(Status.NOT_FOUND).build();
             }
 
-            //Remove the old recipe
+            //Remove the old rule
             RemoveRule remove = new RemoveRule(kresRuleStore);
             ok = remove.removeRule(IRI.create(rule));
-
             if(ok){
                 kresRuleStore.saveOntology();
-                return Response.ok().build();
+                return Response.status(Status.OK).build();
             }else{
                 return Response.status(Status.NO_CONTENT).build();
             }