You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@stanbol.apache.org by en...@apache.org on 2011/04/01 14:47:56 UTC

svn commit: r1087688 [11/19] - in /incubator/stanbol/trunk/rules: ./ base/ base/.settings/ base/src/ base/src/main/ base/src/main/java/ base/src/main/java/org/ base/src/main/java/org/apache/ base/src/main/java/org/apache/stanbol/ base/src/main/java/org...

Added: incubator/stanbol/trunk/rules/web/src/main/java/org/apache/stanbol/rules/web/RestRule.java
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/rules/web/src/main/java/org/apache/stanbol/rules/web/RestRule.java?rev=1087688&view=auto
==============================================================================
--- incubator/stanbol/trunk/rules/web/src/main/java/org/apache/stanbol/rules/web/RestRule.java (added)
+++ incubator/stanbol/trunk/rules/web/src/main/java/org/apache/stanbol/rules/web/RestRule.java Fri Apr  1 12:47:48 2011
@@ -0,0 +1,531 @@
+/*
+ * To change this template, choose Tools | Templates
+ * and open the template in the editor.
+ */
+
+package org.apache.stanbol.rules.web;
+
+import java.io.UnsupportedEncodingException;
+import java.net.URLEncoder;
+import java.util.HashMap;
+import java.util.Hashtable;
+import java.util.Iterator;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Set;
+import java.util.Vector;
+
+import javax.servlet.ServletContext;
+import javax.ws.rs.Consumes;
+import javax.ws.rs.DELETE;
+import javax.ws.rs.FormParam;
+import javax.ws.rs.GET;
+import javax.ws.rs.POST;
+import javax.ws.rs.Path;
+import javax.ws.rs.PathParam;
+import javax.ws.rs.Produces;
+import javax.ws.rs.QueryParam;
+import javax.ws.rs.WebApplicationException;
+import javax.ws.rs.core.Context;
+import javax.ws.rs.core.MediaType;
+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.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.AddRule;
+import org.apache.stanbol.rules.manager.changes.GetRecipe;
+import org.apache.stanbol.rules.manager.changes.GetRule;
+import org.apache.stanbol.rules.manager.changes.RemoveRecipe;
+import org.apache.stanbol.rules.manager.changes.RemoveRule;
+import org.apache.stanbol.rules.manager.changes.RuleStoreImpl;
+import org.semanticweb.owlapi.apibinding.OWLManager;
+import org.semanticweb.owlapi.model.AddImport;
+import org.semanticweb.owlapi.model.IRI;
+import org.semanticweb.owlapi.model.OWLDataFactory;
+import org.semanticweb.owlapi.model.OWLIndividualAxiom;
+import org.semanticweb.owlapi.model.OWLNamedIndividual;
+import org.semanticweb.owlapi.model.OWLOntology;
+import org.semanticweb.owlapi.model.OWLOntologyChange;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import org.apache.stanbol.kres.jersey.format.KRFormat;
+import org.apache.stanbol.kres.jersey.resource.NavigationMixin;
+
+/**
+ *
+ * @author elvio
+ * @author andrea.nuzzolese
+ * 
+ */
+@Path("/rule")
+public class RestRule extends NavigationMixin{
+
+	protected ONManager onm;
+	protected ClerezzaOntologyStorage storage;
+
+	private Logger log = LoggerFactory.getLogger(getClass());
+
+	private RuleStore kresRuleStore;
+    private HashMap<IRI, String> map;
+    private String desc;
+
+   /**
+     * To get the RuleStoreImpl where are stored the rules and the recipes
+     *
+	 * @param servletContext
+	 *            {To get the context where the REST service is running.}
+     */
+    public RestRule(@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);
+		}
+
+       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());
+        }
+    }
+
+   /**
+	 * Get a rule from the rule base (that is the ontology that contains the
+	 * rules and the recipe). curl -v -X GET
+	 * http://localhost:8080/kres/rule/http
+	 * ://kres.iks-project.eu/ontology/meta/rmi.owl#ProvaParentRule
+	 * 
+	 * @param uri
+	 *            {A string contains the IRI full name of the rule.}
+     * @return Return: <br/>
+	 *         200 The rule is retrieved (import declarations point to KReS
+	 *         Services) <br/>
+     *       404 The rule does not exists in the manager <br/>
+     *       500 Some error occurred
+     *
+     */
+    @GET
+    @Path("/{uri:.+}")
+	@Produces(value = { KRFormat.RDF_XML, KRFormat.TURTLE,
+			KRFormat.OWL_XML })
+    public Response getRule(@PathParam("uri") String uri){
+ 
+      try{
+
+       GetRule recipe = new GetRule(kresRuleStore);
+       if(uri.equals("all")){
+
+           HashMap<IRI, String> rule = recipe.getAllRules();
+           Iterator<IRI> keys = rule.keySet().iterator();
+          
+        if(rule==null){
+            return Response.status(Status.NOT_FOUND).build();
+        }else{
+
+            OWLOntology onto = kresRuleStore.getOntology();
+					OWLOntology newmodel = OWLManager
+							.createOWLOntologyManager().createOntology(
+									onto.getOntologyID());
+					OWLDataFactory factory = onto.getOWLOntologyManager()
+							.getOWLDataFactory();
+
+					Iterator<OWLOntology> importedonto = onto
+							.getDirectImports().iterator();
+            List<OWLOntologyChange> additions = new LinkedList<OWLOntologyChange>();
+					OWLDataFactory auxfactory = onto.getOWLOntologyManager()
+							.getOWLDataFactory();
+
+            while(importedonto.hasNext()){
+                OWLOntology auxonto = importedonto.next();
+						additions.add(new AddImport(newmodel, auxfactory
+								.getOWLImportsDeclaration(auxonto
+										.getOWLOntologyManager()
+										.getOntologyDocumentIRI(auxonto))));
+            }
+
+            if(!additions.isEmpty())
+						newmodel.getOWLOntologyManager()
+								.applyChanges(additions);
+
+            while(keys.hasNext()){
+						OWLNamedIndividual ind = factory
+								.getOWLNamedIndividual(keys.next());
+                Set<OWLIndividualAxiom> ax = onto.getAxioms(ind);
+						newmodel.getOWLOntologyManager()
+								.addAxioms(newmodel, ax);
+            }
+
+//            try {
+//						OWLManager.createOWLOntologyManager().saveOntology(
+//								newmodel,
+//								newmodel.getOWLOntologyManager()
+//										.getOntologyFormat(newmodel),
+//								System.out);
+//    		} catch (OWLOntologyStorageException e) {
+//    			// TODO Auto-generated catch block
+//    			e.printStackTrace();
+//    		}
+
+            return Response.ok(newmodel).build();
+        }
+
+       }else{
+
+        HashMap<IRI, String> rule = recipe.getRule(IRI.create(uri));
+       
+        if(rule==null){
+            return Response.status(Status.NOT_FOUND).build();
+        }else{
+            OWLOntology onto = kresRuleStore.getOntology();
+
+					OWLDataFactory factory = onto.getOWLOntologyManager()
+							.getOWLDataFactory();
+					OWLNamedIndividual ind = factory.getOWLNamedIndividual(IRI
+							.create(uri));
+            Set<OWLIndividualAxiom> ax = onto.getAxioms(ind);
+					OWLOntology newmodel = OWLManager
+							.createOWLOntologyManager().createOntology(
+									onto.getOntologyID());
+
+					Iterator<OWLOntology> importedonto = onto
+							.getDirectImports().iterator();
+            List<OWLOntologyChange> additions = new LinkedList<OWLOntologyChange>();
+					OWLDataFactory auxfactory = onto.getOWLOntologyManager()
+							.getOWLDataFactory();
+
+            while(importedonto.hasNext()){
+                OWLOntology auxonto = importedonto.next();
+						additions.add(new AddImport(newmodel, auxfactory
+								.getOWLImportsDeclaration(auxonto
+										.getOWLOntologyManager()
+										.getOntologyDocumentIRI(auxonto))));
+            }
+
+            if(!additions.isEmpty())
+						newmodel.getOWLOntologyManager()
+								.applyChanges(additions);
+
+            newmodel.getOWLOntologyManager().addAxioms(newmodel,ax);
+
+//            try {
+//						OWLManager.createOWLOntologyManager().saveOntology(
+//								newmodel,
+//								newmodel.getOWLOntologyManager()
+//										.getOntologyFormat(newmodel),
+//								System.out);
+//    		} catch (OWLOntologyStorageException e) {
+//    			// TODO Auto-generated catch block
+//    			e.printStackTrace();
+//    		}
+
+            return Response.ok(newmodel).build();
+        }
+       }
+      }catch (Exception e){
+          //Some error occurred
+         throw new WebApplicationException(e, Status.INTERNAL_SERVER_ERROR);
+      }
+
+    }
+    
+    @GET
+    @Path("/of-recipe/{uri:.+}")
+	@Produces(value = { KRFormat.RDF_XML, KRFormat.RDF_JSON })
+    public Response getRulesOfRecipe(@PathParam("uri") String recipeURI){
+    	
+    	GetRule kReSGetRule = new GetRule(kresRuleStore);
+    	String recipeURIEnc;
+		try {
+			recipeURIEnc = URLEncoder
+					.encode(
+							"http://kres.iks-project.eu/ontology/meta/rmi_config.owl#MyRecipeA",
+							"UTF-8");
+			System.out.println("RECIPE : "+recipeURIEnc);
+		} catch (UnsupportedEncodingException e) {
+			// TODO Auto-generated catch block
+			e.printStackTrace();
+		}
+    	
+    	System.out.println("RECIPE IRI : "+IRI.create(recipeURI).toString());
+		OWLOntology ontology = kReSGetRule.getAllRulesOfARecipe(IRI
+				.create(recipeURI));
+		
+    	return Response.ok(ontology).build();
+			
+    }
+
+   /**
+	 * To add a rule to a recipe at the end of the sequence. curl -v -X POST -F
+	 * "recipe=http://kres.iks-project.eu/ontology/meta/rmi.owl%23ProvaParentRecipe"
+	 * -F "rule=http://kres.iks-project.eu/ontology/meta/rmi.owl%23ProvaRuleNEW"
+	 * -F "kres-syntax=body -> head" -F "description=prova di aggiunta regola"
+	 * http://localhost:8080/kres/rule
+	 * 
+	 * @param recipe
+	 *            {A string contains the IRI of the recipe where to add the
+	 *            rule}
+	 * @param rule
+	 *            {A string contains the IRI of the rule to be added at the
+	 *            recipe}
+	 * @param kres_syntax
+	 *            {A string contains the body and the head of the kres rule. If
+	 *            not specified the rule is search in the Ontology otherwise is
+	 *            added as new.}
+	 * @param description
+	 *            {A string contains a description of the rule}
+     * @return Return: <br/>
+     *      200 The rule has been added <br/>
+     *      204 The rule has not been added <br/>
+     *      400 The rule and recipe are not specified<br/>
+     *      404 Recipe or rule not found<br/>
+     *      409 The rule has not been added<br/>
+     *      500 Some error occurred
+     */
+    @POST
+    @Consumes(MediaType.MULTIPART_FORM_DATA)
+	public Response addRuleToRecipe(@FormParam(value = "recipe") String recipe,
+			@FormParam(value = "rule") String rule,
+			@FormParam(value = "kres-syntax") String kres_syntax,
+			@FormParam(value = "description") String description) {
+    
+//        System.err.println("recipe "+recipe);
+//        System.err.println("rule " + rule);
+//        System.err.println("kres-syntax "+kres_syntax);
+//        System.err.println("description "+description);
+//
+//        return Response.ok().build();
+           
+        try{
+
+         if((recipe==null)&&(rule==null)){
+                return Response.status(Status.BAD_REQUEST).build();
+         }
+
+         recipe = recipe.replace(" ","").trim();
+         rule = rule.replace(" ","").trim();
+
+         //The rule is already inside the rule store
+         if((kres_syntax==null)){
+            //Get the rule
+            GetRule inrule = new GetRule(kresRuleStore);
+            this.map = inrule.getRule(IRI.create(rule));
+            
+            if(map==null){
+                return Response.status(Status.NOT_FOUND).build();
+            }
+
+            //Get the recipe
+            GetRecipe getrecipe = new GetRecipe(kresRuleStore);
+            this.map = getrecipe.getRecipe(IRI.create(recipe));
+            if(map!=null){
+                this.desc = getrecipe.getDescription(IRI.create(recipe));
+                if(desc==null)
+                    Response.status(Status.NOT_FOUND).build();
+            }else{
+                return Response.status(Status.NOT_FOUND).build();
+            }
+
+            String[] sequence = map.get(IRI.create(recipe)).split(",");
+            Vector<IRI> ruleseq = new Vector();
+            if(!sequence[0].isEmpty())
+            for(String seq : sequence)
+                ruleseq.add(IRI.create(seq.replace(" ","").trim()));
+
+            //Add the new rule to the end
+            ruleseq.add(IRI.create(rule));
+            //Remove the old recipe
+            RemoveRecipe remove = new RemoveRecipe(kresRuleStore);
+            boolean ok = remove.removeRecipe(IRI.create(recipe));
+            
+            if(!ok)
+                return Response.status(Status.CONFLICT).build();
+
+            //Add the recipe with the new rule
+            AddRecipe newadd = new AddRecipe(kresRuleStore);
+            ok = newadd.addRecipe(IRI.create(recipe), ruleseq, desc);
+            
+            if(ok){
+                    kresRuleStore.saveOntology();
+                    return Response.ok().build();
+            }else{
+                    return Response.status(Status.NO_CONTENT).build();
+            }
+        }
+
+        //The rule is added to the store and to the recipe
+         if((kres_syntax!=null)&(description!=null)){
+            //Get the rule
+            AddRule inrule = new AddRule(kresRuleStore);
+				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();
+            }
+            
+            //Get the recipe
+            GetRecipe getrecipe = new GetRecipe(kresRuleStore);
+            this.map = getrecipe.getRecipe(IRI.create(recipe));
+            System.out.println("RECIPE FOR RULE: "+recipe);
+            if(map!=null){
+                this.desc = getrecipe.getDescription(IRI.create(recipe));
+               
+                if(desc==null)
+                   return Response.status(Status.NOT_FOUND).build();
+            }else{
+                return Response.status(Status.NOT_FOUND).build();
+            }
+
+            String[] sequence = map.get(IRI.create(recipe)).split(",");
+            Vector<IRI> ruleseq = new Vector();
+            if(!sequence[0].isEmpty())
+            for(String seq : sequence)
+                ruleseq.add(IRI.create(seq.replace(" ","").trim()));
+
+            //Add the new rule to the end          
+            ruleseq.add(IRI.create(rule));
+            //Remove the old recipe
+            RemoveRecipe remove = new RemoveRecipe(kresRuleStore);
+            ok = remove.removeRecipe(IRI.create(recipe));
+            if(!ok){
+                System.err.println("ERROR TO REMOVE OLD RECIPE: "+recipe);
+                return Response.status(Status.CONFLICT).build();
+            }
+
+            //Add the recipe with the new rule
+            AddRecipe newadd = new AddRecipe(kresRuleStore);
+            ok = newadd.addRecipe(IRI.create(recipe), ruleseq, desc);
+            if(ok){
+                    kresRuleStore.saveOntology();
+                    return Response.ok().build();
+            }else{
+                    return Response.status(Status.NO_CONTENT).build();
+            }
+        }else{
+             return Response.status(Status.BAD_REQUEST).build();
+        }
+
+        }catch (Exception e){
+            throw new WebApplicationException(e, Status.INTERNAL_SERVER_ERROR);
+        }
+    }
+
+   /**
+	 * To delete a rule from a recipe or from the ontology. If the recipe is not
+	 * specified the rule is deleted from the ontology. curl -v -X DELETE -G \
+	 * -d recipe=
+	 * "http://kres.iks-project.eu/ontology/meta/rmi.owl#ProvaParentRecipe" \ -d
+	 * rule
+	 * ="http://kres.iks-project.eu/ontology/meta/rmi.owl#ProvaParentNewRule" \
+     * http://localhost:port/kres/rule
+    *
+     * @Param rule {A string contains an IRI of the rule to be removed}
+	 * @param recipe
+	 *            {A string contains an IRI of the recipe where remove the rule}
+     * @return Return: <br/>
+     *      200 The rule has been deleted<br/>
+     *      204 The rule has not been deleted<br/>
+     *      404 Recipe or rule not found<br/>
+     *      409 The recipe has not been deleted<br/>
+     *      500 Some error occurred
+     */
+    @DELETE
+    //@Consumes(MediaType.TEXT_PLAIN)
+    @Produces(KRFormat.TEXT_PLAIN)
+	public Response removeRule(@QueryParam(value = "rule") String rule,
+			@QueryParam(value = "recipe") String recipe) {
+
+        boolean ok;
+
+        try{
+         
+         //Delete from the recipe
+         if((recipe!=null)&&(rule!=null)){
+             recipe = recipe.replace(" ","").trim();
+             rule = rule.replace(" ","").trim();
+            //Get the rule
+            GetRule getrule = new GetRule(kresRuleStore);
+            this.map = getrule.getRule(IRI.create(rule));
+            if(map==null){
+                return Response.status(Status.NOT_FOUND).build();
+            }
+
+            //Get the recipe
+            GetRecipe getrecipe = new GetRecipe(kresRuleStore);
+            this.map = getrecipe.getRecipe(IRI.create(recipe));
+            if(map!=null){
+                this.desc = getrecipe.getDescription(IRI.create(recipe));
+                if(desc.isEmpty())
+                    return Response.status(Status.NOT_FOUND).build();
+            }else{
+                return Response.status(Status.NOT_FOUND).build();
+            }
+            
+            RemoveRule remove = new RemoveRule(kresRuleStore);
+				ok = remove.removeRuleFromRecipe(IRI.create(rule), IRI
+						.create(recipe));
+            if(ok){
+                kresRuleStore.saveOntology();
+                return Response.status(Status.OK).build();
+            }else{
+                return Response.status(Status.NO_CONTENT).build();
+            }
+         }
+
+         //Delete from the ontology
+         if((recipe==null)&&(rule!=null)){
+             rule = rule.replace(" ","").trim();
+            //Get the rule
+            GetRule getrule = new GetRule(kresRuleStore);
+            this.map = getrule.getRule(IRI.create(rule));
+            if(map==null){
+                return Response.status(Status.NOT_FOUND).build();
+            }
+
+            //Remove the old recipe
+            RemoveRule remove = new RemoveRule(kresRuleStore);
+            ok = remove.removeRule(IRI.create(rule));
+
+            if(ok){
+                kresRuleStore.saveOntology();
+                return Response.ok().build();
+            }else{
+                return Response.status(Status.NO_CONTENT).build();
+            }
+         }else{
+             return Response.status(Status.BAD_REQUEST).build();
+         }
+            
+        }catch(Exception e){
+           throw new WebApplicationException(e, Status.INTERNAL_SERVER_ERROR);
+        }
+    }
+
+}

