You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@marmotta.apache.org by wi...@apache.org on 2014/06/13 10:57:27 UTC

[007/100] [abbrv] [partial] Reverting the erroneous merge by Sebastian according to the instructions in INFRA-6876

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/services/triplestore/SesameServiceImpl.java
----------------------------------------------------------------------
diff --git a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/services/triplestore/SesameServiceImpl.java b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/services/triplestore/SesameServiceImpl.java
index ca7e00a..29061c3 100644
--- a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/services/triplestore/SesameServiceImpl.java
+++ b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/services/triplestore/SesameServiceImpl.java
@@ -17,6 +17,8 @@
  */
 package org.apache.marmotta.platform.core.services.triplestore;
 
+import edu.emory.mathcs.backport.java.util.concurrent.locks.ReentrantReadWriteLock;
+import org.apache.marmotta.kiwi.config.KiWiConfiguration;
 import org.apache.marmotta.platform.core.api.config.ConfigurationService;
 import org.apache.marmotta.platform.core.api.triplestore.NotifyingSailProvider;
 import org.apache.marmotta.platform.core.api.triplestore.SesameService;
@@ -37,9 +39,11 @@ import org.apache.marmotta.kiwi.transactions.sail.KiWiTransactionalSail;
 import org.openrdf.model.ValueFactory;
 import org.openrdf.repository.RepositoryConnection;
 import org.openrdf.repository.RepositoryException;
+import org.openrdf.repository.base.RepositoryConnectionWrapper;
 import org.openrdf.repository.sail.SailRepository;
 import org.openrdf.sail.NotifyingSail;
 import org.openrdf.sail.Sail;
+import org.openrdf.sail.SailException;
 import org.slf4j.Logger;
 
 import javax.annotation.PreDestroy;
