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 15:16:17 UTC
svn commit: r1087695 [4/11] - in /incubator/stanbol/trunk/reasoners: ./
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/...
Added: incubator/stanbol/trunk/reasoners/web/src/main/java/org/apache/stanbol/reasoners/web/resources/ConsistencyCheck.java
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/reasoners/web/src/main/java/org/apache/stanbol/reasoners/web/resources/ConsistencyCheck.java?rev=1087695&view=auto
==============================================================================
--- incubator/stanbol/trunk/reasoners/web/src/main/java/org/apache/stanbol/reasoners/web/resources/ConsistencyCheck.java (added)
+++ incubator/stanbol/trunk/reasoners/web/src/main/java/org/apache/stanbol/reasoners/web/resources/ConsistencyCheck.java Fri Apr 1 13:16:11 2011
@@ -0,0 +1,520 @@
+package org.apache.stanbol.reasoners.web.resources;
+
+import java.io.File;
+import java.net.URL;
+import java.util.Hashtable;
+import java.util.Iterator;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Set;
+
+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.PathParam;
+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.api.OWLDuplicateSafeLoader;
+import org.apache.stanbol.ontologymanager.ontonet.api.ontology.OntologyScope;
+import org.apache.stanbol.ontologymanager.ontonet.api.ontology.OntologySpace;
+import org.apache.stanbol.ontologymanager.ontonet.api.ontology.ScopeRegistry;
+import org.apache.stanbol.ontologymanager.ontonet.api.ontology.SessionOntologySpace;
+import org.apache.stanbol.ontologymanager.ontonet.impl.ONManagerImpl;
+import org.apache.stanbol.ontologymanager.ontonet.impl.io.ClerezzaOntologyStorage;
+import org.apache.stanbol.reasoners.base.commands.CreateReasoner;
+import org.apache.stanbol.reasoners.base.commands.RunReasoner;
+import org.apache.stanbol.reasoners.base.commands.RunRules;
+import org.apache.stanbol.rules.base.api.Rule;
+import org.apache.stanbol.rules.base.api.NoSuchRecipeException;
+import org.apache.stanbol.rules.base.api.RuleStore;
+import org.apache.stanbol.rules.base.api.util.RuleList;
+import org.apache.stanbol.rules.manager.KB;
+import org.apache.stanbol.rules.manager.changes.RuleStoreImpl;
+import org.apache.stanbol.rules.manager.parse.RuleParserImpl;
+import org.semanticweb.owlapi.apibinding.OWLManager;
+import org.semanticweb.owlapi.model.AddImport;
+import org.semanticweb.owlapi.model.IRI;
+import org.semanticweb.owlapi.model.OWLClass;
+import org.semanticweb.owlapi.model.OWLClassAssertionAxiom;
+import org.semanticweb.owlapi.model.OWLDataFactory;
+import org.semanticweb.owlapi.model.OWLDataProperty;
+import org.semanticweb.owlapi.model.OWLIndividual;
+import org.semanticweb.owlapi.model.OWLLiteral;
+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.semanticweb.owlapi.model.OWLOntologyManager;
+import org.semanticweb.owlapi.model.UnloadableImportException;
+import org.semanticweb.owlapi.reasoner.InconsistentOntologyException;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import com.hp.hpl.jena.rdf.model.Model;
+import com.hp.hpl.jena.rdf.model.ModelFactory;
+import com.hp.hpl.jena.rdf.model.Resource;
+
+
+/**
+ * This class implements the REST interface for the /check-consistency service
+ * of KReS.
+ *
+ * @author elvio
+ */
+@Path("/check-consistency")
+public class ConsistencyCheck {
+
+ private RuleStore kresRuleStore;
+ private OWLOntology inputowl;
+ private OWLOntology scopeowl;
+
+ private final OWLDuplicateSafeLoader loader = new OWLDuplicateSafeLoader();
+ protected ONManager onm;
+ protected ClerezzaOntologyStorage storage;
+
+ private Logger log = LoggerFactory.getLogger(getClass());
+
+ /**
+ * The constructor.
+ *
+ * @param servletContext
+ * {To get the context where the REST service is running.}
+ */
+ public ConsistencyCheck(@Context ServletContext servletContext) {
+
+ // Retrieve the rule store
+ this.kresRuleStore = (RuleStore) servletContext
+ .getAttribute(RuleStore.class.getName());
+ // Retrieve the ontology network manager
+ this.onm = (ONManager) servletContext
+ .getAttribute(ONManager.class.getName());
+// this.storage = (OntologyStorage) servletContext
+// .getAttribute(OntologyStorage.class.getName());
+// Contingency code for missing components follows.
+/*
+ * FIXME! The following code is required only for the tests. This should
+ * be removed and the test should work without this code.
+ */
+if (onm == null) {
+ log
+ .warn("No KReSONManager in servlet context. Instantiating manually...");
+ onm = new ONManagerImpl(new TcManager(), null,
+ new Hashtable<String, Object>());
+}
+this.storage = onm.getOntologyStore();
+if (storage == null) {
+ log.warn("No OntologyStorage in servlet context. Instantiating manually...");
+ storage = new ClerezzaOntologyStorage(new TcManager(),null);
+}
+ 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());
+ }
+
+ }
+
+ /**
+ * To trasform a sequence of rules to a Jena Model
+ *
+ * @param owl
+ * {OWLOntology object contains a single recipe}
+ * @return {A jena rdf model contains the SWRL rule.}
+ */
+ private Model fromRecipeToModel(OWLOntology owl)
+ throws NoSuchRecipeException, OWLOntologyCreationException {
+
+ // FIXME: why the heck is this method re-instantiating a rule store?!?
+ RuleStore store = new RuleStoreImpl(onm,
+ new Hashtable<String, Object>(), owl);
+ Model jenamodel = ModelFactory.createDefaultModel();
+
+ OWLDataFactory factory = owl.getOWLOntologyManager()
+ .getOWLDataFactory();
+ OWLClass ontocls = factory
+ .getOWLClass(IRI
+ .create("http://kres.iks-project.eu/ontology/meta/rmi.owl#Recipe"));
+ Set<OWLClassAssertionAxiom> cls = owl.getClassAssertionAxioms(ontocls);
+ Iterator<OWLClassAssertionAxiom> iter = cls.iterator();
+ IRI recipeiri = IRI.create(iter.next().getIndividual().toStringID());
+
+ OWLIndividual recipeIndividual = factory
+ .getOWLNamedIndividual(recipeiri);
+
+ OWLObjectProperty objectProperty = factory
+ .getOWLObjectProperty(IRI
+ .create("http://kres.iks-project.eu/ontology/meta/rmi.owl#hasRule"));
+ Set<OWLIndividual> rules = recipeIndividual.getObjectPropertyValues(
+ objectProperty, store.getOntology());
+ String kReSRules = "";
+ for (OWLIndividual rule : rules) {
+ OWLDataProperty hasBodyAndHead = factory
+ .getOWLDataProperty(IRI
+ .create("http://kres.iks-project.eu/ontology/meta/rmi.owl#hasBodyAndHead"));
+ Set<OWLLiteral> kReSRuleLiterals = rule.getDataPropertyValues(
+ hasBodyAndHead, store.getOntology());
+ for (OWLLiteral kReSRuleLiteral : kReSRuleLiterals) {
+ kReSRules += kReSRuleLiteral.getLiteral()
+ + System.getProperty("line.separator");
+ }
+ }
+
+ // kReSRules =
+ // "ProvaParent = <http://www.semanticweb.org/ontologies/2010/6/ProvaParent.owl#> . rule1[ has(ProvaParent:hasParent, ?x, ?y) . has(ProvaParent:hasBrother, ?y, ?z) -> has(ProvaParent:hasUncle, ?x, ?z) ]";
+ KB kReSKB = RuleParserImpl.parse(kReSRules);
+ RuleList listrules = kReSKB.getkReSRuleList();
+ Iterator<Rule> iterule = listrules.iterator();
+ while (iterule.hasNext()) {
+ Rule singlerule = iterule.next();
+ Resource resource = singlerule.toSWRL(jenamodel);
+ }
+
+ return jenamodel;
+
+ }
+
+ /**
+ * To check the consistency of an Ontology or a Scope (as top ontology)
+ * using the default reasoner
+ *
+ * @param uri
+ * {A string contains the IRI of RDF (either RDF/XML or owl or
+ * scope) to be checked.}
+ * @return Return: <br/>
+ * 200 No data is retrieved, the graph IS consistent <br/>
+ * 204 No data is retrieved, the graph IS NOT consistent <br/>
+ * 404 File not found. The ontology cannot be retrieved. <br/>
+ * 412 Precondition failed. The ontology cannot be checked. This
+ * happens, for example, if the ontology includes missing imports. <br/>
+ * 500 Some error occurred.
+ */
+ @GET
+ @Path("/{uri:.+}")
+ public Response GetSimpleConsistencyCheck(
+ @PathParam(value = "uri") String uri) {
+ log.debug("Start simple consistency check with input: "+uri, this);
+ try {
+ boolean ok = false;
+ OWLOntology owl;
+ try {
+ // First create a manager
+ OWLOntologyManager mng = OWLManager.createOWLOntologyManager();
+
+ /**
+ * We use the loader to support duplicate owl:imports
+ */
+ log.debug("Loading "+uri, this);
+ owl = loader.load(mng, uri);
+ // owl = mng.loadOntologyFromOntologyDocument(IRI.create(uri));
+ } catch (UnloadableImportException uu) {
+ log.debug("Some ontology import failed. Cannot continue.", uu);
+ return Response.status(Status.PRECONDITION_FAILED).build();
+ } catch (Exception ee) {
+ log
+ .error(
+ "Cannot fetch the ontology. Some error occurred. Cannot continue.",
+ ee);
+ return Response.status(Status.NOT_FOUND).build();
+ }
+ CreateReasoner newreasoner = new CreateReasoner(owl);
+ // KReSReasonerImpl reasoner = new KReSReasonerImpl();
+ try {
+ RunReasoner reasoner = new RunReasoner(newreasoner
+ .getReasoner());
+ ok = reasoner.isConsistent();
+ } catch (InconsistentOntologyException exc) {
+ ok = false;
+ }
+
+ if (ok) {
+ log.debug("The give graph is consistent.",this);
+ // No data is retrieved, the graph IS consistent
+ return Response.status(Status.OK).build();
+ } else {
+ log.debug("The give graph is NOT consistent.",this);
+ // No data is retrieved, the graph IS NOT consistent
+ return Response.status(Status.NO_CONTENT).build();
+ }
+
+ } catch (Exception e) {
+ // Some error occurred
+ throw new WebApplicationException(e, Status.INTERNAL_SERVER_ERROR);
+ }
+
+ }
+
+ /**
+ * To check the consistency of a RDF input File or IRI on the base of a
+ * Scope (or an ontology) and a recipe. Can be used either HermiT or an
+ * owl-link server reasoner end-point
+ *
+ * @param session
+ * {A string contains the session IRI used to check the
+ * consistency.}
+ * @param scope
+ * {A string contains either a specific scope's ontology or the
+ * scope IRI used to check the consistency.}
+ * @param recipe
+ * {A string contains the recipe IRI from the service
+ * http://localhost:port/kres/recipe/recipeName.}
+ * @Param file {A file in a RDF (eihter RDF/XML or owl) to be checked.}
+ * @Param input_graph {A string contains the IRI of RDF (either RDF/XML or
+ * OWL) to be checked.}
+ * @Param owllink_endpoint {A string contains the reasoner server end-point
+ * URL.}
+ * @return Return: <br/>
+ * 200 No data is retrieved, the graph IS consistent <br/>
+ * 204 No data is retrieved, the graph IS NOT consistent <br/>
+ * 400 To run the session is needed the scope <br/>
+ * 404 Scope either Ontology or recipe or RDF input not found <br/>
+ * 409 Too much RDF input <br/>
+ * 500 Some error occurred
+ */
+ @POST
+ @Consumes(MediaType.MULTIPART_FORM_DATA)
+ public Response getConsistencyCheck(
+ @FormParam(value = "session") String session,
+ @FormParam(value = "scope") String scope,
+ @FormParam(value = "recipe") String recipe,
+ @FormParam(value = "input-graph") String input_graph,
+ @FormParam(value = "file") File file,
+ @FormParam(value = "owllink-endpoint") String owllink_endpoint) {
+
+ try {
+
+ if ((session != null) && (scope == null)) {
+ log.error("Cannot load session without scope.", this);
+ return Response.status(Status.BAD_REQUEST).build();
+ }
+
+ // Check for input conflict. Only one input at once is allowed
+ if ((file != null) && (input_graph != null)) {
+ log.error("To much RDF input", this);
+ return Response.status(Status.CONFLICT).build();
+ }
+
+ // Load input file or graph
+ if (file != null)
+ this.inputowl = OWLManager.createOWLOntologyManager()
+ .loadOntologyFromOntologyDocument(file);
+ if (input_graph != null)
+ this.inputowl = OWLManager.createOWLOntologyManager()
+ .loadOntologyFromOntologyDocument(
+ IRI.create(input_graph));
+ if (inputowl == null && (session == null || scope == null))
+ return Response.status(Status.NOT_FOUND).build();
+ if (inputowl == null) {
+ if (scope != null)
+ this.inputowl = OWLManager.createOWLOntologyManager()
+ .createOntology();
+ else {
+ this.inputowl = OWLManager.createOWLOntologyManager()
+ .createOntology();
+ }
+ }
+
+ // Create list to add ontologies as imported
+ OWLOntologyManager mgr = inputowl.getOWLOntologyManager();
+ OWLDataFactory factory = inputowl.getOWLOntologyManager()
+ .getOWLDataFactory();
+ List<OWLOntologyChange> additions = new LinkedList<OWLOntologyChange>();
+
+ boolean ok = false;
+
+ // Load ontologies from scope, RDF input and recipe
+ // Try to resolve scope IRI
+ if ((scope != null) && (session == null))
+ try {
+ IRI iri = IRI.create(scope);
+ ScopeRegistry reg = onm.getScopeRegistry();
+ OntologyScope ontoscope = reg.getScope(iri);
+ Iterator<OWLOntology> importscope = ontoscope
+ .getCustomSpace().getOntologies().iterator();
+ Iterator<OntologySpace> importsession = ontoscope
+ .getSessionSpaces().iterator();
+
+ // Add ontology as import form scope, if it is anonymus we
+ // try to add single axioms.
+ while (importscope.hasNext()) {
+ OWLOntology auxonto = importscope.next();
+ if (!auxonto.getOntologyID().isAnonymous()) {
+ additions.add(new AddImport(inputowl, factory
+ .getOWLImportsDeclaration(auxonto
+ .getOWLOntologyManager()
+ .getOntologyDocumentIRI(auxonto))));
+ } else {
+ mgr.addAxioms(inputowl, auxonto.getAxioms());
+ }
+ }
+
+ // Add ontology form sessions
+ while (importsession.hasNext()) {
+ Iterator<OWLOntology> sessionontos = importsession
+ .next().getOntologies().iterator();
+ while (sessionontos.hasNext()) {
+ OWLOntology auxonto = sessionontos.next();
+ if (!auxonto.getOntologyID().isAnonymous()) {
+ additions
+ .add(new AddImport(
+ inputowl,
+ factory
+ .getOWLImportsDeclaration(auxonto
+ .getOWLOntologyManager()
+ .getOntologyDocumentIRI(
+ auxonto))));
+ } else {
+ mgr.addAxioms(inputowl, auxonto.getAxioms());
+ }
+ }
+
+ }
+
+ } catch (Exception e) {
+ log.error("Problem with scope: " + scope, this);
+ log.debug("Exception is ", e);
+ Response.status(Status.NOT_FOUND).build();
+ }
+
+ // Get Ontologies from session
+ if ((session != null) && (scope != null))
+ try {
+ IRI iri = IRI.create(scope);
+ ScopeRegistry reg = onm.getScopeRegistry();
+ OntologyScope ontoscope = reg.getScope(iri);
+ SessionOntologySpace sos = ontoscope.getSessionSpace(IRI
+ .create(session));
+
+ Set<OWLOntology> ontos = sos.getOntologyManager()
+ .getOntologies();
+ Iterator<OWLOntology> iteronto = ontos.iterator();
+
+ // Add session ontologies as import, if it is anonymus we
+ // try to add single axioms.
+ while (iteronto.hasNext()) {
+ OWLOntology auxonto = iteronto.next();
+ if (!auxonto.getOntologyID().isAnonymous()) {
+ additions.add(new AddImport(inputowl, factory
+ .getOWLImportsDeclaration(auxonto
+ .getOWLOntologyManager()
+ .getOntologyDocumentIRI(auxonto))));
+ } else {
+ mgr.addAxioms(inputowl, auxonto.getAxioms());
+ }
+ }
+
+ } catch (Exception e) {
+ log.error("Problem with session: " + session, this);
+ log.debug("Exception is", e);
+ Response.status(Status.NOT_FOUND).build();
+ }
+
+ // After gathered the all ontology as imported now we apply the
+ // changes
+ if (additions.size() > 0)
+ mgr.applyChanges(additions);
+
+ // Run HermiT if the reasonerURL is null;
+ if (owllink_endpoint == null) {
+
+ // Create the reasoner for the consistency check
+ try {
+
+ if (recipe != null) {
+ OWLOntology recipeowl = OWLManager
+ .createOWLOntologyManager()
+ .loadOntologyFromOntologyDocument(
+ IRI.create(recipe));
+
+ // Get Jea RDF model of SWRL rule contained in the
+ // recipe
+ Model swrlmodel = fromRecipeToModel(recipeowl);
+ // Create a reasoner to run rules contained in the
+ // recipe
+ RunRules rulereasoner = new RunRules(swrlmodel,
+ inputowl);
+ // Run the rule reasoner to the input RDF with the added
+ // top-ontology
+ inputowl = rulereasoner.runRulesReasoner();
+ }
+ CreateReasoner newreasoner = new CreateReasoner(
+ inputowl);
+ // Prepare and start the reasoner to check the consistence
+ RunReasoner reasoner = new RunReasoner(newreasoner
+ .getReasoner());
+ ok = reasoner.isConsistent();
+ } catch (InconsistentOntologyException exc) {
+ ok = false;
+ }
+
+ if (ok) {
+ // No data is retrieved, the graph IS consistent
+ return Response.status(Status.OK).build();
+ } else {
+ // No data is retrieved, the graph IS NOT consistent
+ return Response.status(Status.NO_CONTENT).build();
+ }
+
+ // If there is an owl-link server end-point specified in the
+ // form
+ } else {
+
+ // Create the reasoner for the consistency check by using the
+ // server and-point
+ try {
+ if (recipe != null) {
+ OWLOntology recipeowl = OWLManager
+ .createOWLOntologyManager()
+ .loadOntologyFromOntologyDocument(
+ IRI.create(recipe));
+ // Get Jea RDF model of SWRL rule contained in the
+ // recipe
+ Model swrlmodel = fromRecipeToModel(recipeowl);
+
+ // Create a reasoner to run rules contained in the
+ // recipe by using the server and-point
+ RunRules rulereasoner = new RunRules(swrlmodel,
+ inputowl, new URL(owllink_endpoint));
+ // Run the rule reasoner to the input RDF with the added
+ // top-ontology
+ inputowl = rulereasoner.runRulesReasoner();
+ }
+
+ CreateReasoner newreasoner = new CreateReasoner(
+ inputowl, new URL(owllink_endpoint));
+ // Prepare and start the reasoner to check the consistence
+ RunReasoner reasoner = new RunReasoner(newreasoner
+ .getReasoner());
+ ok = reasoner.isConsistent();
+ } catch (InconsistentOntologyException exc) {
+ ok = false;
+ }
+
+ if (ok) {
+ // No data is retrieved, the graph IS consistent
+ return Response.status(Status.OK).build();
+ } else {
+ // No data is retrieved, the graph IS NOT consistent
+ return Response.status(Status.NO_CONTENT).build();
+ }
+ }
+
+ } catch (Exception e) {
+ throw new WebApplicationException(e, Status.INTERNAL_SERVER_ERROR);
+ }
+
+ }
+
+}
Added: incubator/stanbol/trunk/reasoners/web/src/main/java/org/apache/stanbol/reasoners/web/resources/ConsistentRefactoring.java
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/reasoners/web/src/main/java/org/apache/stanbol/reasoners/web/resources/ConsistentRefactoring.java?rev=1087695&view=auto
==============================================================================
--- incubator/stanbol/trunk/reasoners/web/src/main/java/org/apache/stanbol/reasoners/web/resources/ConsistentRefactoring.java (added)
+++ incubator/stanbol/trunk/reasoners/web/src/main/java/org/apache/stanbol/reasoners/web/resources/ConsistentRefactoring.java Fri Apr 1 13:16:11 2011
@@ -0,0 +1,110 @@
+package org.apache.stanbol.reasoners.web.resources;
+
+import static javax.ws.rs.core.Response.Status.*;
+
+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.stanbol.kres.jersey.format.KRFormat;
+import org.apache.stanbol.reasoners.base.api.ConsistentRefactorer;
+import org.apache.stanbol.reasoners.base.api.InconcistencyException;
+import org.apache.stanbol.rules.base.api.NoSuchRecipeException;
+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;
+
+/**
+ * Special refactoring services that employ a DL reasoner for ensuring/checking consistency.
+ *
+ * @author alessandro
+ *
+ */
+@Path("/refactor")
+public class ConsistentRefactoring {
+
+ protected ConsistentRefactorer refactorer;
+
+ public ConsistentRefactoring(@Context ServletContext servletContext) {
+ refactorer = (ConsistentRefactorer) (servletContext
+ .getAttribute(ConsistentRefactorer.class.getName()));
+ if (refactorer == null) {
+ throw new IllegalStateException("SemionRefactorer missing in ServletContext");
+ }
+
+ }
+
+ @GET
+ @Path("/consistent")
+ public Response performConsistentRefactoringCreateGraph(@QueryParam("recipe") String recipe,
+ @QueryParam("input-graph") String inputGraph,
+ @QueryParam("output-graph") String outputGraph) {
+
+ IRI recipeIRI = IRI.create(recipe);
+ IRI inputGraphIRI = IRI.create(inputGraph);
+ IRI outputGraphIRI = IRI.create(outputGraph);
+
+ // Refactorer semionRefactorer = semionManager.getRegisteredRefactorer();
+
+ try {
+ refactorer.consistentOntologyRefactoring(outputGraphIRI, inputGraphIRI, recipeIRI);
+ return Response.ok().build();
+ } catch (RefactoringException e) {
+ return Response.status(INTERNAL_SERVER_ERROR).build();
+ } catch (NoSuchRecipeException e) {
+ return Response.status(204).build();
+ } catch (InconcistencyException e) {
+ return Response.status(415).build();
+ }
+
+ }
+
+ @POST
+ @Path("/consistent")
+ @Consumes(MediaType.MULTIPART_FORM_DATA)
+ @Produces({KRFormat.TURTLE, KRFormat.FUNCTIONAL_OWL, KRFormat.MANCHESTER_OWL, KRFormat.RDF_XML,
+ KRFormat.OWL_XML, KRFormat.RDF_JSON})
+ public Response consistentRefactoringOfNewGraph(@FormParam("recipe") String recipe,
+ @FormParam("input") InputStream input) {
+
+ IRI recipeIRI = IRI.create(recipe);
+
+ // Refactorer semionRefactorer = semionManager.getRegisteredRefactorer();
+
+ OWLOntologyManager manager = OWLManager.createOWLOntologyManager();
+ OWLOntology inputOntology;
+ try {
+ inputOntology = manager.loadOntologyFromOntologyDocument(input);
+
+ OWLOntology outputOntology;
+ try {
+ outputOntology = refactorer.consistentOntologyRefactoring(inputOntology, recipeIRI);
+ } catch (RefactoringException e) {
+ return Response.status(INTERNAL_SERVER_ERROR).build();
+ } catch (NoSuchRecipeException e) {
+ return Response.status(204).build();
+ } catch (InconcistencyException e) {
+ return Response.status(415).build();
+ }
+
+ return Response.ok(outputOntology).build();
+ } catch (OWLOntologyCreationException e) {
+ return Response.status(NOT_FOUND).build();
+ }
+
+ }
+
+}
Added: incubator/stanbol/trunk/reasoners/web/src/main/java/org/apache/stanbol/reasoners/web/resources/Enrichment.java
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/reasoners/web/src/main/java/org/apache/stanbol/reasoners/web/resources/Enrichment.java?rev=1087695&view=auto
==============================================================================
--- incubator/stanbol/trunk/reasoners/web/src/main/java/org/apache/stanbol/reasoners/web/resources/Enrichment.java (added)
+++ incubator/stanbol/trunk/reasoners/web/src/main/java/org/apache/stanbol/reasoners/web/resources/Enrichment.java Fri Apr 1 13:16:11 2011
@@ -0,0 +1,460 @@
+/*
+ * To change this template, choose Tools | Templates
+ * and open the template in the editor.
+ */
+
+package org.apache.stanbol.reasoners.web.resources;
+
+import java.io.File;
+import java.net.URL;
+import java.util.Hashtable;
+import java.util.Iterator;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Set;
+
+import javax.servlet.ServletContext;
+import javax.ws.rs.Consumes;
+import javax.ws.rs.FormParam;
+import javax.ws.rs.POST;
+import javax.ws.rs.Path;
+import javax.ws.rs.Produces;
+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.api.ontology.OntologyScope;
+import org.apache.stanbol.ontologymanager.ontonet.api.ontology.OntologySpace;
+import org.apache.stanbol.ontologymanager.ontonet.api.ontology.ScopeRegistry;
+import org.apache.stanbol.ontologymanager.ontonet.api.ontology.SessionOntologySpace;
+import org.apache.stanbol.ontologymanager.ontonet.impl.ONManagerImpl;
+import org.apache.stanbol.ontologymanager.ontonet.impl.io.ClerezzaOntologyStorage;
+import org.apache.stanbol.reasoners.base.commands.CreateReasoner;
+import org.apache.stanbol.reasoners.base.commands.RunReasoner;
+import org.apache.stanbol.reasoners.base.commands.RunRules;
+import org.apache.stanbol.rules.base.api.Rule;
+import org.apache.stanbol.rules.base.api.NoSuchRecipeException;
+import org.apache.stanbol.rules.base.api.RuleStore;
+import org.apache.stanbol.rules.base.api.util.RuleList;
+import org.apache.stanbol.rules.manager.KB;
+import org.apache.stanbol.rules.manager.changes.RuleStoreImpl;
+import org.apache.stanbol.rules.manager.parse.RuleParserImpl;
+import org.semanticweb.owlapi.apibinding.OWLManager;
+import org.semanticweb.owlapi.model.AddImport;
+import org.semanticweb.owlapi.model.IRI;
+import org.semanticweb.owlapi.model.OWLClass;
+import org.semanticweb.owlapi.model.OWLClassAssertionAxiom;
+import org.semanticweb.owlapi.model.OWLDataFactory;
+import org.semanticweb.owlapi.model.OWLDataProperty;
+import org.semanticweb.owlapi.model.OWLIndividual;
+import org.semanticweb.owlapi.model.OWLLiteral;
+import org.semanticweb.owlapi.model.OWLObjectProperty;
+import org.semanticweb.owlapi.model.OWLOntology;
+import org.semanticweb.owlapi.model.OWLOntologyChange;
+import org.semanticweb.owlapi.model.OWLOntologyManager;
+import org.semanticweb.owlapi.reasoner.InconsistentOntologyException;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import com.hp.hpl.jena.rdf.model.Model;
+import com.hp.hpl.jena.rdf.model.ModelFactory;
+import com.hp.hpl.jena.rdf.model.Resource;
+
+
+/**
+ *
+ *
+ */
+@Path("/enrichment")
+public class Enrichment {
+
+ private RuleStore kresRuleStore;
+ private OWLOntology inputowl;
+ private OWLOntology scopeowl;
+
+ protected ONManager onm;
+ protected ClerezzaOntologyStorage storage;
+
+ private Logger log = LoggerFactory.getLogger(getClass());
+
+ /**
+ * 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 Enrichment(@Context ServletContext servletContext){
+ // Retrieve the rule store
+ this.kresRuleStore = (RuleStore) servletContext
+ .getAttribute(RuleStore.class.getName());
+ // Retrieve the ontology network manager
+ this.onm = (ONManager) servletContext
+ .getAttribute(ONManager.class.getName());
+// this.storage = (OntologyStorage) servletContext
+// .getAttribute(OntologyStorage.class.getName());
+// Contingency code for missing components follows.
+/*
+ * FIXME! The following code is required only for the tests. This should
+ * be removed and the test should work without this code.
+ */
+if (onm == null) {
+ log
+ .warn("No KReSONManager in servlet context. Instantiating manually...");
+ onm = new ONManagerImpl(new TcManager(), null,
+ new Hashtable<String, Object>());
+}
+this.storage = onm.getOntologyStore();
+if (storage == null) {
+ log.warn("No OntologyStorage in servlet context. Instantiating manually...");
+ storage = new ClerezzaOntologyStorage(new TcManager(),null);
+}
+ 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());
+ }
+ }
+
+ /**
+ * To trasform a sequence of rules to a Jena Model
+ *
+ * @param owl
+ * {OWLOntology object contains a single recipe}
+ * @return {A jena rdf model contains the SWRL rule.}
+ */
+ private Model fromRecipeToModel(OWLOntology owl)
+ throws NoSuchRecipeException {
+
+ // FIXME: why the heck is this method re-instantiating a rule store?!?
+ RuleStore store = new RuleStoreImpl(onm,
+ new Hashtable<String, Object>(), owl);
+ Model jenamodel = ModelFactory.createDefaultModel();
+
+ OWLDataFactory factory = owl.getOWLOntologyManager()
+ .getOWLDataFactory();
+ OWLClass ontocls = factory
+ .getOWLClass(IRI
+ .create("http://kres.iks-project.eu/ontology/meta/rmi.owl#Recipe"));
+ Set<OWLClassAssertionAxiom> cls = owl.getClassAssertionAxioms(ontocls);
+ Iterator<OWLClassAssertionAxiom> iter = cls.iterator();
+ IRI recipeiri = IRI.create(iter.next().getIndividual().toStringID());
+
+ OWLIndividual recipeIndividual = factory
+ .getOWLNamedIndividual(recipeiri);
+
+ OWLObjectProperty objectProperty = factory
+ .getOWLObjectProperty(IRI
+ .create("http://kres.iks-project.eu/ontology/meta/rmi.owl#hasRule"));
+ Set<OWLIndividual> rules = recipeIndividual.getObjectPropertyValues(
+ objectProperty, store.getOntology());
+ String kReSRules = "";
+ for(OWLIndividual rule : rules){
+ OWLDataProperty hasBodyAndHead = factory
+ .getOWLDataProperty(IRI
+ .create("http://kres.iks-project.eu/ontology/meta/rmi.owl#hasBodyAndHead"));
+ Set<OWLLiteral> kReSRuleLiterals = rule.getDataPropertyValues(
+ hasBodyAndHead, store.getOntology());
+
+ for(OWLLiteral kReSRuleLiteral : kReSRuleLiterals){
+ kReSRules += kReSRuleLiteral.getLiteral()
+ + System.getProperty("line.separator");
+ }
+ }
+
+ //"ProvaParent = <http://www.semanticweb.org/ontologies/2010/6/ProvaParent.owl#> . rule1[ has(ProvaParent:hasParent, ?x, ?y) . has(ProvaParent:hasBrother, ?y, ?z) -> has(ProvaParent:hasUncle, ?x, ?z) ]");
+ KB kReSKB = RuleParserImpl.parse(kReSRules);
+ RuleList listrules = kReSKB.getkReSRuleList();
+ Iterator<Rule> iterule = listrules.iterator();
+ while(iterule.hasNext()){
+ Rule singlerule = iterule.next();
+ Resource resource = singlerule.toSWRL(jenamodel);
+ }
+
+ return jenamodel;
+
+ }
+
+ /**
+ * To perform a rule based reasoning with a given recipe and scope (or an
+ * ontology) to a RDF input specify via its IRI.
+ *
+ * @param session
+ * {A string contains the session IRI used to inference the
+ * input.}
+ * @param scope
+ * {A string contains either ontology or the scope IRI used to
+ * inference the input.}
+ * @param recipe
+ * {A string contains the recipe IRI from the service
+ * http://localhost:port/kres/recipe/recipeName.}
+ * @Param file {A file in a RDF (eihter RDF/XML or owl) to inference.}
+ * @Param input_graph {A string contains the IRI of RDF (either RDF/XML or
+ * OWL) to inference.}
+ * @Param owllink_endpoint {A string contains the reasoner server end-point
+ * URL.}
+ * @return Return: <br/>
+ * 200 Returns a graph with the enrichments <br/>
+ * 204 No enrichments have been produced from the given graph <br/>
+ * 400 To run the session is needed the scope <br/>
+ * 404 The recipe/ontology/scope/input doesn't exist in the network <br/>
+ * 409 Too much RDF inputs <br/>
+ * 500 Some error occurred
+ */
+ @POST
+ @Consumes(MediaType.MULTIPART_FORM_DATA)
+ @Produces("application/rdf+xml")
+ public Response ontologyEnrichment(
+ @FormParam(value = "session") String session,
+ @FormParam(value = "scope") String scope,
+ @FormParam(value = "recipe") String recipe,
+ @FormParam(value = "input-graph") String input_graph,
+ @FormParam(value = "file") File file,
+ @FormParam(value = "owllink-endpoint") String owllink_endpoint) {
+
+ try{
+
+ if((session!=null)&&(scope==null)){
+ System.err.println("ERROR: Cannot load session without scope.");
+ return Response.status(Status.BAD_REQUEST).build();
+ }
+
+ //Check for input conflict. Only one input at once is allowed
+ if((file!=null)&&(input_graph!=null)){
+ System.err.println("ERROR: To much RDF input");
+ return Response.status(Status.CONFLICT).build();
+ }
+
+ //Load input file or graph
+ if(file!=null)
+ this.inputowl = OWLManager.createOWLOntologyManager()
+ .loadOntologyFromOntologyDocument(file);
+ if(input_graph!=null)
+ this.inputowl = OWLManager.createOWLOntologyManager()
+ .loadOntologyFromOntologyDocument(
+ IRI.create(input_graph));
+
+ if(inputowl==null)
+ return Response.status(Status.NOT_FOUND).build();
+
+ //Create list to add ontologies as imported
+ OWLOntologyManager mgr = inputowl.getOWLOntologyManager();
+ OWLDataFactory factory = inputowl.getOWLOntologyManager()
+ .getOWLDataFactory();
+ List<OWLOntologyChange> additions = new LinkedList<OWLOntologyChange>();
+
+ boolean ok = false;
+
+ //Load ontologies from scope, RDF input and recipe
+ //Try to resolve scope IRI
+ if((scope!=null)&&(session==null))
+ try{
+ IRI iri = IRI.create(scope);
+ ScopeRegistry reg = onm.getScopeRegistry();
+ OntologyScope ontoscope = reg.getScope(iri);
+ Iterator<OWLOntology> importscope = ontoscope
+ .getCustomSpace().getOntologies().iterator();
+ Iterator<OntologySpace> importsession = ontoscope
+ .getSessionSpaces().iterator();
+
+ // Add ontology as import form scope, if it is anonymus we
+ // try to add single axioms.
+ while(importscope.hasNext()){
+ OWLOntology auxonto = importscope.next();
+ if(!auxonto.getOntologyID().isAnonymous()){
+ additions.add(new AddImport(inputowl, factory
+ .getOWLImportsDeclaration(auxonto
+ .getOWLOntologyManager()
+ .getOntologyDocumentIRI(auxonto))));
+ }else{
+ mgr.addAxioms(inputowl,auxonto.getAxioms());
+ }
+ }
+
+ //Add ontology form sessions
+ while(importsession.hasNext()){
+ Iterator<OWLOntology> sessionontos = importsession
+ .next().getOntologies().iterator();
+ while(sessionontos.hasNext()){
+ OWLOntology auxonto = sessionontos.next();
+ if(!auxonto.getOntologyID().isAnonymous()){
+ additions
+ .add(new AddImport(
+ inputowl,
+ factory
+ .getOWLImportsDeclaration(auxonto
+ .getOWLOntologyManager()
+ .getOntologyDocumentIRI(
+ auxonto))));
+ }else{
+ mgr.addAxioms(inputowl,auxonto.getAxioms());
+ }
+ }
+
+ }
+
+ }catch(Exception e){
+ System.err.println("ERROR: Problem with scope: "+scope);
+ e.printStackTrace();
+ Response.status(Status.NOT_FOUND).build();
+ }
+
+ //Get Ontologies from session
+ if((session!=null)&&(scope!=null))
+ try{
+ IRI iri = IRI.create(scope);
+ ScopeRegistry reg = onm.getScopeRegistry();
+ OntologyScope ontoscope = reg.getScope(iri);
+ SessionOntologySpace sos = ontoscope.getSessionSpace(IRI
+ .create(session));
+
+ Set<OWLOntology> ontos = sos.getOntologyManager()
+ .getOntologies();
+ Iterator<OWLOntology> iteronto = ontos.iterator();
+
+ // Add session ontologies as import, if it is anonymus we
+ // try to add single axioms.
+ while(iteronto.hasNext()){
+ OWLOntology auxonto = iteronto.next();
+ if(!auxonto.getOntologyID().isAnonymous()){
+ additions.add(new AddImport(inputowl, factory
+ .getOWLImportsDeclaration(auxonto
+ .getOWLOntologyManager()
+ .getOntologyDocumentIRI(auxonto))));
+ }else{
+ mgr.addAxioms(inputowl,auxonto.getAxioms());
+ }
+ }
+
+ }catch(Exception e){
+ System.err.println("ERROR: Problem with session: "
+ + session);
+ e.printStackTrace();
+ Response.status(Status.NOT_FOUND).build();
+ }
+
+ // After gathered the all ontology as imported now we apply the
+ // changes
+ if(additions.size()>0)
+ mgr.applyChanges(additions);
+
+ //Run HermiT if the reasonerURL is null;
+ if(owllink_endpoint==null){
+
+ try{
+ if(recipe!=null) {
+ OWLOntology recipeowl = OWLManager
+ .createOWLOntologyManager()
+ .loadOntologyFromOntologyDocument(
+ IRI.create(recipe));
+ // Get Jea RDF model of SWRL rule contained in the
+ // recipe
+ Model swrlmodel = fromRecipeToModel(recipeowl);
+
+ // Create a reasoner to run rules contained in the
+ // recipe
+ RunRules rulereasoner = new RunRules(swrlmodel,
+ inputowl);
+ // Run the rule reasoner to the input RDF with the added
+ // top-ontology
+ inputowl = rulereasoner.runRulesReasoner();
+ }
+
+ //Create the reasoner for the enrichment
+ CreateReasoner newreasoner = new CreateReasoner(
+ inputowl);
+ // Prepare and start the reasoner to enrich ontology's
+ // resources
+ RunReasoner reasoner = new RunReasoner(newreasoner
+ .getReasoner());
+
+ // Create a new OWLOntology model where to put the inferred
+ // axioms
+ OWLOntology output = OWLManager.createOWLOntologyManager()
+ .createOntology(inputowl.getOntologyID());
+ //Initial input axioms count
+ int startax = output.getAxiomCount();
+ //Run the classification
+ output = reasoner.runGeneralInference(output);
+ //End output axioms count
+ int endax = output.getAxiomCount();
+
+ if((endax-startax)>0){
+ //Some inference is retrieved
+ return Response.ok(output).build();
+ }else{
+ //No data is retrieved
+ return Response.status(Status.NOT_FOUND).build();
+ }
+ }catch (InconsistentOntologyException exc){
+ System.err.println("CHECK ONTOLOGY CONSISTENCE");
+ return Response.status(Status.NOT_FOUND).build();
+ }
+ // If there is an owl-link server end-point specified in the
+ // form
+ }else{
+
+ try{
+ if(recipe!=null) {
+ OWLOntology recipeowl = OWLManager
+ .createOWLOntologyManager()
+ .loadOntologyFromOntologyDocument(
+ IRI.create(recipe));
+ // Get Jea RDF model of SWRL rule contained in the
+ // recipe
+ Model swrlmodel = fromRecipeToModel(recipeowl);
+ // Create a reasoner to run rules contained in the
+ // recipe by using the server and-point
+ RunRules rulereasoner = new RunRules(swrlmodel,
+ inputowl, new URL(owllink_endpoint));
+ // Run the rule reasoner to the input RDF with the added
+ // top-ontology
+ inputowl = rulereasoner.runRulesReasoner();
+ }
+
+ // Create a new OWLOntology model where to put the inferred
+ // axioms
+ OWLOntology output = OWLManager.createOWLOntologyManager()
+ .createOntology(inputowl.getOntologyID());
+
+ //Create the reasoner for the enrichment
+ CreateReasoner newreasoner = new CreateReasoner(
+ inputowl, new URL(owllink_endpoint));
+ // Prepare and start the reasoner to enrich ontology's
+ // resources
+ RunReasoner reasoner = new RunReasoner(newreasoner
+ .getReasoner());
+
+ //Initial input axioms count
+ int startax = output.getAxiomCount();
+ //Run the rule reasoner
+ output = reasoner.runGeneralInference(output);
+ //End output axioms count
+ int endax = output.getAxiomCount();
+
+ if((endax-startax)>0){
+ //No data is retrieved, the graph IS consistent
+ return Response.ok(output).build();
+ }else{
+ //No data is retrieved, the graph IS NOT consistent
+ return Response.status(Status.NO_CONTENT).build();
+ }
+ }catch (InconsistentOntologyException exc){
+ System.err.println("CHECK ONTOLOGY CONSISTENCE");
+ return Response.status(Status.NOT_FOUND).build();
+ }
+ }
+ }catch(Exception e){
+ throw new WebApplicationException(e, Status.INTERNAL_SERVER_ERROR);
+ }
+
+ }
+
+}
Propchange: incubator/stanbol/trunk/reasoners/web/src/main/resources/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Fri Apr 1 13:16:11 2011
@@ -0,0 +1 @@
+target
Propchange: incubator/stanbol/trunk/reasoners/web/src/main/resources/META-INF/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Fri Apr 1 13:16:11 2011
@@ -0,0 +1 @@
+target
Propchange: incubator/stanbol/trunk/reasoners/web/src/main/resources/META-INF/static/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Fri Apr 1 13:16:11 2011
@@ -0,0 +1 @@
+target
Propchange: incubator/stanbol/trunk/reasoners/web/src/main/resources/META-INF/static/images/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Fri Apr 1 13:16:11 2011
@@ -0,0 +1 @@
+target
Added: incubator/stanbol/trunk/reasoners/web/src/main/resources/META-INF/static/images/add.gif
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/reasoners/web/src/main/resources/META-INF/static/images/add.gif?rev=1087695&view=auto
==============================================================================
Binary file - no diff available.
Propchange: incubator/stanbol/trunk/reasoners/web/src/main/resources/META-INF/static/images/add.gif
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: incubator/stanbol/trunk/reasoners/web/src/main/resources/META-INF/static/images/addRule.gif
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/reasoners/web/src/main/resources/META-INF/static/images/addRule.gif?rev=1087695&view=auto
==============================================================================
Binary file - no diff available.
Propchange: incubator/stanbol/trunk/reasoners/web/src/main/resources/META-INF/static/images/addRule.gif
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: incubator/stanbol/trunk/reasoners/web/src/main/resources/META-INF/static/images/ajax-loader.gif
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/reasoners/web/src/main/resources/META-INF/static/images/ajax-loader.gif?rev=1087695&view=auto
==============================================================================
Binary file - no diff available.
Propchange: incubator/stanbol/trunk/reasoners/web/src/main/resources/META-INF/static/images/ajax-loader.gif
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: incubator/stanbol/trunk/reasoners/web/src/main/resources/META-INF/static/images/anonymous_48.png
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/reasoners/web/src/main/resources/META-INF/static/images/anonymous_48.png?rev=1087695&view=auto
==============================================================================
Binary file - no diff available.
Propchange: incubator/stanbol/trunk/reasoners/web/src/main/resources/META-INF/static/images/anonymous_48.png
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: incubator/stanbol/trunk/reasoners/web/src/main/resources/META-INF/static/images/black_gear_128.png
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/reasoners/web/src/main/resources/META-INF/static/images/black_gear_128.png?rev=1087695&view=auto
==============================================================================
Binary file - no diff available.
Propchange: incubator/stanbol/trunk/reasoners/web/src/main/resources/META-INF/static/images/black_gear_128.png
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: incubator/stanbol/trunk/reasoners/web/src/main/resources/META-INF/static/images/black_gear_16.png
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/reasoners/web/src/main/resources/META-INF/static/images/black_gear_16.png?rev=1087695&view=auto
==============================================================================
Binary file - no diff available.
Propchange: incubator/stanbol/trunk/reasoners/web/src/main/resources/META-INF/static/images/black_gear_16.png
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: incubator/stanbol/trunk/reasoners/web/src/main/resources/META-INF/static/images/caos_puzzle.jpg
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/reasoners/web/src/main/resources/META-INF/static/images/caos_puzzle.jpg?rev=1087695&view=auto
==============================================================================
Binary file - no diff available.
Propchange: incubator/stanbol/trunk/reasoners/web/src/main/resources/META-INF/static/images/caos_puzzle.jpg
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: incubator/stanbol/trunk/reasoners/web/src/main/resources/META-INF/static/images/compass_48.png
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/reasoners/web/src/main/resources/META-INF/static/images/compass_48.png?rev=1087695&view=auto
==============================================================================
Binary file - no diff available.
Propchange: incubator/stanbol/trunk/reasoners/web/src/main/resources/META-INF/static/images/compass_48.png
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: incubator/stanbol/trunk/reasoners/web/src/main/resources/META-INF/static/images/compass_map_48.png
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/reasoners/web/src/main/resources/META-INF/static/images/compass_map_48.png?rev=1087695&view=auto
==============================================================================
Binary file - no diff available.
Propchange: incubator/stanbol/trunk/reasoners/web/src/main/resources/META-INF/static/images/compass_map_48.png
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: incubator/stanbol/trunk/reasoners/web/src/main/resources/META-INF/static/images/configure.gif
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/reasoners/web/src/main/resources/META-INF/static/images/configure.gif?rev=1087695&view=auto
==============================================================================
Binary file - no diff available.
Propchange: incubator/stanbol/trunk/reasoners/web/src/main/resources/META-INF/static/images/configure.gif
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: incubator/stanbol/trunk/reasoners/web/src/main/resources/META-INF/static/images/delete.gif
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/reasoners/web/src/main/resources/META-INF/static/images/delete.gif?rev=1087695&view=auto
==============================================================================
Binary file - no diff available.
Propchange: incubator/stanbol/trunk/reasoners/web/src/main/resources/META-INF/static/images/delete.gif
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: incubator/stanbol/trunk/reasoners/web/src/main/resources/META-INF/static/images/download.png
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/reasoners/web/src/main/resources/META-INF/static/images/download.png?rev=1087695&view=auto
==============================================================================
Binary file - no diff available.
Propchange: incubator/stanbol/trunk/reasoners/web/src/main/resources/META-INF/static/images/download.png
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: incubator/stanbol/trunk/reasoners/web/src/main/resources/META-INF/static/images/download_rdf.png
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/reasoners/web/src/main/resources/META-INF/static/images/download_rdf.png?rev=1087695&view=auto
==============================================================================
Binary file - no diff available.
Propchange: incubator/stanbol/trunk/reasoners/web/src/main/resources/META-INF/static/images/download_rdf.png
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: incubator/stanbol/trunk/reasoners/web/src/main/resources/META-INF/static/images/external.png
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/reasoners/web/src/main/resources/META-INF/static/images/external.png?rev=1087695&view=auto
==============================================================================
Binary file - no diff available.
Propchange: incubator/stanbol/trunk/reasoners/web/src/main/resources/META-INF/static/images/external.png
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: incubator/stanbol/trunk/reasoners/web/src/main/resources/META-INF/static/images/favicon-black.png
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/reasoners/web/src/main/resources/META-INF/static/images/favicon-black.png?rev=1087695&view=auto
==============================================================================
Binary file - no diff available.
Propchange: incubator/stanbol/trunk/reasoners/web/src/main/resources/META-INF/static/images/favicon-black.png
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: incubator/stanbol/trunk/reasoners/web/src/main/resources/META-INF/static/images/favicon-sw.png
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/reasoners/web/src/main/resources/META-INF/static/images/favicon-sw.png?rev=1087695&view=auto
==============================================================================
Binary file - no diff available.
Propchange: incubator/stanbol/trunk/reasoners/web/src/main/resources/META-INF/static/images/favicon-sw.png
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: incubator/stanbol/trunk/reasoners/web/src/main/resources/META-INF/static/images/favicon.png
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/reasoners/web/src/main/resources/META-INF/static/images/favicon.png?rev=1087695&view=auto
==============================================================================
Binary file - no diff available.
Propchange: incubator/stanbol/trunk/reasoners/web/src/main/resources/META-INF/static/images/favicon.png
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: incubator/stanbol/trunk/reasoners/web/src/main/resources/META-INF/static/images/fise_logo_cropped.png
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/reasoners/web/src/main/resources/META-INF/static/images/fise_logo_cropped.png?rev=1087695&view=auto
==============================================================================
Binary file - no diff available.
Propchange: incubator/stanbol/trunk/reasoners/web/src/main/resources/META-INF/static/images/fise_logo_cropped.png
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: incubator/stanbol/trunk/reasoners/web/src/main/resources/META-INF/static/images/fise_logo_white.png
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/reasoners/web/src/main/resources/META-INF/static/images/fise_logo_white.png?rev=1087695&view=auto
==============================================================================
Binary file - no diff available.
Propchange: incubator/stanbol/trunk/reasoners/web/src/main/resources/META-INF/static/images/fise_logo_white.png
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: incubator/stanbol/trunk/reasoners/web/src/main/resources/META-INF/static/images/fise_logo_white_small.png
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/reasoners/web/src/main/resources/META-INF/static/images/fise_logo_white_small.png?rev=1087695&view=auto
==============================================================================
Binary file - no diff available.
Propchange: incubator/stanbol/trunk/reasoners/web/src/main/resources/META-INF/static/images/fise_logo_white_small.png
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: incubator/stanbol/trunk/reasoners/web/src/main/resources/META-INF/static/images/foldable_folded.png
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/reasoners/web/src/main/resources/META-INF/static/images/foldable_folded.png?rev=1087695&view=auto
==============================================================================
Binary file - no diff available.
Propchange: incubator/stanbol/trunk/reasoners/web/src/main/resources/META-INF/static/images/foldable_folded.png
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: incubator/stanbol/trunk/reasoners/web/src/main/resources/META-INF/static/images/foldable_unfolded.png
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/reasoners/web/src/main/resources/META-INF/static/images/foldable_unfolded.png?rev=1087695&view=auto
==============================================================================
Binary file - no diff available.
Propchange: incubator/stanbol/trunk/reasoners/web/src/main/resources/META-INF/static/images/foldable_unfolded.png
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: incubator/stanbol/trunk/reasoners/web/src/main/resources/META-INF/static/images/header_bg.png
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/reasoners/web/src/main/resources/META-INF/static/images/header_bg.png?rev=1087695&view=auto
==============================================================================
Binary file - no diff available.
Propchange: incubator/stanbol/trunk/reasoners/web/src/main/resources/META-INF/static/images/header_bg.png
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: incubator/stanbol/trunk/reasoners/web/src/main/resources/META-INF/static/images/iks_project_logo.jpg
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/reasoners/web/src/main/resources/META-INF/static/images/iks_project_logo.jpg?rev=1087695&view=auto
==============================================================================
Binary file - no diff available.
Propchange: incubator/stanbol/trunk/reasoners/web/src/main/resources/META-INF/static/images/iks_project_logo.jpg
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: incubator/stanbol/trunk/reasoners/web/src/main/resources/META-INF/static/images/kresLogo.png
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/reasoners/web/src/main/resources/META-INF/static/images/kresLogo.png?rev=1087695&view=auto
==============================================================================
Binary file - no diff available.
Propchange: incubator/stanbol/trunk/reasoners/web/src/main/resources/META-INF/static/images/kresLogo.png
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: incubator/stanbol/trunk/reasoners/web/src/main/resources/META-INF/static/images/kresLogoExtended.png
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/reasoners/web/src/main/resources/META-INF/static/images/kresLogoExtended.png?rev=1087695&view=auto
==============================================================================
Binary file - no diff available.
Propchange: incubator/stanbol/trunk/reasoners/web/src/main/resources/META-INF/static/images/kresLogoExtended.png
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: incubator/stanbol/trunk/reasoners/web/src/main/resources/META-INF/static/images/loading.gif
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/reasoners/web/src/main/resources/META-INF/static/images/loading.gif?rev=1087695&view=auto
==============================================================================
Binary file - no diff available.
Propchange: incubator/stanbol/trunk/reasoners/web/src/main/resources/META-INF/static/images/loading.gif
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: incubator/stanbol/trunk/reasoners/web/src/main/resources/META-INF/static/images/next.png
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/reasoners/web/src/main/resources/META-INF/static/images/next.png?rev=1087695&view=auto
==============================================================================
Binary file - no diff available.
Propchange: incubator/stanbol/trunk/reasoners/web/src/main/resources/META-INF/static/images/next.png
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: incubator/stanbol/trunk/reasoners/web/src/main/resources/META-INF/static/images/organization_48.png
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/reasoners/web/src/main/resources/META-INF/static/images/organization_48.png?rev=1087695&view=auto
==============================================================================
Binary file - no diff available.
Propchange: incubator/stanbol/trunk/reasoners/web/src/main/resources/META-INF/static/images/organization_48.png
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: incubator/stanbol/trunk/reasoners/web/src/main/resources/META-INF/static/images/previous.png
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/reasoners/web/src/main/resources/META-INF/static/images/previous.png?rev=1087695&view=auto
==============================================================================
Binary file - no diff available.
Propchange: incubator/stanbol/trunk/reasoners/web/src/main/resources/META-INF/static/images/previous.png
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: incubator/stanbol/trunk/reasoners/web/src/main/resources/META-INF/static/images/rdf.png
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/reasoners/web/src/main/resources/META-INF/static/images/rdf.png?rev=1087695&view=auto
==============================================================================
Binary file - no diff available.
Propchange: incubator/stanbol/trunk/reasoners/web/src/main/resources/META-INF/static/images/rdf.png
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: incubator/stanbol/trunk/reasoners/web/src/main/resources/META-INF/static/images/rdf_flyer.64.png
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/reasoners/web/src/main/resources/META-INF/static/images/rdf_flyer.64.png?rev=1087695&view=auto
==============================================================================
Binary file - no diff available.
Propchange: incubator/stanbol/trunk/reasoners/web/src/main/resources/META-INF/static/images/rdf_flyer.64.png
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: incubator/stanbol/trunk/reasoners/web/src/main/resources/META-INF/static/images/rdf_flyer_16.png
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/reasoners/web/src/main/resources/META-INF/static/images/rdf_flyer_16.png?rev=1087695&view=auto
==============================================================================
Binary file - no diff available.
Propchange: incubator/stanbol/trunk/reasoners/web/src/main/resources/META-INF/static/images/rdf_flyer_16.png
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: incubator/stanbol/trunk/reasoners/web/src/main/resources/META-INF/static/images/rdf_flyer_24.png
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/reasoners/web/src/main/resources/META-INF/static/images/rdf_flyer_24.png?rev=1087695&view=auto
==============================================================================
Binary file - no diff available.
Propchange: incubator/stanbol/trunk/reasoners/web/src/main/resources/META-INF/static/images/rdf_flyer_24.png
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: incubator/stanbol/trunk/reasoners/web/src/main/resources/META-INF/static/images/rules.gif
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/reasoners/web/src/main/resources/META-INF/static/images/rules.gif?rev=1087695&view=auto
==============================================================================
Binary file - no diff available.
Propchange: incubator/stanbol/trunk/reasoners/web/src/main/resources/META-INF/static/images/rules.gif
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: incubator/stanbol/trunk/reasoners/web/src/main/resources/META-INF/static/images/stlabLogo.jpg
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/reasoners/web/src/main/resources/META-INF/static/images/stlabLogo.jpg?rev=1087695&view=auto
==============================================================================
Binary file - no diff available.
Propchange: incubator/stanbol/trunk/reasoners/web/src/main/resources/META-INF/static/images/stlabLogo.jpg
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: incubator/stanbol/trunk/reasoners/web/src/main/resources/META-INF/static/images/stlabLogo.png
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/reasoners/web/src/main/resources/META-INF/static/images/stlabLogo.png?rev=1087695&view=auto
==============================================================================
Binary file - no diff available.
Propchange: incubator/stanbol/trunk/reasoners/web/src/main/resources/META-INF/static/images/stlabLogo.png
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: incubator/stanbol/trunk/reasoners/web/src/main/resources/META-INF/static/images/sw-cube.png
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/reasoners/web/src/main/resources/META-INF/static/images/sw-cube.png?rev=1087695&view=auto
==============================================================================
Binary file - no diff available.
Propchange: incubator/stanbol/trunk/reasoners/web/src/main/resources/META-INF/static/images/sw-cube.png
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: incubator/stanbol/trunk/reasoners/web/src/main/resources/META-INF/static/images/user_48.png
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/reasoners/web/src/main/resources/META-INF/static/images/user_48.png?rev=1087695&view=auto
==============================================================================
Binary file - no diff available.
Propchange: incubator/stanbol/trunk/reasoners/web/src/main/resources/META-INF/static/images/user_48.png
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: incubator/stanbol/trunk/reasoners/web/src/main/resources/META-INF/static/images/user_group_48.png
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/reasoners/web/src/main/resources/META-INF/static/images/user_group_48.png?rev=1087695&view=auto
==============================================================================
Binary file - no diff available.
Propchange: incubator/stanbol/trunk/reasoners/web/src/main/resources/META-INF/static/images/user_group_48.png
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: incubator/stanbol/trunk/reasoners/web/src/main/resources/META-INF/static/images/wikipedia_w_16.png
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/reasoners/web/src/main/resources/META-INF/static/images/wikipedia_w_16.png?rev=1087695&view=auto
==============================================================================
Binary file - no diff available.
Propchange: incubator/stanbol/trunk/reasoners/web/src/main/resources/META-INF/static/images/wikipedia_w_16.png
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Propchange: incubator/stanbol/trunk/reasoners/web/src/main/resources/META-INF/static/scripts/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Fri Apr 1 13:16:11 2011
@@ -0,0 +1 @@
+target
Added: incubator/stanbol/trunk/reasoners/web/src/main/resources/META-INF/static/scripts/jit-yc.js
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/reasoners/web/src/main/resources/META-INF/static/scripts/jit-yc.js?rev=1087695&view=auto
==============================================================================
--- incubator/stanbol/trunk/reasoners/web/src/main/resources/META-INF/static/scripts/jit-yc.js (added)
+++ incubator/stanbol/trunk/reasoners/web/src/main/resources/META-INF/static/scripts/jit-yc.js Fri Apr 1 13:16:11 2011
@@ -0,0 +1,27 @@
+/*
+ Copyright (c) 2010, Nicolas Garcia Belmonte
+ All rights reserved
+
+ > Redistribution and use in source and binary forms, with or without
+ > modification, are permitted provided that the following conditions are met:
+ > * Redistributions of source code must retain the above copyright
+ > notice, this list of conditions and the following disclaimer.
+ > * Redistributions in binary form must reproduce the above copyright
+ > notice, this list of conditions and the following disclaimer in the
+ > documentation and/or other materials provided with the distribution.
+ > * Neither the name of the organization nor the
+ > names of its contributors may be used to endorse or promote products
+ > derived from this software without specific prior written permission.
+ >
+ > THIS SOFTWARE IS PROVIDED BY NICOLAS GARCIA BELMONTE ``AS IS'' AND ANY
+ > EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ > WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ > DISCLAIMED. IN NO EVENT SHALL NICOLAS GARCIA BELMONTE BE LIABLE FOR ANY
+ > DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ > (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ > LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ > ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ > (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ > SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
[... 3 lines stripped ...]