Added: incubator/stanbol/trunk/rules/web/src/main/java/org/apache/stanbol/rules/web/RuleStoreResource.java
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/rules/web/src/main/java/org/apache/stanbol/rules/web/RuleStoreResource.java?rev=1087688&view=auto
==============================================================================
--- incubator/stanbol/trunk/rules/web/src/main/java/org/apache/stanbol/rules/web/RuleStoreResource.java (added)
+++ incubator/stanbol/trunk/rules/web/src/main/java/org/apache/stanbol/rules/web/RuleStoreResource.java Fri Apr  1 12:47:48 2011
@@ -0,0 +1,50 @@
+/*
+ * To change this template, choose Tools | Templates
+ * and open the template in the editor.
+ */
+
+package org.apache.stanbol.rules.web;
+
+import javax.servlet.ServletContext;
+import javax.ws.rs.GET;
+import javax.ws.rs.Path;
+import javax.ws.rs.Produces;
+import javax.ws.rs.core.Context;
+import javax.ws.rs.core.Response;
+
+import org.apache.stanbol.rules.manager.changes.RuleStoreImpl;
+
+/**
+ *
+ * @author elvio
+ */
+@Path("/rulestore")
+public class RuleStoreResource {
+    
+    private RuleStoreImpl kresRuleStore;
+
+   /**
+     * To get the RuleStoreImpl where are stored the rules and the recipes
+     *
+     * @param servletContext {To get the context where the REST service is running.}
+     */
+    public RuleStoreResource(@Context ServletContext servletContext){
+       this.kresRuleStore = (RuleStoreImpl) servletContext.getAttribute(RuleStoreImpl.class.getName());
+       if (kresRuleStore == null) {
+            throw new IllegalStateException(
+                    "KReSRuleStore with stored rules and recipes is missing in ServletContext");
+        }
+    }
+
+   /**
+     * To get the RuleStoreImpl in the serveletContext.
+     * @return {An object of type RuleStoreImpl.}
+     */
+    @GET
+    //@Consumes(MediaType.APPLICATION_FORM_URLENCODED)
+    @Produces("application/rdf+xml")
+    public Response getRuleStore(){
+        return Response.ok(this.kresRuleStore).build();
+    }
+
+}