@@ -117,79 +121,93 @@ public class SesameServiceImpl implements SesameService {
 
     private SailRepository repository;
 
+    private ReentrantReadWriteLock restartLock = new ReentrantReadWriteLock();
+
     /**
      * Initialise the Sesame repository. Should be called on service activation.
      */
     @Override
     public synchronized void initialise() {
-        log.info("Apache Marmotta Sesame Repository Service starting up ...");
+        restartLock.writeLock().lock();
+        try {
+            log.info("Apache Marmotta Sesame Repository Service starting up ...");
 
-        if(repository != null) {
-            log.warn("RDF repository has already been initialized");
-        }
+            if(repository != null) {
+                log.warn("RDF repository has already been initialized");
+            }
 
-        String database = configurationService.getStringConfiguration("database.type");
-        KiWiDialect dialect;
-        if("h2".equalsIgnoreCase(database)) {
-            dialect = new H2Dialect();
-        } else if("mysql".equalsIgnoreCase(database)) {
-            dialect = new MySQLDialect();
-        } else if("postgres".equalsIgnoreCase(database)) {
-            dialect = new PostgreSQLDialect();
-        } else
-            throw new IllegalStateException("database type "+database+" currently not supported!");
-        String jdbcUrl = configurationService.getStringConfiguration("database.url");
-        String dbUser  = configurationService.getStringConfiguration("database.user");
-        String dbPass  = configurationService.getStringConfiguration("database.password");
-
-        store = new KiWiStore("lmf", jdbcUrl, dbUser, dbPass, dialect, configurationService.getDefaultContext(), configurationService.getInferredContext());
-
-        tsail = new KiWiTransactionalSail(store);
-
-        log.info("initialising repository plugins ...");
-
-        // wrap all stackable transactional sails
-        TransactionalSail transactionalSail = tsail;
-        for(TransactionalSailProvider provider : transactionalSailProviders) {
-            if(provider.isEnabled()) {
-                log.info("- transaction plugin: {}",provider.getName());
-                transactionalSail = provider.createSail(transactionalSail);
-            } else {
-                log.info("- transaction plugin: {} (DISABLED)", provider.getName());
+            String database = configurationService.getStringConfiguration("database.type");
+            KiWiDialect dialect;
+            if("h2".equalsIgnoreCase(database)) {
+                dialect = new H2Dialect();
+            } else if("mysql".equalsIgnoreCase(database)) {
+                dialect = new MySQLDialect();
+            } else if("postgres".equalsIgnoreCase(database)) {
+                dialect = new PostgreSQLDialect();
+            } else
+                throw new IllegalStateException("database type "+database+" currently not supported!");
+            String jdbcUrl = configurationService.getStringConfiguration("database.url");
+            String dbUser  = configurationService.getStringConfiguration("database.user");
+            String dbPass  = configurationService.getStringConfiguration("database.password");
+            boolean batchCommit = configurationService.getBooleanConfiguration("database.batchcommit", true);
+
+            KiWiConfiguration configuration = new KiWiConfiguration("lmf", jdbcUrl, dbUser, dbPass, dialect, configurationService.getDefaultContext(), configurationService.getInferredContext());
+            configuration.setQueryLoggingEnabled(configurationService.getBooleanConfiguration("database.debug.slowqueries",false));
+            configuration.setBatchCommit(batchCommit);
+            configuration.setBatchSize(configurationService.getIntConfiguration("database.batchsize",10000));
+            configuration.setMemorySequences(configurationService.getBooleanConfiguration("database.memsequences",true));
+
+            store = new KiWiStore(configuration);
+
+            tsail = new KiWiTransactionalSail(store);
+
+            log.info("initialising repository plugins ...");
+
+            // wrap all stackable transactional sails
+            TransactionalSail transactionalSail = tsail;
+            for(TransactionalSailProvider provider : transactionalSailProviders) {
+                if(provider.isEnabled()) {
+                    log.info("- transaction plugin: {}",provider.getName());
+                    transactionalSail = provider.createSail(transactionalSail);
+                } else {
+                    log.info("- transaction plugin: {} (DISABLED)", provider.getName());
+                }
             }
-        }
 
-        // wrap all stackable notifying sails
-        NotifyingSail notifyingSail = transactionalSail;
-        for(NotifyingSailProvider provider : notifyingSailProviders) {
-            if(provider.isEnabled()) {
-                log.info("- notifying plugin: {}",provider.getName());
-                notifyingSail = provider.createSail(notifyingSail);
-            } else {
-                log.info("- notifying plugin: {} (DISABLED)", provider.getName());
+            // wrap all stackable notifying sails
+            NotifyingSail notifyingSail = transactionalSail;
+            for(NotifyingSailProvider provider : notifyingSailProviders) {
+                if(provider.isEnabled()) {
+                    log.info("- notifying plugin: {}",provider.getName());
+                    notifyingSail = provider.createSail(notifyingSail);
+                } else {
+                    log.info("- notifying plugin: {} (DISABLED)", provider.getName());
+                }
             }
-        }
 
-        // wrap all standard sails
-        Sail standardSail = notifyingSail;
-        for(StandardSailProvider provider : standardSailProviders) {
-            if(provider.isEnabled()) {
-                log.info("- standard plugin: {}",provider.getName());
-                standardSail = provider.createSail(standardSail);
-            } else {
-                log.info("- standard plugin: {} (DISABLED)", provider.getName());
+            // wrap all standard sails
+            Sail standardSail = notifyingSail;
+            for(StandardSailProvider provider : standardSailProviders) {
+                if(provider.isEnabled()) {
+                    log.info("- standard plugin: {}",provider.getName());
+                    standardSail = provider.createSail(standardSail);
+                } else {
+                    log.info("- standard plugin: {} (DISABLED)", provider.getName());
+                }
             }
-        }
 
-        // the CDI events should be triggered once all internal events have been handled, so register the transaction listener last
-        tsail.addTransactionListener(new LMFTransactionEventProxy());
+            // the CDI events should be triggered once all internal events have been handled, so register the transaction listener last
+            tsail.addTransactionListener(new LMFTransactionEventProxy());
 
-        repository = new SailRepository(standardSail);
+            repository = new SailRepository(standardSail);
 
-        try {
-            repository.initialize();
-        } catch (RepositoryException e) {
-            log.error("error while initialising Apache Marmotta Sesame repository",e);
+            try {
+                repository.initialize();
+            } catch (RepositoryException e) {
+                log.error("error while initialising Apache Marmotta Sesame repository",e);
+            }
+        } finally {
+            restartLock.writeLock().unlock();
         }
     }
 
@@ -199,14 +217,33 @@ public class SesameServiceImpl implements SesameService {
     @Override
     @PreDestroy
     public synchronized void shutdown() {
-        if(repository != null) {
-            log.info("Apache Marmotta Sesame Repository Service shutting down ...");
-            try {
-                repository.shutDown();
-            } catch (RepositoryException e) {
-                log.error("error while shutting down Apache Marmotta Sesame repository",e);
+        restartLock.writeLock().lock();
+        try {
+            if(repository != null) {
+                log.info("Apache Marmotta Sesame Repository Service shutting down ...");
+                try {
+                    repository.shutDown();
+                } catch (RepositoryException e) {
+                    log.error("error while shutting down Apache Marmotta Sesame repository",e);
+                }
+                repository = null;
             }
-            repository = null;
+        } finally {
+            restartLock.writeLock().unlock();
+        }
+    }
+
+    /**
+     * Restart the Sesame Service.
+     */
+    @Override
+    public void restart() {
+        restartLock.writeLock().lock();
+        try {
+            shutdown();
+            initialise();
+        } finally {
+            restartLock.writeLock().unlock();
         }
     }
 
@@ -245,9 +282,15 @@ public class SesameServiceImpl implements SesameService {
     @Override
     @Produces
     public RepositoryConnection getConnection() throws RepositoryException {
+        restartLock.readLock().lock();
         RepositoryConnection connection = repository.getConnection();
-        // connection.setAutoCommit(false);
-        return connection;
+        return new RepositoryConnectionWrapper(repository,connection) {
+            @Override
+            public void close() throws RepositoryException {
+                super.close();
+                restartLock.readLock().unlock();
+            }
+        };
     }
 
     /**
@@ -261,6 +304,17 @@ public class SesameServiceImpl implements SesameService {
         return repository.getValueFactory();
     }
 
+    /**
+     * Run the triple store garbage collector manually and clean up unreferenced nodes and triples.
+     * @throws SailException
+     */
+    @Override
+    public void garbageCollect() throws SailException {
+        if(store != null) {
+            store.garbageCollect();
+        }
+    }
+
     private class LMFTransactionEventProxy implements TransactionListener {
 
         /**

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/services/user/UserServiceImpl.java
----------------------------------------------------------------------
diff --git a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/services/user/UserServiceImpl.java b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/services/user/UserServiceImpl.java
index ace5c2c..6fcd12f 100644
--- a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/services/user/UserServiceImpl.java
+++ b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/services/user/UserServiceImpl.java
@@ -271,29 +271,32 @@ public class UserServiceImpl implements UserService {
 
                 try {
                     RepositoryConnection conn = sesameService.getConnection();
-
-                    URI webId = conn.getValueFactory().createURI(webId_str);
-
-                    log.info("creating user with webId: {} ", webId.stringValue());
-
-                    if (!login.equals(ANONYMOUS_LOGIN) && !login.equals(ADMIN_LOGIN)) {
-                        MarmottaUser u = FacadingFactory.createFacading(conn).createFacade(webId, MarmottaUser.class);
-                        u.setFirstName(firstName);
-                        u.setLastName(lastName);
-                        u.setNick(login);
-                    }
-
-                    if(login.equals(ANONYMOUS_LOGIN)) {
-                        anonUser = webId;
-                    }
-                    if(login.equals(ADMIN_LOGIN)) {
-                        adminUser = webId;
+                    try {
+                        conn.begin();
+                        URI webId = conn.getValueFactory().createURI(webId_str);
+
+                        log.info("creating user with webId: {} ", webId.stringValue());
+
+                        if (!login.equals(ANONYMOUS_LOGIN) && !login.equals(ADMIN_LOGIN)) {
+                            MarmottaUser u = FacadingFactory.createFacading(conn).createFacade(webId, MarmottaUser.class);
+                            u.setFirstName(firstName);
+                            u.setLastName(lastName);
+                            u.setNick(login);
+                        }
+
+                        if(login.equals(ANONYMOUS_LOGIN)) {
+                            anonUser = webId;
+                        }
+                        if(login.equals(ADMIN_LOGIN)) {
+                            adminUser = webId;
+                        }
+
+                        conn.commit();
+                        
+                        return webId;
+                    } finally {
+                        conn.close();
                     }
-
-                    conn.commit();
-                    conn.close();
-
-                    return webId;
                 } catch(RepositoryException ex) {
                     handleRepositoryException(ex);
                     return null;

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/servlet/MarmottaOptionsFilter.java
----------------------------------------------------------------------
diff --git a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/servlet/MarmottaOptionsFilter.java b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/servlet/MarmottaOptionsFilter.java
index e81eb1b..d14209e 100644
--- a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/servlet/MarmottaOptionsFilter.java
+++ b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/servlet/MarmottaOptionsFilter.java
@@ -65,7 +65,7 @@ public class MarmottaOptionsFilter implements Filter {
      */
     @Override
     public void init(FilterConfig filterConfig) throws ServletException {
-        ResteasyProviderFactory.getInstance().addExceptionMapper(new OptionsMapper());
+        ResteasyProviderFactory.getInstance().registerProviderInstance(new OptionsMapper());
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/servlet/MarmottaPostStartupFilter.java
----------------------------------------------------------------------
diff --git a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/servlet/MarmottaPostStartupFilter.java b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/servlet/MarmottaPostStartupFilter.java
index 6c27bb9..b7095a5 100644
--- a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/servlet/MarmottaPostStartupFilter.java
+++ b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/servlet/MarmottaPostStartupFilter.java
@@ -30,10 +30,8 @@ import javax.servlet.ServletRequest;
 import javax.servlet.ServletResponse;
 
 import org.apache.marmotta.platform.core.api.config.ConfigurationService;
-import org.apache.marmotta.platform.core.api.user.UserService;
 import org.apache.marmotta.platform.core.events.SystemStartupEvent;
 import org.apache.marmotta.platform.core.model.module.ModuleConfiguration;
-
 import org.slf4j.Logger;
 
 /**
@@ -50,9 +48,6 @@ public class MarmottaPostStartupFilter implements Filter {
     private ConfigurationService configurationService;
 
     @Inject
-    private UserService userService;
-
-    @Inject
     private ModuleConfiguration moduleConfiguration;
 
     @Inject @Any

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/servlet/MarmottaPreStartupListener.java
----------------------------------------------------------------------
diff --git a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/servlet/MarmottaPreStartupListener.java b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/servlet/MarmottaPreStartupListener.java
index 9487a1e..7124578 100644
--- a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/servlet/MarmottaPreStartupListener.java
+++ b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/servlet/MarmottaPreStartupListener.java
@@ -17,8 +17,13 @@
  */
 package org.apache.marmotta.platform.core.servlet;
 
+import org.apache.commons.configuration.ConfigurationException;
+import org.apache.commons.configuration.FileConfiguration;
+import org.apache.commons.configuration.PropertiesConfiguration;
 import org.apache.marmotta.platform.core.startup.MarmottaStartupService;
 import org.apache.marmotta.platform.core.util.CDIContext;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 import javax.servlet.ServletContextEvent;
 import javax.servlet.ServletContextListener;
@@ -29,6 +34,8 @@ import javax.servlet.ServletContextListener;
  */
 public class MarmottaPreStartupListener implements ServletContextListener {
 
+    private static Logger log = LoggerFactory.getLogger(MarmottaPreStartupListener.class);
+
     private MarmottaStartupService lmfStartupService;
 
     /**
@@ -45,7 +52,19 @@ public class MarmottaPreStartupListener implements ServletContextListener {
             lmfStartupService = CDIContext.getInstance(MarmottaStartupService.class);
         }
 
-        lmfStartupService.startupConfiguration(null,null,sce.getServletContext());
+        // we check for the presence of the configuration.override init parameter; if it exists, we load this
+        // configuration file and pass it as configuration override to the startup
+        PropertiesConfiguration override = null;
+
+        if(sce.getServletContext().getInitParameter("configuration.override") != null) {
+            try {
+                override = new PropertiesConfiguration(sce.getServletContext().getInitParameter("configuration.override"));
+            } catch (ConfigurationException e) {
+                log.warn("could not load configuration override file from {}", sce.getServletContext().getInitParameter("configuration.override"));
+            }
+        }
+
+        lmfStartupService.startupConfiguration(null,override,sce.getServletContext());
 
     }
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/startup/MarmottaStartupService.java
----------------------------------------------------------------------
diff --git a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/startup/MarmottaStartupService.java b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/startup/MarmottaStartupService.java
index 612ca3d..f0b4ca5 100644
--- a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/startup/MarmottaStartupService.java
+++ b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/startup/MarmottaStartupService.java
@@ -40,7 +40,7 @@ import org.apache.marmotta.platform.core.model.module.ModuleConfiguration;
 import org.apache.marmotta.platform.core.util.CDIContext;
 
 import org.apache.commons.configuration.Configuration;
-import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang3.StringUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -250,7 +250,10 @@ public class MarmottaStartupService {
 
             hostStarted = true;
 
+            configurationService.setInitialising(false);
+
             startupEvent.fire(new SystemStartupEvent());
+            
         } finally {
             lock.unlock();
         }
@@ -261,4 +264,12 @@ public class MarmottaStartupService {
         log.info("Apache Marmotta Core shutting down ...");
     }
 
+    public boolean isConfigurationStarted() {
+        return configurationStarted;
+    }
+
+    public boolean isHostStarted() {
+        return hostStarted;
+    }
+    
 }

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/util/WebServiceUtil.java
----------------------------------------------------------------------
diff --git a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/util/WebServiceUtil.java b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/util/WebServiceUtil.java
index a484cf9..f39a4b0 100644
--- a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/util/WebServiceUtil.java
+++ b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/util/WebServiceUtil.java
@@ -17,7 +17,7 @@
  */
 package org.apache.marmotta.platform.core.util;
 
-import org.apache.commons.lang.exception.ExceptionUtils;
+import org.apache.commons.lang3.exception.ExceptionUtils;
 import org.codehaus.jackson.map.ObjectMapper;
 
 import java.io.IOException;

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/webservices/config/ConfigurationWebService.java
----------------------------------------------------------------------
diff --git a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/webservices/config/ConfigurationWebService.java b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/webservices/config/ConfigurationWebService.java
index 464132e..1da3836 100644
--- a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/webservices/config/ConfigurationWebService.java
+++ b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/webservices/config/ConfigurationWebService.java
@@ -121,7 +121,7 @@ public class ConfigurationWebService {
         ObjectMapper mapper = new ObjectMapper();
         try {
             //log.info(getContentData(request.getReader()));
-            Map<String,String> values = mapper.readValue(request.getInputStream(), new TypeReference<HashMap<String,String>>(){});
+            Map<String,Object> values = mapper.readValue(request.getInputStream(), new TypeReference<HashMap<String,Object>>(){});
             configurationService.setConfigurations(values);
         } catch (IOException e) {
             return Response.serverError().build();

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/webservices/io/ImportWebService.java
----------------------------------------------------------------------
diff --git a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/webservices/io/ImportWebService.java b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/webservices/io/ImportWebService.java
index 26ca893..9b0b36d 100644
--- a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/webservices/io/ImportWebService.java
+++ b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/webservices/io/ImportWebService.java
@@ -272,6 +272,7 @@ public class ImportWebService {
     }
 
     protected static class Status {
+    	
         boolean isRunning;
         String status;
         String message;
@@ -307,6 +308,7 @@ public class ImportWebService {
         public void setStatus(String status) {
             this.status = status;
         }
+        
     }
 
 }

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/webservices/prefix/PrefixWebService.java
----------------------------------------------------------------------
diff --git a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/webservices/prefix/PrefixWebService.java b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/webservices/prefix/PrefixWebService.java
index 7c94692..740d53d 100644
--- a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/webservices/prefix/PrefixWebService.java
+++ b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/webservices/prefix/PrefixWebService.java
@@ -18,12 +18,13 @@
 package org.apache.marmotta.platform.core.webservices.prefix;
 
 import org.apache.marmotta.platform.core.api.prefix.PrefixService;
-import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang3.StringUtils;
 import org.slf4j.Logger;
 
 import javax.enterprise.context.ApplicationScoped;
 import javax.inject.Inject;
 import javax.validation.constraints.NotNull;
+import javax.ws.rs.DELETE;
 import javax.ws.rs.GET;
 import javax.ws.rs.POST;
 import javax.ws.rs.Path;
@@ -31,6 +32,7 @@ import javax.ws.rs.PathParam;
 import javax.ws.rs.Produces;
 import javax.ws.rs.QueryParam;
 import javax.ws.rs.core.Response;
+import javax.ws.rs.core.Response.Status;
 
 import java.net.URISyntaxException;
 import java.util.HashMap;
@@ -85,6 +87,22 @@ public class PrefixWebService {
             return Response.status(Response.Status.NOT_FOUND).entity("prefix " + prefix + " mapping not found").build();
         }
     }
+    
+    /**
+     * Removes a prefix
+     * 
+     * @param prefix prefix
+     * @return Response with the result of the operation
+     */
+    @DELETE
+    @Path("/" + PREFIX_PATTERN)
+    public Response deleteMapping(@PathParam("prefix") String prefix) {
+        if (prefixService.remove(prefix)) {
+            return Response.status(Status.NO_CONTENT).build();
+        } else {
+            return Response.status(Response.Status.NOT_FOUND).entity("prefix " + prefix + " mapping not found").build();
+        }
+    }    
 
     /**
      * Add new mapping

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/webservices/resource/InspectionWebService.java
----------------------------------------------------------------------
diff --git a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/webservices/resource/InspectionWebService.java b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/webservices/resource/InspectionWebService.java
index 56a0c98..e80a8c3 100644
--- a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/webservices/resource/InspectionWebService.java
+++ b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/webservices/resource/InspectionWebService.java
@@ -174,7 +174,7 @@ public class InspectionWebService {
 
     private List<TriplePoJo> buildResultList(RepositoryConnection conn, URI s, URI p, URI o, URI c, long start, int limit) throws RepositoryException {
         List<TriplePoJo> result = new ArrayList<InspectionWebService.TriplePoJo>();
-        RepositoryResult<Statement> triples = conn.getStatements(s,p,o,true,c);
+        RepositoryResult<Statement> triples = c != null ? conn.getStatements(s,p,o,true,c) : conn.getStatements(s,p,o,true);
         // skip until start
         for(int i = 0; i<start && triples.hasNext(); i++) {
             triples.next();

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/webservices/resource/MetaWebService.java
----------------------------------------------------------------------
diff --git a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/webservices/resource/MetaWebService.java b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/webservices/resource/MetaWebService.java
index 022fb31..27785c6 100644
--- a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/webservices/resource/MetaWebService.java
+++ b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/webservices/resource/MetaWebService.java
@@ -40,8 +40,10 @@ import javax.ws.rs.core.Response;
 import javax.ws.rs.core.Response.Status;
 import javax.ws.rs.core.StreamingOutput;
 
+import org.apache.commons.lang3.StringUtils;
 import org.apache.marmotta.commons.collections.CollectionUtils;
 import org.apache.marmotta.commons.http.ETagGenerator;
+import org.apache.marmotta.commons.http.UriUtil;
 import org.apache.marmotta.commons.sesame.repository.ResourceUtils;
 import org.apache.marmotta.platform.core.api.config.ConfigurationService;
 import org.apache.marmotta.platform.core.api.content.ContentService;
@@ -52,7 +54,6 @@ import org.apache.marmotta.platform.core.api.triplestore.SesameService;
 import org.apache.marmotta.platform.core.services.sesame.KiWiSesameUtil;
 import org.apache.marmotta.platform.core.services.sesame.ResourceSubjectMetadata;
 import org.openrdf.model.Resource;
-import org.openrdf.model.URI;
 import org.openrdf.repository.RepositoryConnection;
 import org.openrdf.repository.RepositoryException;
 import org.openrdf.repository.event.InterceptingRepositoryConnection;
@@ -112,8 +113,14 @@ public class MetaWebService {
      */
     @GET
     @Path(ResourceWebService.MIME_PATTERN)
-    public Response getMetaRemote(@QueryParam("uri") @NotNull String uri, @PathParam("mimetype") String mimetype) throws UnsupportedEncodingException {
-        return getMeta(URLDecoder.decode(uri, "utf-8"), mimetype);
+    public Response getMetaRemote(@QueryParam("uri") String uri, @QueryParam("genid") String genid, @PathParam("mimetype") String mimetype) throws UnsupportedEncodingException {
+    	if (StringUtils.isNotBlank(uri)) {
+    		return getMeta(URLDecoder.decode(uri, "utf-8"), mimetype);
+    	} else if (StringUtils.isNotBlank(genid)) {
+    		return getMeta(URLDecoder.decode(genid, "utf-8"), mimetype);
+    	} else {
+    		return ResourceWebServiceHelper.buildErrorPage(uri, configurationService.getBaseUri(), Status.BAD_REQUEST, "Invalid Request", configurationService, templatingService);
+    	}
     }
 
     /**
@@ -227,9 +234,8 @@ public class MetaWebService {
     /**
      * Delete metadata of local resource with given uuid
      *
-     * @param uuid
-     *            , a unique identifier (must not contain url specific
-     *            characters like /,# etc.)
+     * @param uuid a unique identifier (must not contain url specific
+     *             characters like /,# etc.)
      * @return HTTP response (success or error)
      * @HTTP 200 resource content deleted
      * @HTTP 404 resource or resource metadata not found
@@ -241,19 +247,24 @@ public class MetaWebService {
         return deleteMetaRemote(uri);
     }
 
-    private Response getMeta(String uri, String mimetype) throws UnsupportedEncodingException {
+    private Response getMeta(String resource, String mimetype) throws UnsupportedEncodingException {
         try {
             RepositoryConnection conn = sesameService.getConnection();
-            
-            if (!ResourceUtils.existsResource(conn, uri)) {
-            	return ResourceWebServiceHelper.buildErrorPage(uri, configurationService.getBaseUri(), Response.Status.NOT_FOUND, "the requested resource could not be found in LMF right now, but may be available again in the future", configurationService, templatingService);
-            }
 
             try {
                 conn.begin();
-                // FIXME String appendix = uuid == null ? "?uri=" + URLEncoder.encode(uri, "utf-8") :
-                // "/" + uuid;
-                URI resource = conn.getValueFactory().createURI(uri);
+                
+                Resource r = null;
+            	if (UriUtil.validate(resource)) {
+                    r = ResourceUtils.getUriResource(conn, resource);
+            	} else {
+            		r = ResourceUtils.getAnonResource(conn, resource);
+            	}
+            	
+                if (r == null || !ResourceUtils.isUsed(conn, r)) {
+                	return ResourceWebServiceHelper.buildErrorPage(resource, configurationService.getBaseUri(), Response.Status.NOT_FOUND, "the requested resource could not be found in LMF right now, but may be available again in the future", configurationService, templatingService);
+                }
+            	
                 // create parser
                 final RDFFormat serializer = kiWiIOService.getSerializer(mimetype);
                 if (serializer == null) {
@@ -262,9 +273,9 @@ public class MetaWebService {
                     return response;
                 }
 
-                if(resource != null) {
+                if(r != null) {
 
-                    final Resource subject = resource;
+                    final Resource subject = r;
 
                     StreamingOutput entity = new StreamingOutput() {
                         @Override
@@ -290,15 +301,15 @@ public class MetaWebService {
                     };
 
                     // build response
-                    Response response = Response.ok(entity).lastModified(KiWiSesameUtil.lastModified(resource, conn)).build();
-                    response.getMetadata().add("ETag", "W/\"" + ETagGenerator.getWeakETag(conn, resource) + "\"");
+                    Response response = Response.ok(entity).lastModified(KiWiSesameUtil.lastModified(r, conn)).build();
+                    response.getMetadata().add("ETag", "W/\"" + ETagGenerator.getWeakETag(conn, r) + "\"");
                     
                     if (!mimetype.contains("html")) { // then create a proper filename
 	                    String[] components;
-	                    if (uri.contains("#")) {
-	                    	components = uri.split("#");	                    	
+	                    if (resource.contains("#")) {
+	                    	components = resource.split("#");	                    	
 	                    } else {
-	                    	components = uri.split("/");
+	                    	components = resource.split("/");
 	                    }
 	                    final String fileName = components[components.length-1] + "." + serializer.getDefaultFileExtension();   
 	                    response.getMetadata().add("Content-Disposition", "attachment; filename=\""+fileName+"\"");
@@ -315,7 +326,7 @@ public class MetaWebService {
                     List<String> links = new LinkedList<String>();
 
                     // build the link to the human readable content of this resource (if it exists)
-                    String contentLink = ResourceWebServiceHelper.buildContentLink(resource, contentService.getContentType(resource), configurationService);
+                    String contentLink = ResourceWebServiceHelper.buildContentLink(r, contentService.getContentType(r), configurationService);
                     if(!"".equals(contentLink)) {
                         links.add(contentLink);
                     }
@@ -325,7 +336,7 @@ public class MetaWebService {
                     }
                     return response;
                 } else {
-                    return Response.status(Response.Status.NOT_FOUND).entity("resource with URI "+uri+" does not exist").build();
+                    return Response.status(Response.Status.NOT_FOUND).entity("resource with URI "+resource+" does not exist").build();
                 }
             } finally {
                 if (conn.isOpen()) {
@@ -334,7 +345,7 @@ public class MetaWebService {
                 }
             }
         } catch (RepositoryException e) {
-            return ResourceWebServiceHelper.buildErrorPage(uri, configurationService.getBaseUri(), Status.INTERNAL_SERVER_ERROR, e.getMessage(), configurationService, templatingService);
+            return ResourceWebServiceHelper.buildErrorPage(resource, configurationService.getBaseUri(), Status.INTERNAL_SERVER_ERROR, e.getMessage(), configurationService, templatingService);
         }
     }
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/webservices/resource/ResourceWebService.java
----------------------------------------------------------------------
diff --git a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/webservices/resource/ResourceWebService.java b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/webservices/resource/ResourceWebService.java
index 1ad5512..f2e76eb 100644
--- a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/webservices/resource/ResourceWebService.java
+++ b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/webservices/resource/ResourceWebService.java
@@ -43,10 +43,11 @@ import javax.ws.rs.core.Response;
 import javax.ws.rs.core.Response.ResponseBuilder;
 import javax.ws.rs.core.Response.Status;
 
-import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang3.StringUtils;
 import org.apache.marmotta.commons.http.ContentType;
 import org.apache.marmotta.commons.http.ETagGenerator;
 import org.apache.marmotta.commons.http.LMFHttpUtils;
+import org.apache.marmotta.commons.http.UriUtil;
 import org.apache.marmotta.commons.sesame.repository.ResourceUtils;
 import org.apache.marmotta.platform.core.api.config.ConfigurationService;
 import org.apache.marmotta.platform.core.api.content.ContentService;
@@ -336,37 +337,55 @@ public class ResourceWebService {
      *                 (content and meta)
      */
     @GET
-    public Response getRemote(@QueryParam("uri") String uri, @QueryParam("format") String format, @HeaderParam("Accept") String types)
+    public Response getRemote(@QueryParam("uri") String uri, @QueryParam("genid") String genid, @QueryParam("format") String format, @HeaderParam("Accept") String types)
             throws UnsupportedEncodingException {
         try {
-            if (uri != null) {
+            if (StringUtils.isNotBlank(uri)) {
                 if (format != null && StringUtils.isNotBlank(format)) {
                     types = format;
                 }
                 //TODO: add 'If-None-Match' support, sending a '304 Not Modified' when the ETag matches
                 return get(uri, types);
-            } else
-                return Response.status(400).entity("uri may not be null").build();
+            } else if (StringUtils.isNotBlank(genid)) {
+                if (format != null && StringUtils.isNotBlank(format)) {
+                    types = format;
+                }
+                //TODO: add 'If-None-Match' support, sending a '304 Not Modified' when the ETag matches
+                return get(genid, types);
+            } else {
+                return Response.status(400).entity("resource not identified").build();
+            }
         } catch (URISyntaxException e) {
             return Response.serverError().entity(e.getMessage()).build();
         }
     }
 
-    private Response get(String uri, String types) throws URISyntaxException, UnsupportedEncodingException {
+    private Response get(String resource, String types) throws URISyntaxException, UnsupportedEncodingException {
         try {
 
             RepositoryConnection conn = sesameService.getConnection();
             try {
                 conn.begin();
-                URI resource;
-                try {
-                	resource = ResourceUtils.getUriResource(conn, uri);
-                } catch (Exception e) {
-                	log.error("Error retrieving the URI <{}>: {}", uri, e.getMessage());
-                	log.debug("So redirecting directly to it...");
-                	return Response.seeOther(new java.net.URI(uri)).build();
-                }
-                if (resource == null) return ResourceWebServiceHelper.buildErrorPage(uri, configurationService.getBaseUri(), Response.Status.NOT_FOUND, "the requested resource could not be found in LMF right now, but may be available again in the future", configurationService, templatingService);
+                Resource r = null;
+            	if (UriUtil.validate(resource)) {
+                    try {
+                    	if(ResourceUtils.isSubject(conn, resource)) {  //tests if a resource is used as subject
+                            r = ResourceUtils.getUriResource(conn, resource);
+                        }
+                    } catch (Exception e) {
+                    	log.error("Error retrieving the resource <{}>: {}", resource, e.getMessage());
+                    	log.debug("So redirecting directly to it...");
+                    	return Response.seeOther(new java.net.URI(resource)).build();
+                    }
+            	} else {
+            		try {
+            			r = ResourceUtils.getAnonResource(conn, resource);
+	                } catch (Exception e) {
+	                	log.error("Error retrieving the blank node <{}>: {}", resource, e.getMessage());
+	                	return Response.status(Status.NOT_FOUND).entity("blank node id "  + resource + " not found").build();
+	                }
+            	}
+                if (r == null) return ResourceWebServiceHelper.buildErrorPage(resource, configurationService.getBaseUri(), Response.Status.NOT_FOUND, "the requested resource could not be found in LMF right now, but may be available again in the future", configurationService, templatingService);
                 // FIXME String appendix = uuid == null ? "?uri=" + URLEncoder.encode(uri, "utf-8") :
                 // "/" + uuid;
 
@@ -374,7 +393,7 @@ public class ResourceWebService {
                 for(ContentType t : offeredTypes) {
                 	t.setParameter("rel", "meta");
                 }
-                String contentmime = contentService.getContentType(resource);
+                String contentmime = contentService.getContentType(r);
                 if(contentmime != null) {
                 	ContentType tContent = LMFHttpUtils.parseContentType(contentmime);
                 	tContent.setParameter("rel", "content");
@@ -391,9 +410,9 @@ public class ResourceWebService {
                 log.debug("identified best type: {}",bestType);
 
                 if(bestType != null) {
-                    Response response = buildGetResponse(resource, bestType);
-                    response.getMetadata().add("Last-Modified", KiWiSesameUtil.lastModified(resource, conn));
-                    response.getMetadata().add("ETag", "W/\"" + ETagGenerator.getWeakETag(conn, resource) + "\"");
+                    Response response = buildGetResponse(r, bestType);
+                    response.getMetadata().add("Last-Modified", KiWiSesameUtil.lastModified(r, conn));
+                    response.getMetadata().add("ETag", "W/\"" + ETagGenerator.getWeakETag(conn, r) + "\"");
                     return response;
                 } else {
                     return build406(acceptedTypes, offeredTypes);
@@ -608,7 +627,7 @@ public class ResourceWebService {
         return deleteResourceRemote(uri);
     }
 
-    private Response buildGetResponse(URI resource, ContentType type) {
+    private Response buildGetResponse(Resource resource, ContentType type) {
         try {
 
             return Response

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/webservices/resource/ResourceWebServiceHelper.java
----------------------------------------------------------------------
diff --git a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/webservices/resource/ResourceWebServiceHelper.java b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/webservices/resource/ResourceWebServiceHelper.java
index 1dd21cf..15abd70 100644
--- a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/webservices/resource/ResourceWebServiceHelper.java
+++ b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/webservices/resource/ResourceWebServiceHelper.java
@@ -20,10 +20,12 @@ package org.apache.marmotta.platform.core.webservices.resource;
 import org.apache.marmotta.platform.core.api.config.ConfigurationService;
 import org.apache.marmotta.platform.core.api.templating.TemplatingService;
 import org.apache.marmotta.commons.http.ContentType;
+import org.openrdf.model.Resource;
 import org.openrdf.model.URI;
 
 import javax.ws.rs.core.Response;
 import javax.ws.rs.core.Response.Status;
+
 import java.io.UnsupportedEncodingException;
 import java.net.URLEncoder;
 import java.util.HashMap;
@@ -78,7 +80,7 @@ public class ResourceWebServiceHelper {
         return buildContentLink(resource, mime, configurationService);
     }
 
-    public static String buildContentLink(URI resource, String mime, ConfigurationService configurationService) {
+    public static String buildContentLink(Resource resource, String mime, ConfigurationService configurationService) {
         //TODO: test if there is content
         StringBuffer b = new StringBuffer();
         if (mime != null) {
@@ -124,25 +126,23 @@ public class ResourceWebServiceHelper {
                 cType.getMime(), configurationService);
     }
 
-    public static String buildResourceLink(URI resource, String rel, String mime, ConfigurationService configurationService) {
-        final String src = configurationService.getServerUri(), base = configurationService
-                .getBaseUri();
-
-        if (src.equals(base)
-                && resource.stringValue().startsWith(base + ConfigurationService.RESOURCE_PATH + "/")) {
+    public static String buildResourceLink(Resource resource, String rel, String mime, ConfigurationService configurationService) {
+        final String src = configurationService.getServerUri();
+        final String base = configurationService.getBaseUri();
+        if (src.equals(base) && resource.stringValue().startsWith(base + ConfigurationService.RESOURCE_PATH + "/")) {
             final String uuid;
-            uuid = resource.stringValue().substring(
-                    (base + "resource/").length());
+            uuid = resource.stringValue().substring((base + "resource/").length());
             return String.format("%s%s/%s/%s", base, rel, mime, uuid);
-
         } else {
-            try {
-                return String.format("%s%s/%s?uri=%s", src, rel, mime,
-                        URLEncoder.encode(resource.stringValue(), ResourceWebService.CHARSET));
-            } catch (UnsupportedEncodingException e) {
-                return String.format("%s%s/%s?uri=%s", src, rel, mime,
-                        resource.stringValue());
-            }
+	    	if (resource instanceof URI) {
+	            try {  
+	                return String.format("%s%s/%s?uri=%s", src, rel, mime, URLEncoder.encode(resource.stringValue(), ResourceWebService.CHARSET));
+	            } catch (UnsupportedEncodingException e) {
+	                return String.format("%s%s/%s?uri=%s", src, rel, mime, resource.stringValue());
+	            }                    
+	    	} else {
+	    		return String.format("%s%s/%s?genid=%s", src, rel, mime, resource.stringValue());
+	    	}      
         }
     }
     

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/webservices/system/SystemWebService.java
----------------------------------------------------------------------
diff --git a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/webservices/system/SystemWebService.java b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/webservices/system/SystemWebService.java
index c5c51ce..7c0dd35 100644
--- a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/webservices/system/SystemWebService.java
+++ b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/webservices/system/SystemWebService.java
@@ -19,6 +19,7 @@ package org.apache.marmotta.platform.core.webservices.system;
 
 import org.apache.marmotta.platform.core.api.config.ConfigurationService;
 import org.apache.marmotta.platform.core.api.triplestore.SesameService;
+import org.apache.marmotta.platform.core.jaxrs.ErrorResponse;
 import org.slf4j.Logger;
 
 import javax.enterprise.context.ApplicationScoped;
@@ -66,11 +67,33 @@ public class SystemWebService {
             return Response.ok().entity("database reinitialised successfully").build();
         } catch(Exception ex) {
             log.error("Error while reinitalising database ...",ex);
-            return Response.status(500).entity("error while reinitialising database").build();
+            return ErrorResponse.errorResponse(Response.Status.INTERNAL_SERVER_ERROR, ex);
         }
     }
 
-	@POST
+    /**
+     * Manually trigger the garbage collector.
+     *
+     * @return ok if successful, 500 if not
+     * @HTTP 200 if garbage collection completed successfully
+     * @HTTP 500 if there was an error while running garbage collection (see log)
+     */
+    @POST
+    @Path("/database/gc")
+    public Response garbageCollector() {
+        log.info("Running triple store garbage collection after admin user request ...");
+        try {
+            sesameService.garbageCollect();
+
+            return Response.ok().entity("garbage collection completed successfully").build();
+        } catch(Exception ex) {
+            log.error("Error while running garbage collection ...",ex);
+            return ErrorResponse.errorResponse(Response.Status.INTERNAL_SERVER_ERROR, ex);
+        }
+    }
+
+
+    @POST
     @Path("/database/ping")
 	public Response pingDatabase(@QueryParam("type")String type,@QueryParam("url")String url,@QueryParam("user")String user,@QueryParam("pwd")String pwd) {
 		if(type==null||url==null||user==null||pwd==null) {
@@ -80,12 +103,12 @@ public class SystemWebService {
 		//get driver
 		String db_driver = configurationService.getStringConfiguration("database."+type+".driver");
 		if(db_driver==null) {
-			return Response.serverError().entity("driver for "+type+" not defined").build();
+			return ErrorResponse.errorResponse(Response.Status.INTERNAL_SERVER_ERROR,"driver for "+type+" not defined");
 		}
 
 		//try if type matches url
 		if(!url.startsWith("jdbc:"+type)) {
-			return Response.serverError().entity("database and url do not match properly").build();
+			return ErrorResponse.errorResponse(Response.Status.INTERNAL_SERVER_ERROR,"database and url do not match properly");
 		}
 
 		//try to connect
@@ -95,9 +118,9 @@ public class SystemWebService {
 			conn.close();
 			return Response.ok().build();
 		} catch (ClassNotFoundException e) {
-			return Response.serverError().entity("Can't load driver " + e).build();
+			return ErrorResponse.errorResponse(Response.Status.INTERNAL_SERVER_ERROR,"Can't load driver ",e);
 		} catch (SQLException e) {
-      		return Response.serverError().entity("Database access failed " + e).build();
+      		return ErrorResponse.errorResponse(Response.Status.INTERNAL_SERVER_ERROR,"Database access failed ",e);
     	}
 	}
 

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/webservices/triplestore/ContextWebService.java
----------------------------------------------------------------------
diff --git a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/webservices/triplestore/ContextWebService.java b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/webservices/triplestore/ContextWebService.java
index 7957ade..9e7e413 100644
--- a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/webservices/triplestore/ContextWebService.java
+++ b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/webservices/triplestore/ContextWebService.java
@@ -44,7 +44,7 @@ import javax.ws.rs.core.Context;
 import javax.ws.rs.core.Response;
 import javax.ws.rs.core.Response.Status;
 
-import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang3.StringUtils;
 import org.apache.marmotta.commons.http.ContentType;
 import org.apache.marmotta.commons.http.LMFHttpUtils;
 import org.apache.marmotta.platform.core.api.config.ConfigurationService;

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/platform/marmotta-core/src/main/resources/META-INF/NOTICE
----------------------------------------------------------------------
diff --git a/platform/marmotta-core/src/main/resources/META-INF/NOTICE b/platform/marmotta-core/src/main/resources/META-INF/NOTICE
index a49305c..8a7975e 100644
--- a/platform/marmotta-core/src/main/resources/META-INF/NOTICE
+++ b/platform/marmotta-core/src/main/resources/META-INF/NOTICE
@@ -6,25 +6,8 @@ The Apache Software Foundation (http://www.apache.org/).
 
 Apache Marmotta, Copyright 2012-2013 The Apache Software Foundation
 
-This product also includes the following third-party components:
+Portions of this software were originally based on the following:
 
-* D3.js, http://d3js.org
-
-  Copyright (c) 2013 Michael Bostock
-
-* Dracula Graph Library, http://www.graphdracula.net
-
-  Copyright (c) 2013 Johann Philipp Strathausen
-
-* strftime, http://hacks.bluesmoon.info/strftime
-
-  Copyright (c) 2008 Philip S Tellis
-
-* jQuery, http://jquery.com
-
-  Copyright (c) 2013 jQuery Foundation
-
-* Sgvizler, http://sgvizler.googlecode.com
-
-  Copyright (c) 2011 Martin G. Skjæveland
+    Copyright 2008-2012 Salzburg Research Forschungsgesellschaft mbH
 
+These have been licensed to the Apache Software Foundation under a software grant.

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/platform/marmotta-core/src/main/resources/config-defaults.properties
----------------------------------------------------------------------
diff --git a/platform/marmotta-core/src/main/resources/config-defaults.properties b/platform/marmotta-core/src/main/resources/config-defaults.properties
index 6a5dcc8..16caabb 100644
--- a/platform/marmotta-core/src/main/resources/config-defaults.properties
+++ b/platform/marmotta-core/src/main/resources/config-defaults.properties
@@ -158,6 +158,21 @@ database.password =
 # the database mode (create, update or validate)
 database.mode =
 
+# report slow queries in the log (not thread safe)
+database.debug.slowqueries = false
+
+
+# turn on batch commits for database transactions (EXPERIMENTAL); if supported by the database backend, this can
+# lead to considerable performance improvements
+database.batchcommit = true
+
+# the maximum size of a batch before it is committed to the database; only applicable if batchcommit is enabled
+database.batchsize = 10000
+
+# turn on in-memory sequences (EXPERIMENTAL); if enabled, sequences are pre-loaded once and then updated in memory
+# and only written back if a transaction commits
+database.memsequences = true
+
 # Hibernate-specific configuration for H2
 database.h2.driver = org.h2.Driver
 database.h2.url = jdbc:h2:/tmp/kiwi/db/kiwi;MVCC=true;DB_CLOSE_ON_EXIT=FALSE;DB_CLOSE_DELAY=10

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/platform/marmotta-core/src/main/resources/config-descriptions.properties
----------------------------------------------------------------------
diff --git a/platform/marmotta-core/src/main/resources/config-descriptions.properties b/platform/marmotta-core/src/main/resources/config-descriptions.properties
index 913ba5b..f0c80c7 100644
--- a/platform/marmotta-core/src/main/resources/config-descriptions.properties
+++ b/platform/marmotta-core/src/main/resources/config-descriptions.properties
@@ -162,6 +162,20 @@ database.password.type = java.lang.String("password")
 database.mode.description = the database mode (create, update, validate or off)
 database.mode.type = java.lang.Enum("create"|"update"|"validate"|"off")
 
+database.debug.slowqueries.description = enable reporting of slow database queries (produces additional overhead and is not thread safe)
+database.debug.slowqueries.type = java.lang.Boolean
+
+database.batchcommit.description = turn on batch commits for database transactions (EXPERIMENTAL); if supported by the \
+  database backend, this can lead to considerable performance improvements
+database.batchcommit.type = java.lang.Boolean
+
+database.batchsize.description = the maximum size of a batch before it is committed to the database; only applicable if \
+  batchcommit is enabled
+database.batchsize.type = java.lang.Integer(10|0|*)
+
+database.memsequences.description = turn on in-memory sequences (EXPERIMENTAL); if enabled, sequences are pre-loaded \
+  once and then updated in memory and only written back if a transaction commits
+database.memsequences.type = java.lang.Boolean
 
 
 ###############################################################################

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/platform/marmotta-core/src/main/resources/kiwi-module.properties
----------------------------------------------------------------------
diff --git a/platform/marmotta-core/src/main/resources/kiwi-module.properties b/platform/marmotta-core/src/main/resources/kiwi-module.properties
index 30703e7..37692bb 100644
--- a/platform/marmotta-core/src/main/resources/kiwi-module.properties
+++ b/platform/marmotta-core/src/main/resources/kiwi-module.properties
@@ -18,6 +18,9 @@
 
 name=Core Services
 
+container=Generic
+container.weight = 10
+
 subtitle = Configure LMF Core
 weight = 10
 
@@ -26,16 +29,35 @@ icon_small = /admin/img/config_small.png
 #do not change!!!
 baseurl=/core
 
-adminpages=/admin/about.html,\
-  /admin/configuration.html,\
-  /admin/tasks.html,\
-  /admin/import.html,\
-  /admin/export.html,\
-  /admin/dataview.html,\
-  /admin/contexts.html,\
-  /admin/prefixes.html,\
-  /admin/system.html,\
-  /admin/database.html,
+adminpage.0.title=About
+adminpage.0.link=/admin/about.html
+
+adminpage.1.title=Configuration
+adminpage.1.link=/admin/configuration.html
+
+adminpage.2.title=Tasks
+adminpage.2.link=/admin/tasks.html
+
+adminpage.3.title=Import
+adminpage.3.link=/admin/import.html
+
+adminpage.4.title=Export
+adminpage.4.link=/admin/export.html
+
+adminpage.5.title=Data Views
+adminpage.5.link=/admin/dataview.html
+
+adminpage.6.title=Context Manager
+adminpage.6.link=/admin/contexts.html
+
+adminpage.7.title=Prefix Manager
+adminpage.7.link=/admin/prefixes.html
+
+adminpage.8.title=System
+adminpage.8.link=/admin/system.html
+
+adminpage.9.title=Database
+adminpage.9.link=/admin/database.html
 
 webservices=org.apache.marmotta.platform.core.webservices.config.ConfigurationWebService,\
   org.apache.marmotta.platform.core.webservices.config.DependenciesWebService,\

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/platform/marmotta-core/src/main/resources/templates/404.ftl
----------------------------------------------------------------------
diff --git a/platform/marmotta-core/src/main/resources/templates/404.ftl b/platform/marmotta-core/src/main/resources/templates/404.ftl
index 7303e60..6cc4715 100644
--- a/platform/marmotta-core/src/main/resources/templates/404.ftl
+++ b/platform/marmotta-core/src/main/resources/templates/404.ftl
@@ -25,7 +25,7 @@
   <head>
     <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
     <title>404 Not Found - Marmotta Linked Data Explorer</title>
-    <script src="${SERVER_URL}core/public/js/lib/jquery-1.7.2.js" type="text/javascript" ></script>
+    <script src="${SERVER_URL}webjars/jquery/1.8.2/jquery.min.js" type="text/javascript" ></script>
     <link href="${SERVER_URL}${DEFAULT_STYLE}style.css" rel="stylesheet" type="text/css" />
     <link href="${SERVER_URL}${DEFAULT_STYLE}rdfhtml.css" rel="stylesheet" type="text/css" />
     <link href="${SERVER_URL}${DEFAULT_STYLE}404.css" rel="stylesheet" type="text/css" />

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/platform/marmotta-core/src/main/resources/templates/admin.ftl
----------------------------------------------------------------------
diff --git a/platform/marmotta-core/src/main/resources/templates/admin.ftl b/platform/marmotta-core/src/main/resources/templates/admin.ftl
index 7d8d7a1..90173ff 100644
--- a/platform/marmotta-core/src/main/resources/templates/admin.ftl
+++ b/platform/marmotta-core/src/main/resources/templates/admin.ftl
@@ -47,7 +47,62 @@
     </#if>
 
     ${HEAD}
+    <style type="text/css">
+        div.menu_heading {
+            color: white;
+            font-weight: bold;
+        }
+        ul.center_submenu {
+            margin:0;
+            padding:0;
+        }
+        ul.center_submenu li {
+            list-style: none;
+            display: list-item;
+            float: left;
+            padding: 5px;
+            margin-right: 4px;
+        }
+        ul.center_submenu li.active {
+            border-top-left-radius: 3px;
+            border-top-right-radius: 3px;
+            background-color: white;
+            border-left: 1px solid #ccc;
+            border-right: 1px solid #ccc;
+            border-top: 1px solid #ccc;
+        }
+        ul.center_submenu a {
+            text-decoration: underline;
+            font-weight: bold;
+            color: #0B61A4;
+        }
 
+        ul.center_submenu li.active a {
+            text-decoration: none;
+        }
+        #content {
+            border-top-left-radius: 0;
+            border-top-right-radius: 3px;
+            border-bottom-right-radius: 3px;
+            border-bottom-left-radius: 3px;
+            border-left: 1px solid #ccc;
+        }
+        #login_logout {
+            float: right;
+            margin-right: 5px;
+            margin-top: -3px;
+            border: 1px solid #aaa;
+            padding: 4px 10px 2px;
+            background-color: white;
+            border-radius: 3px;
+            -webkit-border-radius: 3px;
+            box-shadow: 0px 0px 8px #555;
+        }
+        #login_logout a {
+            color: #0B61A4;
+            font-weight: bold;
+        }
+    </style>
 </head>
 
 <body>
@@ -57,7 +112,6 @@
         <a id="logo" href="${SERVER_URL}" title="${PROJECT}">
             <img src="${SERVER_URL}${LOGO}" alt="${PROJECT} logo" />
         </a>
-        <h1>${CURRENT_MODULE} - ${CURRENT_TITLE}</h1>
         <#if USER_MODULE_IS_ACTIVE>
             <div id="login_logout"></div>
         </#if>
@@ -65,29 +119,49 @@
     <div class="clear"></div>
     <div id="left">
         <ul id="menu">
-            <#list MODULE_MENU as menu>
-            <li
-                <#if menu.properties["active"]>
-                        class="menu_item active"
-                <#else>
-                        class="menu_item"
-                </#if>
-            >
-                <div class="menu_heading"><a href="${menu.submenu[0].properties["path"]}">${menu.properties["title"]}</a></div>
+        <#list MENU["items"] as menu>
+            <li class="menu_item">
+                <div class="menu_heading">${menu.label}</div>
                 <ul class="submenu">
-                <#list menu.submenu as submenu>
-                    <li
-                        <#if submenu.properties["active"]> class="active" </#if>
-                    >
-                    <a href="${submenu.properties["path"]}">${submenu.properties["title"]}</a>
-                    </li>
-                </#list>
+                    <#list menu["items"] as submenu>
+                        <li
+                            <#if submenu["isActive"]> class="menu_item active" </#if>
+                                >
+                            <#if submenu["items"]?has_content>
+                            <a href="${SERVER_URL}${submenu["items"][0]["path"]?substring(1)}">
+                            <#else>
+                            <a href="${SERVER_URL}doc/rest/index.html">
+                            </#if>
+                            <!-- <i class="${submenu["icon"]}"></i>  <!-- TODO icon -->
+                            <span>${submenu["label"]}</span>
+                        </a>
+                        </li>
+                    </#list>
                 </ul>
             </li>
-            </#list>
+        </#list>
+
         </ul>
     </div>
     <div id="center">
+        <ul class="center_submenu">
+        <#list MENU["items"] as menu>
+            <#if menu["isActive"]>
+                <#list menu["items"] as submenu>
+                    <#if submenu["isActive"]>
+                        <#list submenu["items"] as pages>
+                            <li
+                                <#if pages["isActive"]> class="active" </#if>
+                                    >
+                                <a href="${SERVER_URL}${pages["path"]?substring(1)}">${pages["label"]}</a>
+                            </li>
+                        </#list>
+                    </#if>
+                </#list>
+            </#if>
+        </#list>
+        </ul>
+        <div class="clear"></div>
         <div id="content">
         ${CONTENT}
         </div>

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/platform/marmotta-core/src/main/resources/templates/rdfhtml.ftl
----------------------------------------------------------------------
diff --git a/platform/marmotta-core/src/main/resources/templates/rdfhtml.ftl b/platform/marmotta-core/src/main/resources/templates/rdfhtml.ftl
index 1327e5b..45d8e5d 100644
--- a/platform/marmotta-core/src/main/resources/templates/rdfhtml.ftl
+++ b/platform/marmotta-core/src/main/resources/templates/rdfhtml.ftl
@@ -24,10 +24,25 @@
   <title>Resource/s in HTML</title>
   <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
   <meta http-equiv="Default-Style" content="${DEFAULT_STYLE}">
-  <script type="text/javascript" src="${SERVER_URL}core/public/js/lib/jquery-1.7.2.js"></script>
+  <script type="text/javascript" src="${SERVER_URL}webjars/jquery/1.8.2/jquery.min.js"></script>
   <link href="${SERVER_URL}${DEFAULT_STYLE}style.css" rel="stylesheet" type="text/css" />
   <link href="${SERVER_URL}${DEFAULT_STYLE}rdfhtml.css" rel="stylesheet" type="text/css" />
-
+  <#if resources?size = 1>
+  <#if resources[0].uri?has_content>
+  <link rel="alternate" type="application/rdf+xml" href="${SERVER_URL}resource?uri=${resources[0].encoded_uri}&amp;format=application/rdf%2Bxml" /> 
+  <link rel="alternate" type="text/rdf+n3" href="${SERVER_URL}resource?uri=${resources[0].encoded_uri}&amp;format=text/rdf%2Bn3" /> 
+  <link rel="alternate" type="text/turtle" href="${SERVER_URL}resource?uri=${resources[0].encoded_uri}&amp;format=text/turtle" /> 
+  <link rel="alternate" type="application/rdf+json" href="${SERVER_URL}resource?uri=${resources[0].encoded_uri}&amp;format=application/rdf%2Bjson" /> 
+  <link rel="alternate" type="application/ld+json" href="${SERVER_URL}resource?uri=${resources[0].encoded_uri}&amp;format=application/ld%2Bjson" /> 
+  <#else>
+  <link rel="alternate" type="application/rdf+xml" href="${SERVER_URL}resource?genid=${resources[0].encoded_genid}&amp;format=application/rdf%2Bxml" /> 
+  <link rel="alternate" type="text/rdf+n3" href="${SERVER_URL}resource?genid=${resources[0].encoded_genid}&amp;format=text/rdf%2Bn3" /> 
+  <link rel="alternate" type="text/turtle" href="${SERVER_URL}resource?genid=${resources[0].encoded_genid}&amp;format=text/turtle" /> 
+  <link rel="alternate" type="application/rdf+json" href="${SERVER_URL}resource?genid=${resources[0].encoded_genid}&amp;format=application/rdf%2Bjson" /> 
+  <link rel="alternate" type="application/ld+json" href="${SERVER_URL}resource?genid=${resources[0].encoded_genid}&amp;format=application/ld%2Bjson" />   
+  </#if>
+  </#if>
+      
   <script>
       $(document).ready(function(){
           $(".submenu li").click(function(event){
@@ -110,7 +125,7 @@
               };
           }
 
-      <#if resources?size = 1>
+      <#if resources?size = 1 && resources[0].uri?has_content>
           var subjLoader = new loader("${resources[0].uri}", "subject", "inspect_subject");
           subjLoader.fetch();
           $("#s0").click(function() {subjLoader.first();});
@@ -175,11 +190,19 @@
         <h1>RDF/HTML</h1>
         <#if resources?size = 1>
         <div id="top_serialisation_links">
+          <#if resources[0].uri?has_content>
             <a href="${SERVER_URL}resource?uri=${resources[0].encoded_uri}&amp;format=application/rdf%2Bxml">RDF/XML</a>&nbsp;|&nbsp;
             <a href="${SERVER_URL}resource?uri=${resources[0].encoded_uri}&amp;format=text/rdf%2Bn3">N3</a>&nbsp;|&nbsp;
             <a href="${SERVER_URL}resource?uri=${resources[0].encoded_uri}&amp;format=text/turtle">Turtle</a>&nbsp;|&nbsp;
             <a href="${SERVER_URL}resource?uri=${resources[0].encoded_uri}&amp;format=application/rdf%2Bjson">RDF/JSON</a>&nbsp;|&nbsp;
             <a href="${SERVER_URL}resource?uri=${resources[0].encoded_uri}&amp;format=application/ld%2Bjson">JSON-LD</a>
+          <#else>
+            <a href="${SERVER_URL}resource?genid=${resources[0].encoded_genid}&amp;format=application/rdf%2Bxml">RDF/XML</a>&nbsp;|&nbsp;
+            <a href="${SERVER_URL}resource?genid=${resources[0].encoded_genid}&amp;format=text/rdf%2Bn3">N3</a>&nbsp;|&nbsp;
+            <a href="${SERVER_URL}resource?genid=${resources[0].encoded_genid}&amp;format=text/turtle">Turtle</a>&nbsp;|&nbsp;
+            <a href="${SERVER_URL}resource?genid=${resources[0].encoded_genid}&amp;format=application/rdf%2Bjson">RDF/JSON</a>&nbsp;|&nbsp;
+            <a href="${SERVER_URL}resource?genid=${resources[0].encoded_genid}&amp;format=application/ld%2Bjson">JSON-LD</a>          
+          </#if>
         </div>
         <div class="clean"></div>
         </#if>
@@ -205,12 +228,17 @@
             <h1>Triples</h1>
             <#if resources?has_content>
                 <#list resources as resource>
-                    <h2><a href="${resource.uri}" class="ldcache">${resource.uri}</a>
-                        <#if timemaplink??>
-                            <a style="float:right" id="timemap_link" href="${SERVER_URL}${timemaplink}${resource.uri}">
-                                <img style="width: 24px" title="browser versions" alt="memento" src="${SERVER_URL}core/public/img/icon/memento_logo_128.png">
-                            </a>
-                        </#if>
+                    <h2>
+                	<#if resource.uri?has_content>
+                		<a href="${resource.uri}" class="ldcache">${resource.uri}</a>
+                	<#else>
+                		<a href="${SERVER_URL}resource?genid=${resource.encoded_genid}">bnode://${resource.genid}</a>
+                    </#if>                		
+                    <#if timemaplink?? && resource.uri?has_content>
+                        <a style="float:right" id="timemap_link" href="${SERVER_URL}${timemaplink}${resource.uri}">
+                            <img style="width: 24px" title="browser versions" alt="memento" src="${SERVER_URL}core/public/img/icon/memento_logo_128.png">
+                        </a>
+                    </#if>
                     </h2>
                     <table class="simple_table">
                         <tr class="trClassHeader">
@@ -221,10 +249,18 @@
                         </tr>
                         <#list resource.triples as triple>
                             <tr class="${zebra(triple_index)}">
-                                <td><a href="${triple.predicate.uri}" class="ldcache">${triple.predicate.curie}</a></td>
+                                <td>
+                                    <a href="${triple.predicate.uri}" class="ldcache">${triple.predicate.curie}</a>
+                                </td>
+                                <#if resource.uri?has_content>
                                 <td about="${resource.uri}">
+                                <#else>
+                                <td>
+                                </#if>
                                     <#if triple.object.uri?has_content>
-                                        <a rel="${triple.predicate.curie}" href="${triple.object.uri}" class="${cacheClass(triple.object)}">${triple.object.curie}</a>
+                                    	<a rel="${triple.predicate.curie}" href="${triple.object.uri}" class="${cacheClass(triple.object)}">${triple.object.curie}</a>
+                                    <#elseif triple.object.genid?has_content>	
+                                        <a rel="${triple.predicate.curie}" href="${SERVER_URL}resource?genid=${triple.object.encoded_genid}">${triple.object.genid}</a>
                                     <#else>
                                         <span property="${triple.predicate.curie}" ${rdfaAttributes(triple.object)}>${triple.object.value}</span>
                                     </#if>
@@ -234,7 +270,7 @@
                             </tr>
                         </#list>
                     </table>
-                    <#if resources?size != 1>
+                    <#if resources?size != 1 && resource.uri?has_content>
                     <p id="rawrdf">
                         Get this resource in raw RDF:
                         <a href="${SERVER_URL}resource?uri=${resource.encoded_uri}&amp;format=application/rdf%2Bxml">RDF/XML</a>,
@@ -253,7 +289,7 @@
 
             </div>
 
-        <#if resources?size = 1>
+        <#if resources?size = 1 && resources[0].uri?has_content>
             <div id="tab-inspection" style="display: none">
                 <h1>Inspection of <a href="${resources[0].uri}" class="ldcache">${resources[0].uri}</a></h1>
                 <div class="introspectionDetails">

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/platform/marmotta-core/src/main/resources/web/admin/about.html
----------------------------------------------------------------------
diff --git a/platform/marmotta-core/src/main/resources/web/admin/about.html b/platform/marmotta-core/src/main/resources/web/admin/about.html
index 743a39e..706bfda 100644
--- a/platform/marmotta-core/src/main/resources/web/admin/about.html
+++ b/platform/marmotta-core/src/main/resources/web/admin/about.html
@@ -37,7 +37,7 @@
 <p>You can find all installed features on the module list on the right side. To get a quick access to common functionalities, we listed some links:</p>
 <ul>
     <li><a href="import.html">Import your data:</a> RDF and non-RDF formats are supported.</li>
-    <li><a href="../../sparql/admin/snorql/snorql.html">SPARQL your data:</a> full SPARQL 1.1 support including querying and updates.</li>
+    <li><a href="../../sparql/admin/snorql.html">SPARQL your data:</a> full SPARQL 1.1 support including querying and updates.</li>
     <li><a href="configuration.html">Configure your database:</a> Marmotta comes with h2 embedded; configure your own database to handle bigger data.</li>
     <li><a href="dataview.html">Control your data:</a> the dataview gives an overview on the current data in the system. (Attention: there might be problems with the visualisation if big data sets).</li>
     <li><a href="../../user/admin/users.html">Manage your user accounts:</a> the user module allows creating and managing user accounts.</li>
@@ -47,14 +47,14 @@
 <h2>Marmotta Modules</h2>
 <p>Apache Marmotta provides some modules:</p>
 <dl>
-    <dt>Core</dt> <dd>provides the core RDF and Linked Data Platform capabilities.</dd>
-    <dt>SPARQL</dt> <dd>offers query capabilities for the triplestore.</dd>
-    <dt>LDPath Querying</dt> <dd>provides support for LDPath within the platform.</dd>
-    <dt>Linked Data Caching</dt> <dd>provides transparent mechanism to cache Web resources.</dd>
-    <dt>Reasoner</dt> <dd>adds a rule-based reasoner to the triple store.</dd>
-    <dt>Security</dt> <dd>implements security mechanism.</dd>
-    <dt>User</dt> <dd>provides the user management features.</dd>
-    <dt>Versioning</dt> <dd>offers versioning services on top of the triple store.</dd>
+    <dt><a href="../../core/admin/about.html">Core</a></dt> <dd>provides the core RDF and Linked Data Platform capabilities.</dd>
+    <dt><a href="../../sparql/admin/about.html">SPARQL</a></dt> <dd>offers query capabilities for the triplestore.</dd>
+    <dt><a href="../../ldpath/admin/about.html">LDPath Querying</a></dt> <dd>provides support for LDPath within the platform.</dd>
+    <dt><a href="../../cache/admin/about.html">Linked Data Caching</a></dt> <dd>provides transparent mechanism to cache Web resources.</dd>
+    <dt><a href="../../reasoner/admin/about.html">Reasoner</a></dt> <dd>adds a rule-based reasoner to the triple store.</dd>
+    <dt><a href="../../security/admin/about.html">Security</a></dt> <dd>implements security mechanism.</dd>
+    <dt><a href="../../user/me.html">User</a></dt> <dd>provides the user management features.</dd>
+    <dt><a href="../../versioning/admin/about.html">Versioning</a></dt> <dd>offers versioning services on top of the triple store.</dd>
 </dl>
 <!--###END_CONTENT###-->
 </body>

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/platform/marmotta-core/src/main/resources/web/admin/configuration.html
----------------------------------------------------------------------
diff --git a/platform/marmotta-core/src/main/resources/web/admin/configuration.html b/platform/marmotta-core/src/main/resources/web/admin/configuration.html
index 928a336..63dc95c 100644
--- a/platform/marmotta-core/src/main/resources/web/admin/configuration.html
+++ b/platform/marmotta-core/src/main/resources/web/admin/configuration.html
@@ -22,7 +22,7 @@
 <!--###BEGIN_HEAD###-->
     <title>Core Module Configuration</title>
     <link type="text/css" rel="stylesheet" href="../public/js/widgets/configurator/style.css">
-    <script type="text/javascript" src="../public/js/lib/jquery-1.7.2.js"></script>
+    <script type="text/javascript" src="../../webjars/jquery/1.8.2/jquery.min.js"></script>
     <script type="text/javascript" src="../public/js/widgets/configurator/configurator.js"></script>
     <script type="text/javascript" src="js/widgets/database.js"></script>
     <script type="text/javascript">

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/platform/marmotta-core/src/main/resources/web/admin/contexts.html
----------------------------------------------------------------------
diff --git a/platform/marmotta-core/src/main/resources/web/admin/contexts.html b/platform/marmotta-core/src/main/resources/web/admin/contexts.html
index 8a3a8d7..192309a 100644
--- a/platform/marmotta-core/src/main/resources/web/admin/contexts.html
+++ b/platform/marmotta-core/src/main/resources/web/admin/contexts.html
@@ -59,7 +59,7 @@
 
             function deleteContext(uri, id) {
             	$.ajax({
-            	    url: uri,
+            	    url: "../../context?graph=" + encodeURIComponent(uri),
             	    type: "DELETE",
             	    success: function(result) {
             	    	alert("Context " + uri + " deleted!");

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/platform/marmotta-core/src/main/resources/web/admin/dataview.html
----------------------------------------------------------------------
diff --git a/platform/marmotta-core/src/main/resources/web/admin/dataview.html b/platform/marmotta-core/src/main/resources/web/admin/dataview.html
index eec7574..850534f 100644
--- a/platform/marmotta-core/src/main/resources/web/admin/dataview.html
+++ b/platform/marmotta-core/src/main/resources/web/admin/dataview.html
@@ -23,9 +23,9 @@
 <!--###BEGIN_HEAD###-->
     <title>Data Views</title>
     <meta charset="UTF-8"/>
-    <script type="text/javascript" src="../public/js/lib/jquery-1.6.4.js"></script>
+    <script type="text/javascript" src="../../webjars/jquery/1.8.2/jquery.min.js"></script>
     <script type="text/javascript" src="https://www.google.com/jsapi"></script>
-    <script type="text/javascript" src="js/lib/sgvizler.pack.js"></script>
+    <script type="text/javascript" src="../../webjars/sgvizler/0.5.1/sgvizler.js" id="sgvzlr_script" ></script>
     <script type="text/javascript">
 
         var HAS_DATA = true;
@@ -36,7 +36,7 @@
                         'blue','red','orange','green','navy','Crimson','DarkGreen','DarkTurquoise','DodgerBlue','OliveDrab','pink','violet',
                         'GoldenRod','Fuchsia','Darkorange','DarkSlateBlue','GreenYellow','LightSeaGreen','Maroon','MediumVioletRed']
 
-        sgvizler.option.libfolder = "js/lib/";
+        sgvizler.option.libfolder = "../../webjars/sgvizler/0.5.1/lib";
 
         sgvizler.option.stylepath = _SERVER_URL + _CURRENT_STYLE;
 
@@ -237,7 +237,7 @@
                 drawGraphs();
                 drawClasses();
             }
-        });
+    });
 
     </script>
     <style type="text/css">

http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/platform/marmotta-core/src/main/resources/web/admin/export.html
----------------------------------------------------------------------
diff --git a/platform/marmotta-core/src/main/resources/web/admin/export.html b/platform/marmotta-core/src/main/resources/web/admin/export.html
index cb9f40d..295fa56 100644
--- a/platform/marmotta-core/src/main/resources/web/admin/export.html
+++ b/platform/marmotta-core/src/main/resources/web/admin/export.html
@@ -21,7 +21,7 @@
 <head>
 <!--###BEGIN_HEAD###-->
     <title>Exporter</title>
-    <script type="text/javascript" src="../public/js/lib/jquery-1.7.2.js"></script>
+    <script type="text/javascript" src="../../webjars/jquery/1.8.2/jquery.min.js"></script>
 
     <script type="text/javascript">
         var updateDownloadLink = function() {