Propchange: incubator/stanbol/trunk/rules/web/src/main/java/org/apache/stanbol/rules/web/resources/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Fri Apr  1 12:47:48 2011
@@ -0,0 +1 @@
+target

Added: incubator/stanbol/trunk/rules/web/src/main/java/org/apache/stanbol/rules/web/resources/RefactorerResource.java
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/rules/web/src/main/java/org/apache/stanbol/rules/web/resources/RefactorerResource.java?rev=1087688&view=auto
==============================================================================
--- incubator/stanbol/trunk/rules/web/src/main/java/org/apache/stanbol/rules/web/resources/RefactorerResource.java (added)
+++ incubator/stanbol/trunk/rules/web/src/main/java/org/apache/stanbol/rules/web/resources/RefactorerResource.java Fri Apr  1 12:47:48 2011
@@ -0,0 +1,124 @@
+package org.apache.stanbol.rules.web.resources;
+
+import java.io.InputStream;
+
+import javax.servlet.ServletContext;
+import javax.ws.rs.Consumes;
+import javax.ws.rs.FormParam;
+import javax.ws.rs.GET;
+import javax.ws.rs.POST;
+import javax.ws.rs.Path;
+import javax.ws.rs.Produces;
+import javax.ws.rs.QueryParam;
+import javax.ws.rs.core.Context;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.Response;
+
+import org.apache.clerezza.rdf.core.access.TcManager;
+import org.apache.stanbol.kres.jersey.format.KRFormat;
+import org.apache.stanbol.kres.jersey.resource.NavigationMixin;
+import org.apache.stanbol.ontologymanager.ontonet.api.ONManager;
+import org.apache.stanbol.rules.base.api.NoSuchRecipeException;
+import org.apache.stanbol.rules.refactor.api.Refactorer;
+import org.apache.stanbol.rules.refactor.api.RefactoringException;
+import org.semanticweb.owlapi.apibinding.OWLManager;
+import org.semanticweb.owlapi.model.IRI;
+import org.semanticweb.owlapi.model.OWLOntology;
+import org.semanticweb.owlapi.model.OWLOntologyCreationException;
+import org.semanticweb.owlapi.model.OWLOntologyManager;
+
+import com.sun.jersey.api.view.ImplicitProduces;
+
+/**
+ * 
+ * @author andrea.nuzzolese
+ * 
+ */
+
+@Path("/refactorer")
+@ImplicitProduces(MediaType.TEXT_HTML + ";qs=2")
+public class RefactorerResource extends NavigationMixin {
+
+    protected ONManager onManager;
+    protected Refactorer semionRefactorer;
+    // protected SemionManager semionManager;
+    protected TcManager tcManager;
+
+    public RefactorerResource(@Context ServletContext servletContext) {
+        semionRefactorer = (Refactorer) (servletContext.getAttribute(Refactorer.class.getName()));
+
+        onManager = (ONManager) (servletContext.getAttribute(ONManager.class.getName()));
+
+        tcManager = (TcManager) (servletContext.getAttribute(TcManager.class.getName()));
+        if (semionRefactorer == null) {
+            throw new IllegalStateException("SemionRefactorer missing in ServletContext");
+        }
+
+    }
+
+    public String getNamespace() {
+        return onManager.getKReSNamespace();
+    }
+
+    @POST
+    @Path("/lazy")
+    @Consumes(MediaType.MULTIPART_FORM_DATA)
+    @Produces(value = {KRFormat.TURTLE, KRFormat.FUNCTIONAL_OWL, KRFormat.MANCHESTER_OWL, KRFormat.RDF_XML,
+                       KRFormat.OWL_XML, KRFormat.RDF_JSON})
+    public Response performRefactoring(@FormParam("recipe") String recipe,
+                                       @FormParam("input") InputStream input) {
+
+        // Refactorer semionRefactorer = semionManager.getRegisteredRefactorer();
+
+        IRI recipeIRI = IRI.create(recipe);
+
+        OWLOntologyManager manager = OWLManager.createOWLOntologyManager();
+        OWLOntology inputOntology;
+        try {
+            inputOntology = manager.loadOntologyFromOntologyDocument(input);
+
+            OWLOntology outputOntology;
+            try {
+                outputOntology = semionRefactorer.ontologyRefactoring(inputOntology, recipeIRI);
+            } catch (RefactoringException e) {
+                e.printStackTrace();
+                return Response.status(500).build();
+            } catch (NoSuchRecipeException e) {
+                return Response.status(204).build();
+            }
+
+            return Response.ok(outputOntology).build();
+        } catch (OWLOntologyCreationException e) {
+            e.printStackTrace();
+            return Response.status(404).build();
+        }
+
+    }
+
+    @GET
+    @Path("/lazy")
+    public Response performRefactoringLazyCreateGraph(@QueryParam("recipe") String recipe,
+                                                      @QueryParam("input-graph") String inputGraph,
+                                                      @QueryParam("output-graph") String outputGraph) {
+
+        System.out.println("recipe: " + recipe);
+        System.out.println("input-graph: " + inputGraph);
+        System.out.println("output-graph: " + outputGraph);
+        IRI recipeIRI = IRI.create(recipe);
+        IRI inputGraphIRI = IRI.create(inputGraph);
+        IRI outputGraphIRI = IRI.create(outputGraph);
+
+        // Refactorer semionRefactorer = semionManager.getRegisteredRefactorer();
+
+        try {
+            semionRefactorer.ontologyRefactoring(outputGraphIRI, inputGraphIRI, recipeIRI);
+            return Response.ok().build();
+        } catch (RefactoringException e) {
+            return Response.status(500).build();
+        } catch (NoSuchRecipeException e) {
+            return Response.status(204).build();
+        }
+
+    }
+
+}

Added: incubator/stanbol/trunk/rules/web/src/main/java/org/apache/stanbol/rules/web/resources/RestRecipe.java
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/rules/web/src/main/java/org/apache/stanbol/rules/web/resources/RestRecipe.java?rev=1087688&view=auto
==============================================================================
--- incubator/stanbol/trunk/rules/web/src/main/java/org/apache/stanbol/rules/web/resources/RestRecipe.java (added)
+++ incubator/stanbol/trunk/rules/web/src/main/java/org/apache/stanbol/rules/web/resources/RestRecipe.java Fri Apr  1 12:47:48 2011
@@ -0,0 +1,335 @@
+/*
+ * To change this template, choose Tools | Templates
+ * and open the template in the editor.
+ */
+
+package org.apache.stanbol.rules.web.resources;
+
+import java.util.HashMap;
+import java.util.Hashtable;
+import java.util.Iterator;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Set;
+import java.util.Vector;
+
+import javax.servlet.ServletContext;
+import javax.ws.rs.Consumes;
+import javax.ws.rs.DELETE;
+import javax.ws.rs.FormParam;
+import javax.ws.rs.GET;
+import javax.ws.rs.POST;
+import javax.ws.rs.Path;
+import javax.ws.rs.PathParam;
+import javax.ws.rs.Produces;
+import javax.ws.rs.QueryParam;
+import javax.ws.rs.WebApplicationException;
+import javax.ws.rs.core.Context;
+import javax.ws.rs.core.MediaType;
+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.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;
+import org.apache.stanbol.rules.manager.changes.RuleStoreImpl;
+import org.semanticweb.owlapi.apibinding.OWLManager;
+import org.semanticweb.owlapi.model.AddImport;
+import org.semanticweb.owlapi.model.IRI;
+import org.semanticweb.owlapi.model.OWLDataFactory;
+import org.semanticweb.owlapi.model.OWLIndividual;
+import org.semanticweb.owlapi.model.OWLIndividualAxiom;
+import org.semanticweb.owlapi.model.OWLNamedIndividual;
+import org.semanticweb.owlapi.model.OWLObjectProperty;
+import org.semanticweb.owlapi.model.OWLOntology;
+import org.semanticweb.owlapi.model.OWLOntologyChange;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import org.apache.stanbol.kres.jersey.format.KRFormat;
+import org.apache.stanbol.kres.jersey.resource.NavigationMixin;
+
+/**
+ * 
+ * @author elvio
+ */
+@Path("/recipe")
+// /{uri:.+}")
+// @ImplicitProduces(MediaType.TEXT_HTML + ";qs=2")
+public class RestRecipe extends NavigationMixin {
+
+    protected ONManager onm;
+
+    private Logger log = LoggerFactory.getLogger(getClass());
+
+    private RuleStore kresRuleStore;
+    private ClerezzaOntologyStorage storage;
+
+    /**
+     * To get the RuleStoreImpl where are stored the rules and the recipes
+     * 
+     * @param servletContext
+     *            {To get the context where the REST service is running.}
+     */
+    public RestRecipe(@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);
+}
+        if (kresRuleStore == null) {
+            log
+                    .warn("No KReSRuleStore with stored rules and recipes found in servlet context. Instantiating manually with default values...");
+//            String iri = "http://www.ontologydesignpatterns.org/ont/iks/kres/rmi_config.owl";
+//            OWLOntology o;
+//            try {
+//                o = OWLManager.createOWLOntologyManager().loadOntologyFromOntologyDocument(IRI.create(iri));
+//                this.kresRuleStore = new RuleStoreImpl(onm, new Hashtable<String,Object>(), "");
+//                log.debug("PATH TO OWL FILE LOADED: " + kresRuleStore.getFilePath());
+//            } catch (OWLOntologyCreationException e) {
+//
+//            }
+            
+            this.kresRuleStore = new RuleStoreImpl(onm, new Hashtable<String,Object>(), "");
+
+        }
+    }
+
+    /**
+     * Get a recipe with its rules from the rule base (that is the ontology that contains the rules and the
+     * recipe).
+     * 
+     * @param uri
+     *            {A string contains the IRI full name of the recipe.}
+     * @return Return: <br/>
+     *         200 The recipe is retrieved (import declarations point to KReS Services) <br/>
+     *         404 The recipe does not exists in the manager <br/>
+     *         500 Some error occurred
+     * 
+     */
+    @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) {
+        try {
+
+            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();
+                } else {
+
+                    // The recipe is retrieved (import declarations point to
+                    // KReS Services)
+                    OWLOntology onto = kresRuleStore.getOntology();
+                    OWLOntology newmodel = OWLManager.createOWLOntologyManager().createOntology(
+                        onto.getOntologyID());
+                    OWLDataFactory factory = onto.getOWLOntologyManager().getOWLDataFactory();
+
+                    Iterator<OWLOntology> importedonto = onto.getDirectImports().iterator();
+                    List<OWLOntologyChange> additions = new LinkedList<OWLOntologyChange>();
+                    OWLDataFactory auxfactory = onto.getOWLOntologyManager().getOWLDataFactory();
+
+                    while (importedonto.hasNext()) {
+                        OWLOntology auxonto = importedonto.next();
+                        additions.add(new AddImport(newmodel, auxfactory.getOWLImportsDeclaration(auxonto
+                                .getOWLOntologyManager().getOntologyDocumentIRI(auxonto))));
+                    }
+
+                    if (!additions.isEmpty()) newmodel.getOWLOntologyManager().applyChanges(additions);
+
+                    for (int i = 0; i < recipe.size(); i++) {
+                        OWLNamedIndividual ind = factory.getOWLNamedIndividual(recipe.get(i));
+                        Set<OWLIndividualAxiom> ax = onto.getAxioms(ind);
+                        newmodel.getOWLOntologyManager().addAxioms(newmodel, ax);
+
+                    }
+
+                    // try {
+                    // OWLManager.createOWLOntologyManager().saveOntology(
+                    // newmodel,
+                    // newmodel.getOWLOntologyManager()
+                    // .getOntologyFormat(newmodel),
+                    // System.out);
+                    // } catch (OWLOntologyStorageException e) {
+                    // // TODO Auto-generated catch block
+                    // e.printStackTrace();
+                    // }
+
+                    return Response.ok(newmodel).build();
+                }
+
+            } else {
+
+                HashMap<IRI,String> recipe = rule.getRecipe(IRI.create(uri));
+
+                if (recipe == null) {
+                    // The recipe deos not exists in the manager
+                    return Response.status(Status.NOT_FOUND).build();
+                } else {
+                    // The recipe is retrieved (import declarations point to
+                    // KReS Services)
+                    OWLOntology onto = kresRuleStore.getOntology();
+
+                    OWLDataFactory factory = onto.getOWLOntologyManager().getOWLDataFactory();
+                    OWLObjectProperty prop = factory.getOWLObjectProperty(IRI
+                            .create("http://kres.iks-project.eu/ontology/meta/rmi.owl#hasRule"));
+                    OWLNamedIndividual ind = factory.getOWLNamedIndividual(IRI.create(uri));
+                    Set<OWLIndividual> value = ind.getObjectPropertyValues(prop, onto);
+                    Set<OWLIndividualAxiom> ax = onto.getAxioms(ind);
+
+                    Iterator<OWLIndividual> iter = value.iterator();
+
+                    OWLOntology newmodel = OWLManager.createOWLOntologyManager().createOntology(
+                        onto.getOntologyID());
+
+                    Iterator<OWLOntology> importedonto = onto.getDirectImports().iterator();
+                    List<OWLOntologyChange> additions = new LinkedList<OWLOntologyChange>();
+                    OWLDataFactory auxfactory = onto.getOWLOntologyManager().getOWLDataFactory();
+
+                    while (importedonto.hasNext()) {
+                        OWLOntology auxonto = importedonto.next();
+                        additions.add(new AddImport(newmodel, auxfactory.getOWLImportsDeclaration(auxonto
+                                .getOWLOntologyManager().getOntologyDocumentIRI(auxonto))));
+                    }
+
+                    if (!additions.isEmpty()) newmodel.getOWLOntologyManager().applyChanges(additions);
+
+                    newmodel.getOWLOntologyManager().addAxioms(newmodel, ax);
+
+                    while (iter.hasNext()) {
+
+                        ind = (OWLNamedIndividual) iter.next();
+                        ax = onto.getAxioms(ind);
+
+                        newmodel.getOWLOntologyManager().addAxioms(newmodel, ax);
+                    }
+
+                    // try {
+                    // OWLManager.createOWLOntologyManager().saveOntology(
+                    // newmodel,
+                    // newmodel.getOWLOntologyManager()
+                    // .getOntologyFormat(newmodel),
+                    // System.out);
+                    // } catch (OWLOntologyStorageException e) {
+                    // // TODO Auto-generated catch block
+                    // e.printStackTrace();
+                    // }
+
+                    return Response.ok(newmodel).build();
+                }
+            }
+        } catch (Exception e) {
+            // Some error occurred
+            throw new WebApplicationException(e, Status.INTERNAL_SERVER_ERROR);
+        }
+
+    }
+
+    /**
+     * To add a recipe without rules.
+     * 
+     * @param recipe
+     *            {A string contains the IRI of the recipe to be added}
+     * @param description
+     *            {A string contains a description of the rule}
+     * @return Return: <br/>
+     *         200 The recipe has been added<br/>
+     *         409 The recipe has not been added<br/>
+     *         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) {
+
+        try {
+
+            AddRecipe instance = new AddRecipe(kresRuleStore);
+
+            // String ID =
+            // kresRuleStore.getOntology().getOntologyID().toString().replace(">","").replace("<","")+"#";
+
+            boolean ok = instance.addSimpleRecipe(IRI.create(recipe), description);
+
+            if (!ok) {
+
+                return Response.status(Status.CONFLICT).build();
+
+            } else {
+                kresRuleStore.saveOntology();
+                return Response.status(Status.OK).build();
+            }
+
+        } catch (Exception e) {
+            throw new WebApplicationException(e, Status.INTERNAL_SERVER_ERROR);
+        }
+    }
+
+    /**
+     * To delete a recipe
+     * 
+     * @param recipe
+     *            {A tring contains an IRI of the recipe}
+     * @return 200 The recipe has been deleted<br/>
+     *         409 The recipe has not been deleted<br/>
+     *         500 Some error occurred
+     */
+    @DELETE
+    // @Consumes(MediaType.TEXT_PLAIN)
+    @Produces("text/plain")
+    public Response removeRecipe(@QueryParam(value = "recipe") String recipe) {
+
+        try {
+
+            RemoveRecipe instance = new RemoveRecipe(kresRuleStore);
+
+            // String ID =
+            // kresRuleStore.getOntology().getOntologyID().toString().replace(">","").replace("<","")+"#";
+
+            boolean ok = instance.removeRecipe(IRI.create(recipe));
+
+            if (!ok) {
+                return Response.status(Status.CONFLICT).build();
+            } else {
+                kresRuleStore.saveOntology();
+                return Response.ok().build();
+            }
+
+        } catch (Exception e) {
+            throw new WebApplicationException(e, Status.INTERNAL_SERVER_ERROR);
+        }
+    }
+
+}

Added: incubator/stanbol/trunk/rules/web/src/main/java/org/apache/stanbol/rules/web/resources/RestRule.java
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/rules/web/src/main/java/org/apache/stanbol/rules/web/resources/RestRule.java?rev=1087688&view=auto
==============================================================================
--- incubator/stanbol/trunk/rules/web/src/main/java/org/apache/stanbol/rules/web/resources/RestRule.java (added)
+++ incubator/stanbol/trunk/rules/web/src/main/java/org/apache/stanbol/rules/web/resources/RestRule.java Fri Apr  1 12:47:48 2011
@@ -0,0 +1,531 @@
+/*
+ * To change this template, choose Tools | Templates
+ * and open the template in the editor.
+ */
+
+package org.apache.stanbol.rules.web.resources;
+
+import java.io.UnsupportedEncodingException;
+import java.net.URLEncoder;
+import java.util.HashMap;
+import java.util.Hashtable;
+import java.util.Iterator;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Set;
+import java.util.Vector;
+
+import javax.servlet.ServletContext;
+import javax.ws.rs.Consumes;
+import javax.ws.rs.DELETE;
+import javax.ws.rs.FormParam;
+import javax.ws.rs.GET;
+import javax.ws.rs.POST;
+import javax.ws.rs.Path;
+import javax.ws.rs.PathParam;
+import javax.ws.rs.Produces;
+import javax.ws.rs.QueryParam;
+import javax.ws.rs.WebApplicationException;
+import javax.ws.rs.core.Context;
+import javax.ws.rs.core.MediaType;
+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.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.AddRule;
+import org.apache.stanbol.rules.manager.changes.GetRecipe;
+import org.apache.stanbol.rules.manager.changes.GetRule;
+import org.apache.stanbol.rules.manager.changes.RemoveRecipe;
+import org.apache.stanbol.rules.manager.changes.RemoveRule;
+import org.apache.stanbol.rules.manager.changes.RuleStoreImpl;
+import org.semanticweb.owlapi.apibinding.OWLManager;
+import org.semanticweb.owlapi.model.AddImport;
+import org.semanticweb.owlapi.model.IRI;
+import org.semanticweb.owlapi.model.OWLDataFactory;
+import org.semanticweb.owlapi.model.OWLIndividualAxiom;
+import org.semanticweb.owlapi.model.OWLNamedIndividual;
+import org.semanticweb.owlapi.model.OWLOntology;
+import org.semanticweb.owlapi.model.OWLOntologyChange;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import org.apache.stanbol.kres.jersey.format.KRFormat;
+import org.apache.stanbol.kres.jersey.resource.NavigationMixin;
+
+/**
+ *
+ * @author elvio
+ * @author andrea.nuzzolese
+ * 
+ */
+@Path("/rule")
+public class RestRule extends NavigationMixin{
+
+	protected ONManager onm;
+	protected ClerezzaOntologyStorage storage;
+
+	private Logger log = LoggerFactory.getLogger(getClass());
+
+	private RuleStore kresRuleStore;
+    private HashMap<IRI, String> map;
+    private String desc;
+
+   /**
+     * To get the RuleStoreImpl where are stored the rules and the recipes
+     *
+	 * @param servletContext
+	 *            {To get the context where the REST service is running.}
+     */
+    public RestRule(@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);
+		}
+
+       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());
+        }
+    }
+
+   /**
+	 * Get a rule from the rule base (that is the ontology that contains the
+	 * rules and the recipe). curl -v -X GET
+	 * http://localhost:8080/kres/rule/http
+	 * ://kres.iks-project.eu/ontology/meta/rmi.owl#ProvaParentRule
+	 * 
+	 * @param uri
+	 *            {A string contains the IRI full name of the rule.}
+     * @return Return: <br/>
+	 *         200 The rule is retrieved (import declarations point to KReS
+	 *         Services) <br/>
+     *       404 The rule does not exists in the manager <br/>
+     *       500 Some error occurred
+     *
+     */
+    @GET
+    @Path("/{uri:.+}")
+	@Produces(value = { KRFormat.RDF_XML, KRFormat.TURTLE,
+			KRFormat.OWL_XML })
+    public Response getRule(@PathParam("uri") String uri){
+ 
+      try{
+
+       GetRule recipe = new GetRule(kresRuleStore);
+       if(uri.equals("all")){
+
+           HashMap<IRI, String> rule = recipe.getAllRules();
+           Iterator<IRI> keys = rule.keySet().iterator();
+          
+        if(rule==null){
+            return Response.status(Status.NOT_FOUND).build();
+        }else{
+
+            OWLOntology onto = kresRuleStore.getOntology();
+					OWLOntology newmodel = OWLManager
+							.createOWLOntologyManager().createOntology(
+									onto.getOntologyID());
+					OWLDataFactory factory = onto.getOWLOntologyManager()
+							.getOWLDataFactory();
+
+					Iterator<OWLOntology> importedonto = onto
+							.getDirectImports().iterator();
+            List<OWLOntologyChange> additions = new LinkedList<OWLOntologyChange>();
+					OWLDataFactory auxfactory = onto.getOWLOntologyManager()
+							.getOWLDataFactory();
+
+            while(importedonto.hasNext()){
+                OWLOntology auxonto = importedonto.next();
+						additions.add(new AddImport(newmodel, auxfactory
+								.getOWLImportsDeclaration(auxonto
+										.getOWLOntologyManager()
+										.getOntologyDocumentIRI(auxonto))));
+            }
+
+            if(!additions.isEmpty())
+						newmodel.getOWLOntologyManager()
+								.applyChanges(additions);
+
+            while(keys.hasNext()){
+						OWLNamedIndividual ind = factory
+								.getOWLNamedIndividual(keys.next());
+                Set<OWLIndividualAxiom> ax = onto.getAxioms(ind);
+						newmodel.getOWLOntologyManager()
+								.addAxioms(newmodel, ax);
+            }
+
+//            try {
+//						OWLManager.createOWLOntologyManager().saveOntology(
+//								newmodel,
+//								newmodel.getOWLOntologyManager()
+//										.getOntologyFormat(newmodel),
+//								System.out);
+//    		} catch (OWLOntologyStorageException e) {
+//    			// TODO Auto-generated catch block
+//    			e.printStackTrace();
+//    		}
+
+            return Response.ok(newmodel).build();
+        }
+
+       }else{
+
+        HashMap<IRI, String> rule = recipe.getRule(IRI.create(uri));
+       
+        if(rule==null){
+            return Response.status(Status.NOT_FOUND).build();
+        }else{
+            OWLOntology onto = kresRuleStore.getOntology();
+
+					OWLDataFactory factory = onto.getOWLOntologyManager()
+							.getOWLDataFactory();
+					OWLNamedIndividual ind = factory.getOWLNamedIndividual(IRI
+							.create(uri));
+            Set<OWLIndividualAxiom> ax = onto.getAxioms(ind);
+					OWLOntology newmodel = OWLManager
+							.createOWLOntologyManager().createOntology(
+									onto.getOntologyID());
+
+					Iterator<OWLOntology> importedonto = onto
+							.getDirectImports().iterator();
+            List<OWLOntologyChange> additions = new LinkedList<OWLOntologyChange>();
+					OWLDataFactory auxfactory = onto.getOWLOntologyManager()
+							.getOWLDataFactory();
+
+            while(importedonto.hasNext()){
+                OWLOntology auxonto = importedonto.next();
+						additions.add(new AddImport(newmodel, auxfactory
+								.getOWLImportsDeclaration(auxonto
+										.getOWLOntologyManager()
+										.getOntologyDocumentIRI(auxonto))));
+            }
+
+            if(!additions.isEmpty())
+						newmodel.getOWLOntologyManager()
+								.applyChanges(additions);
+
+            newmodel.getOWLOntologyManager().addAxioms(newmodel,ax);
+
+//            try {
+//						OWLManager.createOWLOntologyManager().saveOntology(
+//								newmodel,
+//								newmodel.getOWLOntologyManager()
+//										.getOntologyFormat(newmodel),
+//								System.out);
+//    		} catch (OWLOntologyStorageException e) {
+//    			// TODO Auto-generated catch block
+//    			e.printStackTrace();
+//    		}
+
+            return Response.ok(newmodel).build();
+        }
+       }
+      }catch (Exception e){
+          //Some error occurred
+         throw new WebApplicationException(e, Status.INTERNAL_SERVER_ERROR);
+      }
+
+    }
+    
+    @GET
+    @Path("/of-recipe/{uri:.+}")
+	@Produces(value = { KRFormat.RDF_XML, KRFormat.RDF_JSON })
+    public Response getRulesOfRecipe(@PathParam("uri") String recipeURI){
+    	
+    	GetRule kReSGetRule = new GetRule(kresRuleStore);
+    	String recipeURIEnc;
+		try {
+			recipeURIEnc = URLEncoder
+					.encode(
+							"http://kres.iks-project.eu/ontology/meta/rmi_config.owl#MyRecipeA",
+							"UTF-8");
+			System.out.println("RECIPE : "+recipeURIEnc);
+		} catch (UnsupportedEncodingException e) {
+			// TODO Auto-generated catch block
+			e.printStackTrace();
+		}
+    	
+    	System.out.println("RECIPE IRI : "+IRI.create(recipeURI).toString());
+		OWLOntology ontology = kReSGetRule.getAllRulesOfARecipe(IRI
+				.create(recipeURI));
+		
+    	return Response.ok(ontology).build();
+			
+    }
+
+   /**
+	 * To add a rule to a recipe at the end of the sequence. curl -v -X POST -F
+	 * "recipe=http://kres.iks-project.eu/ontology/meta/rmi.owl%23ProvaParentRecipe"
+	 * -F "rule=http://kres.iks-project.eu/ontology/meta/rmi.owl%23ProvaRuleNEW"
+	 * -F "kres-syntax=body -> head" -F "description=prova di aggiunta regola"
+	 * http://localhost:8080/kres/rule
+	 * 
+	 * @param recipe
+	 *            {A string contains the IRI of the recipe where to add the
+	 *            rule}
+	 * @param rule
+	 *            {A string contains the IRI of the rule to be added at the
+	 *            recipe}
+	 * @param kres_syntax
+	 *            {A string contains the body and the head of the kres rule. If
+	 *            not specified the rule is search in the Ontology otherwise is
+	 *            added as new.}
+	 * @param description
+	 *            {A string contains a description of the rule}
+     * @return Return: <br/>
+     *      200 The rule has been added <br/>
+     *      204 The rule has not been added <br/>
+     *      400 The rule and recipe are not specified<br/>
+     *      404 Recipe or rule not found<br/>
+     *      409 The rule has not been added<br/>
+     *      500 Some error occurred
+     */
+    @POST
+    @Consumes(MediaType.MULTIPART_FORM_DATA)
+	public Response addRuleToRecipe(@FormParam(value = "recipe") String recipe,
+			@FormParam(value = "rule") String rule,
+			@FormParam(value = "kres-syntax") String kres_syntax,
+			@FormParam(value = "description") String description) {
+    
+//        System.err.println("recipe "+recipe);
+//        System.err.println("rule " + rule);
+//        System.err.println("kres-syntax "+kres_syntax);
+//        System.err.println("description "+description);
+//
+//        return Response.ok().build();
+           
+        try{
+
+         if((recipe==null)&&(rule==null)){
+                return Response.status(Status.BAD_REQUEST).build();
+         }
+
+         recipe = recipe.replace(" ","").trim();
+         rule = rule.replace(" ","").trim();
+
+         //The rule is already inside the rule store
+         if((kres_syntax==null)){
+            //Get the rule
+            GetRule inrule = new GetRule(kresRuleStore);
+            this.map = inrule.getRule(IRI.create(rule));
+            
+            if(map==null){
+                return Response.status(Status.NOT_FOUND).build();
+            }
+
+            //Get the recipe
+            GetRecipe getrecipe = new GetRecipe(kresRuleStore);
+            this.map = getrecipe.getRecipe(IRI.create(recipe));
+            if(map!=null){
+                this.desc = getrecipe.getDescription(IRI.create(recipe));
+                if(desc==null)
+                    Response.status(Status.NOT_FOUND).build();
+            }else{
+                return Response.status(Status.NOT_FOUND).build();
+            }
+
+            String[] sequence = map.get(IRI.create(recipe)).split(",");
+            Vector<IRI> ruleseq = new Vector();
+            if(!sequence[0].isEmpty())
+            for(String seq : sequence)
+                ruleseq.add(IRI.create(seq.replace(" ","").trim()));
+
+            //Add the new rule to the end
+            ruleseq.add(IRI.create(rule));
+            //Remove the old recipe
+            RemoveRecipe remove = new RemoveRecipe(kresRuleStore);
+            boolean ok = remove.removeRecipe(IRI.create(recipe));
+            
+            if(!ok)
+                return Response.status(Status.CONFLICT).build();
+
+            //Add the recipe with the new rule
+            AddRecipe newadd = new AddRecipe(kresRuleStore);
+            ok = newadd.addRecipe(IRI.create(recipe), ruleseq, desc);
+            
+            if(ok){
+                    kresRuleStore.saveOntology();
+                    return Response.ok().build();
+            }else{
+                    return Response.status(Status.NO_CONTENT).build();
+            }
+        }
+
+        //The rule is added to the store and to the recipe
+         if((kres_syntax!=null)&(description!=null)){
+            //Get the rule
+            AddRule inrule = new AddRule(kresRuleStore);
+				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();
+            }
+            
+            //Get the recipe
+            GetRecipe getrecipe = new GetRecipe(kresRuleStore);
+            this.map = getrecipe.getRecipe(IRI.create(recipe));
+            System.out.println("RECIPE FOR RULE: "+recipe);
+            if(map!=null){
+                this.desc = getrecipe.getDescription(IRI.create(recipe));
+               
+                if(desc==null)
+                   return Response.status(Status.NOT_FOUND).build();
+            }else{
+                return Response.status(Status.NOT_FOUND).build();
+            }
+
+            String[] sequence = map.get(IRI.create(recipe)).split(",");
+            Vector<IRI> ruleseq = new Vector();
+            if(!sequence[0].isEmpty())
+            for(String seq : sequence)
+                ruleseq.add(IRI.create(seq.replace(" ","").trim()));
+
+            //Add the new rule to the end          
+            ruleseq.add(IRI.create(rule));
+            //Remove the old recipe
+            RemoveRecipe remove = new RemoveRecipe(kresRuleStore);
+            ok = remove.removeRecipe(IRI.create(recipe));
+            if(!ok){
+                System.err.println("ERROR TO REMOVE OLD RECIPE: "+recipe);
+                return Response.status(Status.CONFLICT).build();
+            }
+
+            //Add the recipe with the new rule
+            AddRecipe newadd = new AddRecipe(kresRuleStore);
+            ok = newadd.addRecipe(IRI.create(recipe), ruleseq, desc);
+            if(ok){
+                    kresRuleStore.saveOntology();
+                    return Response.ok().build();
+            }else{
+                    return Response.status(Status.NO_CONTENT).build();
+            }
+        }else{
+             return Response.status(Status.BAD_REQUEST).build();
+        }
+
+        }catch (Exception e){
+            throw new WebApplicationException(e, Status.INTERNAL_SERVER_ERROR);
+        }
+    }
+
+   /**
+	 * To delete a rule from a recipe or from the ontology. If the recipe is not
+	 * specified the rule is deleted from the ontology. curl -v -X DELETE -G \
+	 * -d recipe=
+	 * "http://kres.iks-project.eu/ontology/meta/rmi.owl#ProvaParentRecipe" \ -d
+	 * rule
+	 * ="http://kres.iks-project.eu/ontology/meta/rmi.owl#ProvaParentNewRule" \
+     * http://localhost:port/kres/rule
+    *
+     * @Param rule {A string contains an IRI of the rule to be removed}
+	 * @param recipe
+	 *            {A string contains an IRI of the recipe where remove the rule}
+     * @return Return: <br/>
+     *      200 The rule has been deleted<br/>
+     *      204 The rule has not been deleted<br/>
+     *      404 Recipe or rule not found<br/>
+     *      409 The recipe has not been deleted<br/>
+     *      500 Some error occurred
+     */
+    @DELETE
+    //@Consumes(MediaType.TEXT_PLAIN)
+    @Produces(KRFormat.TEXT_PLAIN)
+	public Response removeRule(@QueryParam(value = "rule") String rule,
+			@QueryParam(value = "recipe") String recipe) {
+
+        boolean ok;
+
+        try{
+         
+         //Delete from the recipe
+         if((recipe!=null)&&(rule!=null)){
+             recipe = recipe.replace(" ","").trim();
+             rule = rule.replace(" ","").trim();
+            //Get the rule
+            GetRule getrule = new GetRule(kresRuleStore);
+            this.map = getrule.getRule(IRI.create(rule));
+            if(map==null){
+                return Response.status(Status.NOT_FOUND).build();
+            }
+
+            //Get the recipe
+            GetRecipe getrecipe = new GetRecipe(kresRuleStore);
+            this.map = getrecipe.getRecipe(IRI.create(recipe));
+            if(map!=null){
+                this.desc = getrecipe.getDescription(IRI.create(recipe));
+                if(desc.isEmpty())
+                    return Response.status(Status.NOT_FOUND).build();
+            }else{
+                return Response.status(Status.NOT_FOUND).build();
+            }
+            
+            RemoveRule remove = new RemoveRule(kresRuleStore);
+				ok = remove.removeRuleFromRecipe(IRI.create(rule), IRI
+						.create(recipe));
+            if(ok){
+                kresRuleStore.saveOntology();
+                return Response.status(Status.OK).build();
+            }else{
+                return Response.status(Status.NO_CONTENT).build();
+            }
+         }
+
+         //Delete from the ontology
+         if((recipe==null)&&(rule!=null)){
+             rule = rule.replace(" ","").trim();
+            //Get the rule
+            GetRule getrule = new GetRule(kresRuleStore);
+            this.map = getrule.getRule(IRI.create(rule));
+            if(map==null){
+                return Response.status(Status.NOT_FOUND).build();
+            }
+
+            //Remove the old recipe
+            RemoveRule remove = new RemoveRule(kresRuleStore);
+            ok = remove.removeRule(IRI.create(rule));
+
+            if(ok){
+                kresRuleStore.saveOntology();
+                return Response.ok().build();
+            }else{
+                return Response.status(Status.NO_CONTENT).build();
+            }
+         }else{
+             return Response.status(Status.BAD_REQUEST).build();
+         }
+            
+        }catch(Exception e){
+           throw new WebApplicationException(e, Status.INTERNAL_SERVER_ERROR);
+        }
+    }
+
+}

Added: incubator/stanbol/trunk/rules/web/src/main/java/org/apache/stanbol/rules/web/resources/RuleStoreResource.java
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/rules/web/src/main/java/org/apache/stanbol/rules/web/resources/RuleStoreResource.java?rev=1087688&view=auto
==============================================================================
--- incubator/stanbol/trunk/rules/web/src/main/java/org/apache/stanbol/rules/web/resources/RuleStoreResource.java (added)
+++ incubator/stanbol/trunk/rules/web/src/main/java/org/apache/stanbol/rules/web/resources/RuleStoreResource.java Fri Apr  1 12:47:48 2011
@@ -0,0 +1,50 @@
+/*
+ * To change this template, choose Tools | Templates
+ * and open the template in the editor.
+ */
+
+package org.apache.stanbol.rules.web.resources;
+
+import javax.servlet.ServletContext;
+import javax.ws.rs.GET;
+import javax.ws.rs.Path;
+import javax.ws.rs.Produces;
+import javax.ws.rs.core.Context;
+import javax.ws.rs.core.Response;
+
+import org.apache.stanbol.rules.manager.changes.RuleStoreImpl;
+
+/**
+ *
+ * @author elvio
+ */
+@Path("/rulestore")
+public class RuleStoreResource {
+    
+    private RuleStoreImpl kresRuleStore;
+
+   /**
+     * To get the RuleStoreImpl where are stored the rules and the recipes
+     *
+     * @param servletContext {To get the context where the REST service is running.}
+     */
+    public RuleStoreResource(@Context ServletContext servletContext){
+       this.kresRuleStore = (RuleStoreImpl) servletContext.getAttribute(RuleStoreImpl.class.getName());
+       if (kresRuleStore == null) {
+            throw new IllegalStateException(
+                    "KReSRuleStore with stored rules and recipes is missing in ServletContext");
+        }
+    }
+
+   /**
+     * To get the RuleStoreImpl in the serveletContext.
+     * @return {An object of type RuleStoreImpl.}
+     */
+    @GET
+    //@Consumes(MediaType.APPLICATION_FORM_URLENCODED)
+    @Produces("application/rdf+xml")
+    public Response getRuleStore(){
+        return Response.ok(this.kresRuleStore).build();
+    }
+
+}

Propchange: incubator/stanbol/trunk/rules/web/src/main/resources/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Fri Apr  1 12:47:48 2011
@@ -0,0 +1 @@
+target

Propchange: incubator/stanbol/trunk/rules/web/src/main/resources/META-INF/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Fri Apr  1 12:47:48 2011
@@ -0,0 +1 @@
+target

Propchange: incubator/stanbol/trunk/rules/web/src/main/resources/META-INF/static/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Fri Apr  1 12:47:48 2011
@@ -0,0 +1 @@
+target

Propchange: incubator/stanbol/trunk/rules/web/src/main/resources/META-INF/static/images/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Fri Apr  1 12:47:48 2011
@@ -0,0 +1 @@
+target

Added: incubator/stanbol/trunk/rules/web/src/main/resources/META-INF/static/images/add.gif
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/rules/web/src/main/resources/META-INF/static/images/add.gif?rev=1087688&view=auto
==============================================================================
Binary file - no diff available.

Propchange: incubator/stanbol/trunk/rules/web/src/main/resources/META-INF/static/images/add.gif
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: incubator/stanbol/trunk/rules/web/src/main/resources/META-INF/static/images/addRule.gif
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/rules/web/src/main/resources/META-INF/static/images/addRule.gif?rev=1087688&view=auto
==============================================================================
Binary file - no diff available.

Propchange: incubator/stanbol/trunk/rules/web/src/main/resources/META-INF/static/images/addRule.gif
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: incubator/stanbol/trunk/rules/web/src/main/resources/META-INF/static/images/ajax-loader.gif
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/rules/web/src/main/resources/META-INF/static/images/ajax-loader.gif?rev=1087688&view=auto
==============================================================================
Binary file - no diff available.

Propchange: incubator/stanbol/trunk/rules/web/src/main/resources/META-INF/static/images/ajax-loader.gif
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: incubator/stanbol/trunk/rules/web/src/main/resources/META-INF/static/images/anonymous_48.png
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/rules/web/src/main/resources/META-INF/static/images/anonymous_48.png?rev=1087688&view=auto
==============================================================================
Binary file - no diff available.

Propchange: incubator/stanbol/trunk/rules/web/src/main/resources/META-INF/static/images/anonymous_48.png
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: incubator/stanbol/trunk/rules/web/src/main/resources/META-INF/static/images/black_gear_128.png
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/rules/web/src/main/resources/META-INF/static/images/black_gear_128.png?rev=1087688&view=auto
==============================================================================
Binary file - no diff available.

Propchange: incubator/stanbol/trunk/rules/web/src/main/resources/META-INF/static/images/black_gear_128.png
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: incubator/stanbol/trunk/rules/web/src/main/resources/META-INF/static/images/black_gear_16.png
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/rules/web/src/main/resources/META-INF/static/images/black_gear_16.png?rev=1087688&view=auto
==============================================================================
Binary file - no diff available.

Propchange: incubator/stanbol/trunk/rules/web/src/main/resources/META-INF/static/images/black_gear_16.png
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: incubator/stanbol/trunk/rules/web/src/main/resources/META-INF/static/images/caos_puzzle.jpg
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/rules/web/src/main/resources/META-INF/static/images/caos_puzzle.jpg?rev=1087688&view=auto
==============================================================================
Binary file - no diff available.

Propchange: incubator/stanbol/trunk/rules/web/src/main/resources/META-INF/static/images/caos_puzzle.jpg
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: incubator/stanbol/trunk/rules/web/src/main/resources/META-INF/static/images/compass_48.png
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/rules/web/src/main/resources/META-INF/static/images/compass_48.png?rev=1087688&view=auto
==============================================================================
Binary file - no diff available.

Propchange: incubator/stanbol/trunk/rules/web/src/main/resources/META-INF/static/images/compass_48.png
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: incubator/stanbol/trunk/rules/web/src/main/resources/META-INF/static/images/compass_map_48.png
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/rules/web/src/main/resources/META-INF/static/images/compass_map_48.png?rev=1087688&view=auto
==============================================================================
Binary file - no diff available.

Propchange: incubator/stanbol/trunk/rules/web/src/main/resources/META-INF/static/images/compass_map_48.png
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: incubator/stanbol/trunk/rules/web/src/main/resources/META-INF/static/images/configure.gif
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/rules/web/src/main/resources/META-INF/static/images/configure.gif?rev=1087688&view=auto
==============================================================================
Binary file - no diff available.

Propchange: incubator/stanbol/trunk/rules/web/src/main/resources/META-INF/static/images/configure.gif
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: incubator/stanbol/trunk/rules/web/src/main/resources/META-INF/static/images/delete.gif
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/rules/web/src/main/resources/META-INF/static/images/delete.gif?rev=1087688&view=auto
==============================================================================
Binary file - no diff available.

Propchange: incubator/stanbol/trunk/rules/web/src/main/resources/META-INF/static/images/delete.gif
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: incubator/stanbol/trunk/rules/web/src/main/resources/META-INF/static/images/download.png
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/rules/web/src/main/resources/META-INF/static/images/download.png?rev=1087688&view=auto
==============================================================================
Binary file - no diff available.

Propchange: incubator/stanbol/trunk/rules/web/src/main/resources/META-INF/static/images/download.png
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: incubator/stanbol/trunk/rules/web/src/main/resources/META-INF/static/images/download_rdf.png
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/rules/web/src/main/resources/META-INF/static/images/download_rdf.png?rev=1087688&view=auto
==============================================================================
Binary file - no diff available.

Propchange: incubator/stanbol/trunk/rules/web/src/main/resources/META-INF/static/images/download_rdf.png
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: incubator/stanbol/trunk/rules/web/src/main/resources/META-INF/static/images/external.png
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/rules/web/src/main/resources/META-INF/static/images/external.png?rev=1087688&view=auto
==============================================================================
Binary file - no diff available.

Propchange: incubator/stanbol/trunk/rules/web/src/main/resources/META-INF/static/images/external.png
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: incubator/stanbol/trunk/rules/web/src/main/resources/META-INF/static/images/favicon-black.png
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/rules/web/src/main/resources/META-INF/static/images/favicon-black.png?rev=1087688&view=auto
==============================================================================
Binary file - no diff available.

Propchange: incubator/stanbol/trunk/rules/web/src/main/resources/META-INF/static/images/favicon-black.png
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: incubator/stanbol/trunk/rules/web/src/main/resources/META-INF/static/images/favicon-sw.png
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/rules/web/src/main/resources/META-INF/static/images/favicon-sw.png?rev=1087688&view=auto
==============================================================================
Binary file - no diff available.

Propchange: incubator/stanbol/trunk/rules/web/src/main/resources/META-INF/static/images/favicon-sw.png
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: incubator/stanbol/trunk/rules/web/src/main/resources/META-INF/static/images/favicon.png
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/rules/web/src/main/resources/META-INF/static/images/favicon.png?rev=1087688&view=auto
==============================================================================
Binary file - no diff available.

Propchange: incubator/stanbol/trunk/rules/web/src/main/resources/META-INF/static/images/favicon.png
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: incubator/stanbol/trunk/rules/web/src/main/resources/META-INF/static/images/fise_logo_cropped.png
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/rules/web/src/main/resources/META-INF/static/images/fise_logo_cropped.png?rev=1087688&view=auto
==============================================================================
Binary file - no diff available.

Propchange: incubator/stanbol/trunk/rules/web/src/main/resources/META-INF/static/images/fise_logo_cropped.png
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: incubator/stanbol/trunk/rules/web/src/main/resources/META-INF/static/images/fise_logo_white.png
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/rules/web/src/main/resources/META-INF/static/images/fise_logo_white.png?rev=1087688&view=auto
==============================================================================
Binary file - no diff available.

Propchange: incubator/stanbol/trunk/rules/web/src/main/resources/META-INF/static/images/fise_logo_white.png
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: incubator/stanbol/trunk/rules/web/src/main/resources/META-INF/static/images/fise_logo_white_small.png
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/rules/web/src/main/resources/META-INF/static/images/fise_logo_white_small.png?rev=1087688&view=auto
==============================================================================
Binary file - no diff available.

Propchange: incubator/stanbol/trunk/rules/web/src/main/resources/META-INF/static/images/fise_logo_white_small.png
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: incubator/stanbol/trunk/rules/web/src/main/resources/META-INF/static/images/foldable_folded.png
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/rules/web/src/main/resources/META-INF/static/images/foldable_folded.png?rev=1087688&view=auto
==============================================================================
Binary file - no diff available.

Propchange: incubator/stanbol/trunk/rules/web/src/main/resources/META-INF/static/images/foldable_folded.png
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: incubator/stanbol/trunk/rules/web/src/main/resources/META-INF/static/images/foldable_unfolded.png
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/rules/web/src/main/resources/META-INF/static/images/foldable_unfolded.png?rev=1087688&view=auto
==============================================================================
Binary file - no diff available.

Propchange: incubator/stanbol/trunk/rules/web/src/main/resources/META-INF/static/images/foldable_unfolded.png
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: incubator/stanbol/trunk/rules/web/src/main/resources/META-INF/static/images/header_bg.png
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/rules/web/src/main/resources/META-INF/static/images/header_bg.png?rev=1087688&view=auto
==============================================================================
Binary file - no diff available.

Propchange: incubator/stanbol/trunk/rules/web/src/main/resources/META-INF/static/images/header_bg.png
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: incubator/stanbol/trunk/rules/web/src/main/resources/META-INF/static/images/iks_project_logo.jpg
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/rules/web/src/main/resources/META-INF/static/images/iks_project_logo.jpg?rev=1087688&view=auto
==============================================================================
Binary file - no diff available.

Propchange: incubator/stanbol/trunk/rules/web/src/main/resources/META-INF/static/images/iks_project_logo.jpg
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: incubator/stanbol/trunk/rules/web/src/main/resources/META-INF/static/images/kresLogo.png
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/rules/web/src/main/resources/META-INF/static/images/kresLogo.png?rev=1087688&view=auto
==============================================================================
Binary file - no diff available.

Propchange: incubator/stanbol/trunk/rules/web/src/main/resources/META-INF/static/images/kresLogo.png
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: incubator/stanbol/trunk/rules/web/src/main/resources/META-INF/static/images/kresLogoExtended.png
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/rules/web/src/main/resources/META-INF/static/images/kresLogoExtended.png?rev=1087688&view=auto
==============================================================================
Binary file - no diff available.

Propchange: incubator/stanbol/trunk/rules/web/src/main/resources/META-INF/static/images/kresLogoExtended.png
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: incubator/stanbol/trunk/rules/web/src/main/resources/META-INF/static/images/loading.gif
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/rules/web/src/main/resources/META-INF/static/images/loading.gif?rev=1087688&view=auto
==============================================================================
Binary file - no diff available.

Propchange: incubator/stanbol/trunk/rules/web/src/main/resources/META-INF/static/images/loading.gif
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: incubator/stanbol/trunk/rules/web/src/main/resources/META-INF/static/images/next.png
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/rules/web/src/main/resources/META-INF/static/images/next.png?rev=1087688&view=auto
==============================================================================
Binary file - no diff available.

Propchange: incubator/stanbol/trunk/rules/web/src/main/resources/META-INF/static/images/next.png
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: incubator/stanbol/trunk/rules/web/src/main/resources/META-INF/static/images/organization_48.png
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/rules/web/src/main/resources/META-INF/static/images/organization_48.png?rev=1087688&view=auto
==============================================================================
Binary file - no diff available.

Propchange: incubator/stanbol/trunk/rules/web/src/main/resources/META-INF/static/images/organization_48.png
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: incubator/stanbol/trunk/rules/web/src/main/resources/META-INF/static/images/previous.png
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/rules/web/src/main/resources/META-INF/static/images/previous.png?rev=1087688&view=auto
==============================================================================
Binary file - no diff available.

Propchange: incubator/stanbol/trunk/rules/web/src/main/resources/META-INF/static/images/previous.png
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: incubator/stanbol/trunk/rules/web/src/main/resources/META-INF/static/images/rdf.png
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/rules/web/src/main/resources/META-INF/static/images/rdf.png?rev=1087688&view=auto
==============================================================================
Binary file - no diff available.

Propchange: incubator/stanbol/trunk/rules/web/src/main/resources/META-INF/static/images/rdf.png
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: incubator/stanbol/trunk/rules/web/src/main/resources/META-INF/static/images/rdf_flyer.64.png
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/rules/web/src/main/resources/META-INF/static/images/rdf_flyer.64.png?rev=1087688&view=auto
==============================================================================
Binary file - no diff available.

Propchange: incubator/stanbol/trunk/rules/web/src/main/resources/META-INF/static/images/rdf_flyer.64.png
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: incubator/stanbol/trunk/rules/web/src/main/resources/META-INF/static/images/rdf_flyer_16.png
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/rules/web/src/main/resources/META-INF/static/images/rdf_flyer_16.png?rev=1087688&view=auto
==============================================================================
Binary file - no diff available.

Propchange: incubator/stanbol/trunk/rules/web/src/main/resources/META-INF/static/images/rdf_flyer_16.png
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: incubator/stanbol/trunk/rules/web/src/main/resources/META-INF/static/images/rdf_flyer_24.png
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/rules/web/src/main/resources/META-INF/static/images/rdf_flyer_24.png?rev=1087688&view=auto
==============================================================================
Binary file - no diff available.

Propchange: incubator/stanbol/trunk/rules/web/src/main/resources/META-INF/static/images/rdf_flyer_24.png
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: incubator/stanbol/trunk/rules/web/src/main/resources/META-INF/static/images/rules.gif
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/rules/web/src/main/resources/META-INF/static/images/rules.gif?rev=1087688&view=auto
==============================================================================
Binary file - no diff available.

Propchange: incubator/stanbol/trunk/rules/web/src/main/resources/META-INF/static/images/rules.gif
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: incubator/stanbol/trunk/rules/web/src/main/resources/META-INF/static/images/stlabLogo.jpg
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/rules/web/src/main/resources/META-INF/static/images/stlabLogo.jpg?rev=1087688&view=auto
==============================================================================
Binary file - no diff available.

Propchange: incubator/stanbol/trunk/rules/web/src/main/resources/META-INF/static/images/stlabLogo.jpg
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: incubator/stanbol/trunk/rules/web/src/main/resources/META-INF/static/images/stlabLogo.png
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/rules/web/src/main/resources/META-INF/static/images/stlabLogo.png?rev=1087688&view=auto
==============================================================================
Binary file - no diff available.

Propchange: incubator/stanbol/trunk/rules/web/src/main/resources/META-INF/static/images/stlabLogo.png
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: incubator/stanbol/trunk/rules/web/src/main/resources/META-INF/static/images/sw-cube.png
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/rules/web/src/main/resources/META-INF/static/images/sw-cube.png?rev=1087688&view=auto
==============================================================================
Binary file - no diff available.

Propchange: incubator/stanbol/trunk/rules/web/src/main/resources/META-INF/static/images/sw-cube.png
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: incubator/stanbol/trunk/rules/web/src/main/resources/META-INF/static/images/user_48.png
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/rules/web/src/main/resources/META-INF/static/images/user_48.png?rev=1087688&view=auto
==============================================================================
Binary file - no diff available.

Propchange: incubator/stanbol/trunk/rules/web/src/main/resources/META-INF/static/images/user_48.png
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: incubator/stanbol/trunk/rules/web/src/main/resources/META-INF/static/images/user_group_48.png
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/rules/web/src/main/resources/META-INF/static/images/user_group_48.png?rev=1087688&view=auto
==============================================================================
Binary file - no diff available.

Propchange: incubator/stanbol/trunk/rules/web/src/main/resources/META-INF/static/images/user_group_48.png
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: incubator/stanbol/trunk/rules/web/src/main/resources/META-INF/static/images/wikipedia_w_16.png
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/rules/web/src/main/resources/META-INF/static/images/wikipedia_w_16.png?rev=1087688&view=auto
==============================================================================
Binary file - no diff available.

Propchange: incubator/stanbol/trunk/rules/web/src/main/resources/META-INF/static/images/wikipedia_w_16.png
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Propchange: incubator/stanbol/trunk/rules/web/src/main/resources/META-INF/static/scripts/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Fri Apr  1 12:47:48 2011
@@ -0,0 +1 @@
+target