marmotta-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sschaff...@apache.org
Subject [09/22] git commit: MARMOTTA-85: further restructuring of modules to support modular backends - half-running version of bigdata store backend - webapp launcher with bigdata configuration
Date Thu, 03 Oct 2013 15:07:08 GMT
MARMOTTA-85: further restructuring of modules to support modular backends
- half-running version of bigdata store backend
- webapp launcher with bigdata configuration


Project: http://git-wip-us.apache.org/repos/asf/incubator-marmotta/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-marmotta/commit/8c4007f1
Tree: http://git-wip-us.apache.org/repos/asf/incubator-marmotta/tree/8c4007f1
Diff: http://git-wip-us.apache.org/repos/asf/incubator-marmotta/diff/8c4007f1

Branch: refs/heads/develop
Commit: 8c4007f1dab3e973090fec164420ad7e2a17924b
Parents: d655b51
Author: Sebastian Schaffert <sschaffert@apache.org>
Authored: Wed Oct 2 21:14:29 2013 +0200
Committer: Sebastian Schaffert <sschaffert@apache.org>
Committed: Wed Oct 2 21:14:29 2013 +0200

----------------------------------------------------------------------
 launchers/marmotta-webapp/pom.xml               |  10 +
 launchers/pom.xml                               |  10 +
 platform/marmotta-backend-bigdata/pom.xml       |   8 +
 .../backend/bigdata/BigDataSesame27Sail.java    | 260 +++++++++++++++++++
 .../backend/bigdata/BigDataStoreProvider.java   |  10 +-
 .../src/main/resources/META-INF/beans.xml       |  28 ++
 platform/marmotta-backend-kiwi/pom.xml          |   2 +-
 .../kiwi/KiWiGarbageCollectionProvider.java     |  46 ++++
 .../backend/kiwi/KiWiStoreProvider.java         |  23 +-
 .../src/main/resources/META-INF/beans.xml       |  28 ++
 .../backend/sesame/NativeStoreProvider.java     |   2 +
 .../src/main/resources/META-INF/beans.xml       |  28 ++
 .../triplestore/GarbageCollectionProvider.java  |  37 +++
 .../services/triplestore/SesameServiceImpl.java |  71 ++---
 platform/marmotta-ldcache-common/pom.xml        | 198 ++++++++++++++
 platform/marmotta-ldcache-kiwi/pom.xml          |  38 +--
 .../services/sail/SPARQLSailProvider.java       |  77 ------
 .../user/services/AccountServiceImpl.java       |  31 +--
 platform/marmotta-versioning-common/pom.xml     | 168 ++++++++++++
 platform/marmotta-versioning-kiwi/pom.xml       |  12 +-
 platform/pom.xml                                |   3 +
 21 files changed, 905 insertions(+), 185 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/8c4007f1/launchers/marmotta-webapp/pom.xml
----------------------------------------------------------------------
diff --git a/launchers/marmotta-webapp/pom.xml b/launchers/marmotta-webapp/pom.xml
index 2475525..26964d8 100644
--- a/launchers/marmotta-webapp/pom.xml
+++ b/launchers/marmotta-webapp/pom.xml
@@ -187,6 +187,11 @@
         </dependency>
         <dependency>
             <groupId>org.apache.marmotta</groupId>
+            <artifactId>marmotta-ldcache-common</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.marmotta</groupId>
             <artifactId>marmotta-ldcache-kiwi</artifactId>
             <version>${project.version}</version>
         </dependency>
@@ -207,6 +212,11 @@
         </dependency>
         <dependency>
             <groupId>org.apache.marmotta</groupId>
+            <artifactId>marmotta-versioning-common</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.marmotta</groupId>
             <artifactId>marmotta-versioning-kiwi</artifactId>
             <version>${project.version}</version>
         </dependency>

http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/8c4007f1/launchers/pom.xml
----------------------------------------------------------------------
diff --git a/launchers/pom.xml b/launchers/pom.xml
index 95fa064..265572a 100644
--- a/launchers/pom.xml
+++ b/launchers/pom.xml
@@ -58,4 +58,14 @@
         <module>marmotta-webapp</module>
     </modules>
 
+    <profiles>
+        <profile>
+            <id>non-free</id>
+            <modules>
+                <module>marmotta-webapp-bigdata</module>
+            </modules>
+        </profile>
+    </profiles>
+
+
 </project>

http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/8c4007f1/platform/marmotta-backend-bigdata/pom.xml
----------------------------------------------------------------------
diff --git a/platform/marmotta-backend-bigdata/pom.xml b/platform/marmotta-backend-bigdata/pom.xml
index 1b99947..a0bf329 100644
--- a/platform/marmotta-backend-bigdata/pom.xml
+++ b/platform/marmotta-backend-bigdata/pom.xml
@@ -178,6 +178,14 @@
                     <groupId>org.openrdf.sesame</groupId>
                     <artifactId>sesame-runtime</artifactId>
                 </exclusion>
+                <exclusion>
+                    <groupId>log4j</groupId>
+                    <artifactId>log4j</artifactId>
+                </exclusion>
+                <exclusion>
+                    <groupId>org.slf4j</groupId>
+                    <artifactId>slf4j-log4j12</artifactId>
+                </exclusion>
             </exclusions>
         </dependency>
     </dependencies>

http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/8c4007f1/platform/marmotta-backend-bigdata/src/main/java/org/apache/marmotta/platform/backend/bigdata/BigDataSesame27Sail.java
----------------------------------------------------------------------
diff --git a/platform/marmotta-backend-bigdata/src/main/java/org/apache/marmotta/platform/backend/bigdata/BigDataSesame27Sail.java b/platform/marmotta-backend-bigdata/src/main/java/org/apache/marmotta/platform/backend/bigdata/BigDataSesame27Sail.java
new file mode 100644
index 0000000..da52226
--- /dev/null
+++ b/platform/marmotta-backend-bigdata/src/main/java/org/apache/marmotta/platform/backend/bigdata/BigDataSesame27Sail.java
@@ -0,0 +1,260 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.marmotta.platform.backend.bigdata;
+
+import com.bigdata.rdf.sail.BigdataSail;
+import com.bigdata.rdf.store.AbstractTripleStore;
+import info.aduna.iteration.CloseableIteration;
+import org.openrdf.model.*;
+import org.openrdf.query.BindingSet;
+import org.openrdf.query.Dataset;
+import org.openrdf.query.QueryEvaluationException;
+import org.openrdf.query.algebra.TupleExpr;
+import org.openrdf.sail.*;
+import org.openrdf.sail.helpers.NotifyingSailBase;
+import org.openrdf.sail.helpers.NotifyingSailConnectionBase;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.util.HashSet;
+import java.util.Properties;
+import java.util.Set;
+
+/**
+ * Add file description here!
+ *
+ * @author Sebastian Schaffert (sschaffert@apache.org)
+ */
+public class BigDataSesame27Sail extends NotifyingSailBase implements NotifyingSail {
+
+    private static Logger log = LoggerFactory.getLogger(BigDataSesame27Sail.class);
+
+    /**
+     * Objects that should be notified of changes to the data in this Sail.
+     */
+    private Set<SailChangedListener> sailChangedListeners = new HashSet<SailChangedListener>(0);
+
+
+    private BigdataSail wrapped;
+
+    /**
+     * Create or re-open a database instance configured using defaults.
+     */
+    public BigDataSesame27Sail() {
+        wrapped = new BigdataSail();
+    }
+
+    /**
+     * Constructor used to wrap an existing {@link com.bigdata.rdf.store.AbstractTripleStore}
+     * instance.
+     *
+     * @param database The instance.
+     */
+    public BigDataSesame27Sail(AbstractTripleStore database) {
+        wrapped = new BigdataSail(database);
+    }
+
+    /**
+     * Core ctor. You must use this variant for a scale-out triple store.
+     * <p/>
+     * To create a {@link com.bigdata.rdf.sail.BigdataSail} backed by an {@link com.bigdata.service.IBigdataFederation}
+     * use the {@link com.bigdata.rdf.store.ScaleOutTripleStore} ctor and then
+     * {@link com.bigdata.rdf.store.AbstractTripleStore#create()} the triple store if it does not
+     * exist.
+     *
+     * @param database     An existing {@link com.bigdata.rdf.store.AbstractTripleStore}.
+     * @param mainDatabase When <i>database</i> is a {@link com.bigdata.rdf.store.TempTripleStore}, this is the
+     *                     {@link com.bigdata.rdf.store.AbstractTripleStore} used to resolve the
+     *                     {@link com.bigdata.bop.engine.QueryEngine}. Otherwise it must be the same object as
+     *                     the <i>database</i>.
+     */
+    public BigDataSesame27Sail(AbstractTripleStore database, AbstractTripleStore mainDatabase) {
+        wrapped = new BigdataSail(database,mainDatabase);
+    }
+
+    /**
+     * Create or open a database instance configured using the specified
+     * properties.
+     *
+     * @see com.bigdata.rdf.sail.BigdataSail.Options
+     */
+    public BigDataSesame27Sail(Properties properties) {
+        wrapped = new BigdataSail(properties);
+    }
+
+
+
+    /**
+     * Adds the specified SailChangedListener to receive events when the data in
+     * this Sail object changes.
+     */
+    @Override
+    public void addSailChangedListener(SailChangedListener listener) {
+        synchronized (sailChangedListeners) {
+            sailChangedListeners.add(listener);
+        }
+    }
+
+    /**
+     * Removes the specified SailChangedListener so that it no longer receives
+     * events from this Sail object.
+     */
+    @Override
+    public void removeSailChangedListener(SailChangedListener listener) {
+        synchronized (sailChangedListeners) {
+            sailChangedListeners.remove(listener);
+        }
+    }
+
+    /*
+    * Notifies all registered SailChangedListener's of changes to the contents
+    * of this Sail.
+    */
+    public void notifySailChanged(SailChangedEvent event) {
+        synchronized (sailChangedListeners) {
+            for (SailChangedListener l : sailChangedListeners) {
+                l.sailChanged(event);
+            }
+        }
+    }
+
+
+    @Override
+    public void initialize() throws SailException {
+        wrapped.initialize();
+
+        super.initialize();
+    }
+
+    @Override
+    protected NotifyingSailConnection getConnectionInternal() throws SailException {
+        final BigdataSail.BigdataSailConnection con = wrapped.getConnection();
+
+        return new NotifyingSailConnectionBase(this) {
+            @Override
+            protected void closeInternal() throws SailException {
+               con.close();
+            }
+
+            @Override
+            protected CloseableIteration<? extends BindingSet, QueryEvaluationException> evaluateInternal(TupleExpr tupleExpr, Dataset dataset, BindingSet bindings, boolean includeInferred) throws SailException {
+                return con.evaluate(tupleExpr,dataset,bindings,includeInferred);
+            }
+
+            @Override
+            protected CloseableIteration<? extends Resource, SailException> getContextIDsInternal() throws SailException {
+                return con.getContextIDs();
+            }
+
+            @Override
+            protected CloseableIteration<? extends Statement, SailException> getStatementsInternal(Resource subj, URI pred, Value obj, boolean includeInferred, Resource... contexts) throws SailException {
+                return con.getStatements(subj,pred,obj,includeInferred,contexts);
+            }
+
+            @Override
+            protected long sizeInternal(Resource... contexts) throws SailException {
+                return con.size(contexts);
+            }
+
+            @Override
+            protected void startTransactionInternal() throws SailException {
+                // wrapped connection is Sesame 2.6, no begin method
+            }
+
+            @Override
+            protected void commitInternal() throws SailException {
+                con.commit();
+            }
+
+            @Override
+            protected void rollbackInternal() throws SailException {
+                con.rollback();
+            }
+
+            @Override
+            protected void addStatementInternal(Resource subj, URI pred, Value obj, Resource... contexts) throws SailException {
+                con.addStatement(subj,pred,obj,contexts);
+            }
+
+            @Override
+            protected void removeStatementsInternal(Resource subj, URI pred, Value obj, Resource... contexts) throws SailException {
+                con.removeStatements(subj,pred,obj,contexts);
+            }
+
+            @Override
+            protected void clearInternal(Resource... contexts) throws SailException {
+                con.clear(contexts);
+            }
+
+            @Override
+            protected CloseableIteration<? extends Namespace, SailException> getNamespacesInternal() throws SailException {
+                return con.getNamespaces();
+            }
+
+            @Override
+            protected String getNamespaceInternal(String prefix) throws SailException {
+                return con.getNamespace(prefix);
+            }
+
+            @Override
+            protected void setNamespaceInternal(String prefix, String name) throws SailException {
+                con.setNamespace(prefix,name);
+            }
+
+            @Override
+            protected void removeNamespaceInternal(String prefix) throws SailException {
+                con.removeNamespace(prefix);
+            }
+
+            @Override
+            protected void clearNamespacesInternal() throws SailException {
+                con.clearNamespaces();
+            }
+
+
+        };
+    }
+
+    /**
+     * Do store-specific operations to ensure proper shutdown of the store.
+     */
+    @Override
+    protected void shutDownInternal() throws SailException {
+        wrapped.shutDown();
+    }
+
+    /**
+     * Checks whether this Sail object is writable, i.e. if the data contained in
+     * this Sail object can be changed.
+     */
+    @Override
+    public boolean isWritable() throws SailException {
+        return wrapped.isWritable();
+    }
+
+    /**
+     * Gets a ValueFactory object that can be used to create URI-, blank node-,
+     * literal- and statement objects.
+     *
+     * @return a ValueFactory object for this Sail object.
+     */
+    @Override
+    public ValueFactory getValueFactory() {
+        return wrapped.getValueFactory();
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/8c4007f1/platform/marmotta-backend-bigdata/src/main/java/org/apache/marmotta/platform/backend/bigdata/BigDataStoreProvider.java
----------------------------------------------------------------------
diff --git a/platform/marmotta-backend-bigdata/src/main/java/org/apache/marmotta/platform/backend/bigdata/BigDataStoreProvider.java b/platform/marmotta-backend-bigdata/src/main/java/org/apache/marmotta/platform/backend/bigdata/BigDataStoreProvider.java
index 8446bc7..c86687a 100644
--- a/platform/marmotta-backend-bigdata/src/main/java/org/apache/marmotta/platform/backend/bigdata/BigDataStoreProvider.java
+++ b/platform/marmotta-backend-bigdata/src/main/java/org/apache/marmotta/platform/backend/bigdata/BigDataStoreProvider.java
@@ -25,6 +25,7 @@ import org.openrdf.sail.NotifyingSail;
 import org.openrdf.sail.Sail;
 import org.slf4j.Logger;
 
+import javax.enterprise.context.ApplicationScoped;
 import javax.inject.Inject;
 import java.io.File;
 import java.util.Properties;
@@ -38,6 +39,7 @@ import java.util.Properties;
  *
  * @author Sebastian Schaffert (sschaffert@apache.org)
  */
+@ApplicationScoped
 public class BigDataStoreProvider implements StoreProvider {
 
     @Inject
@@ -61,10 +63,14 @@ public class BigDataStoreProvider implements StoreProvider {
 
         Properties properties = new Properties();
         properties.setProperty( BigdataSail.Options.FILE, journal.getAbsolutePath());
+        properties.setProperty( BigdataSail.Options.QUADS, "true");
+        properties.setProperty( BigdataSail.Options.TRUTH_MAINTENANCE, "false");
+        properties.setProperty( BigdataSail.Options.STATEMENT_IDENTIFIERS, "false");
+        properties.setProperty( BigdataSail.Options.AXIOMS_CLASS, "com.bigdata.rdf.axioms.NoAxioms");
+        properties.setProperty( BigdataSail.Options.TEXT_INDEX, "true");
 
-        BigdataSail sail = new BigdataSail(properties);
 
-        return null;  //To change body of implemented methods use File | Settings | File Templates.
+        return new BigDataSesame27Sail(properties);
     }
 
 

http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/8c4007f1/platform/marmotta-backend-bigdata/src/main/resources/META-INF/beans.xml
----------------------------------------------------------------------
diff --git a/platform/marmotta-backend-bigdata/src/main/resources/META-INF/beans.xml b/platform/marmotta-backend-bigdata/src/main/resources/META-INF/beans.xml
new file mode 100644
index 0000000..461858e
--- /dev/null
+++ b/platform/marmotta-backend-bigdata/src/main/resources/META-INF/beans.xml
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+    Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements. See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership. The ASF licenses this file
+    to you under the Apache License, Version 2.0 (the
+    "License"); you may not use this file except in compliance
+    with the License.  You may obtain a copy of the License at
+
+        http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+
+-->
+<beans
+   xmlns="http://java.sun.com/xml/ns/javaee"
+   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+   xsi:schemaLocation="
+      http://java.sun.com/xml/ns/javaee
+      http://java.sun.com/xml/ns/javaee/beans_1_0.xsd">
+
+</beans>

http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/8c4007f1/platform/marmotta-backend-kiwi/pom.xml
----------------------------------------------------------------------
diff --git a/platform/marmotta-backend-kiwi/pom.xml b/platform/marmotta-backend-kiwi/pom.xml
index 3e86d3b..abe6f37 100644
--- a/platform/marmotta-backend-kiwi/pom.xml
+++ b/platform/marmotta-backend-kiwi/pom.xml
@@ -163,7 +163,7 @@
         </dependency>
         <dependency>
             <groupId>org.apache.marmotta</groupId>
-            <artifactId>kiwi-transactions</artifactId>
+            <artifactId>kiwi-sparql</artifactId>
         </dependency>
     </dependencies>
 

http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/8c4007f1/platform/marmotta-backend-kiwi/src/main/java/org/apache/marmotta/platform/backend/kiwi/KiWiGarbageCollectionProvider.java
----------------------------------------------------------------------
diff --git a/platform/marmotta-backend-kiwi/src/main/java/org/apache/marmotta/platform/backend/kiwi/KiWiGarbageCollectionProvider.java b/platform/marmotta-backend-kiwi/src/main/java/org/apache/marmotta/platform/backend/kiwi/KiWiGarbageCollectionProvider.java
new file mode 100644
index 0000000..76ca65b
--- /dev/null
+++ b/platform/marmotta-backend-kiwi/src/main/java/org/apache/marmotta/platform/backend/kiwi/KiWiGarbageCollectionProvider.java
@@ -0,0 +1,46 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.marmotta.platform.backend.kiwi;
+
+import org.apache.marmotta.kiwi.sail.KiWiStore;
+import org.apache.marmotta.platform.core.api.triplestore.GarbageCollectionProvider;
+import org.openrdf.sail.Sail;
+import org.openrdf.sail.SailException;
+
+import javax.enterprise.context.ApplicationScoped;
+
+/**
+ * Add file description here!
+ *
+ * @author Sebastian Schaffert (sschaffert@apache.org)
+ */
+@ApplicationScoped
+public class KiWiGarbageCollectionProvider implements GarbageCollectionProvider {
+
+    /**
+     * Run garbage collection for the sail given as argument.
+     *
+     * @param sail
+     */
+    @Override
+    public void garbageCollect(Sail sail) throws SailException {
+        if(sail instanceof KiWiStore) {
+            ((KiWiStore) sail).garbageCollect();
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/8c4007f1/platform/marmotta-backend-kiwi/src/main/java/org/apache/marmotta/platform/backend/kiwi/KiWiStoreProvider.java
----------------------------------------------------------------------
diff --git a/platform/marmotta-backend-kiwi/src/main/java/org/apache/marmotta/platform/backend/kiwi/KiWiStoreProvider.java b/platform/marmotta-backend-kiwi/src/main/java/org/apache/marmotta/platform/backend/kiwi/KiWiStoreProvider.java
index 3f1a8e8..4f3833f 100644
--- a/platform/marmotta-backend-kiwi/src/main/java/org/apache/marmotta/platform/backend/kiwi/KiWiStoreProvider.java
+++ b/platform/marmotta-backend-kiwi/src/main/java/org/apache/marmotta/platform/backend/kiwi/KiWiStoreProvider.java
@@ -24,14 +24,18 @@ import org.apache.marmotta.kiwi.persistence.h2.H2Dialect;
 import org.apache.marmotta.kiwi.persistence.mysql.MySQLDialect;
 import org.apache.marmotta.kiwi.persistence.pgsql.PostgreSQLDialect;
 import org.apache.marmotta.kiwi.sail.KiWiStore;
+import org.apache.marmotta.kiwi.sparql.sail.KiWiSparqlSail;
 import org.apache.marmotta.platform.core.api.config.ConfigurationService;
+import org.apache.marmotta.platform.core.api.triplestore.SesameService;
 import org.apache.marmotta.platform.core.api.triplestore.StoreProvider;
+import org.apache.marmotta.platform.core.events.ConfigurationChangedEvent;
 import org.openrdf.repository.sail.SailRepository;
 import org.openrdf.sail.NotifyingSail;
 import org.openrdf.sail.Sail;
 import org.slf4j.Logger;
 
 import javax.enterprise.context.ApplicationScoped;
+import javax.enterprise.event.Observes;
 import javax.inject.Inject;
 
 /**
@@ -54,12 +58,18 @@ import javax.inject.Inject;
 @ApplicationScoped
 public class KiWiStoreProvider implements StoreProvider {
 
+    public static final String SPARQL_STRATEGY = "sparql.strategy";
+
     @Inject
     private Logger log;
 
     @Inject
     private ConfigurationService configurationService;
 
+    @Inject
+    private SesameService sesameService;
+
+
     /**
      * Create the store provided by this SailProvider
      *
@@ -102,7 +112,11 @@ public class KiWiStoreProvider implements StoreProvider {
             configuration.setIdGeneratorType(IDGeneratorType.SNOWFLAKE);
         }
 
-        return new KiWiStore(configuration);
+        if("native".equalsIgnoreCase(configurationService.getStringConfiguration(SPARQL_STRATEGY))) {
+            return new KiWiSparqlSail(new KiWiStore(configuration));
+        } else {
+            return new KiWiStore(configuration);
+        }
     }
 
     /**
@@ -136,4 +150,11 @@ public class KiWiStoreProvider implements StoreProvider {
     public boolean isEnabled() {
         return true;
     }
+
+    public void configurationChanged(@Observes ConfigurationChangedEvent e) {
+        if(e.containsChangedKey(SPARQL_STRATEGY)) {
+            sesameService.restart();
+        }
+    }
+
 }

http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/8c4007f1/platform/marmotta-backend-kiwi/src/main/resources/META-INF/beans.xml
----------------------------------------------------------------------
diff --git a/platform/marmotta-backend-kiwi/src/main/resources/META-INF/beans.xml b/platform/marmotta-backend-kiwi/src/main/resources/META-INF/beans.xml
new file mode 100644
index 0000000..461858e
--- /dev/null
+++ b/platform/marmotta-backend-kiwi/src/main/resources/META-INF/beans.xml
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+    Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements. See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership. The ASF licenses this file
+    to you under the Apache License, Version 2.0 (the
+    "License"); you may not use this file except in compliance
+    with the License.  You may obtain a copy of the License at
+
+        http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+
+-->
+<beans
+   xmlns="http://java.sun.com/xml/ns/javaee"
+   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+   xsi:schemaLocation="
+      http://java.sun.com/xml/ns/javaee
+      http://java.sun.com/xml/ns/javaee/beans_1_0.xsd">
+
+</beans>

http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/8c4007f1/platform/marmotta-backend-native/src/main/java/org/apache/marmotta/platform/backend/sesame/NativeStoreProvider.java
----------------------------------------------------------------------
diff --git a/platform/marmotta-backend-native/src/main/java/org/apache/marmotta/platform/backend/sesame/NativeStoreProvider.java b/platform/marmotta-backend-native/src/main/java/org/apache/marmotta/platform/backend/sesame/NativeStoreProvider.java
index a44c8d7..5aea749 100644
--- a/platform/marmotta-backend-native/src/main/java/org/apache/marmotta/platform/backend/sesame/NativeStoreProvider.java
+++ b/platform/marmotta-backend-native/src/main/java/org/apache/marmotta/platform/backend/sesame/NativeStoreProvider.java
@@ -25,6 +25,7 @@ import org.openrdf.sail.Sail;
 import org.openrdf.sail.nativerdf.NativeStore;
 import org.slf4j.Logger;
 
+import javax.enterprise.context.ApplicationScoped;
 import javax.inject.Inject;
 import java.io.File;
 
@@ -34,6 +35,7 @@ import java.io.File;
  *
  * @author Sebastian Schaffert (sschaffert@apache.org)
  */
+@ApplicationScoped
 public class NativeStoreProvider implements StoreProvider {
 
     @Inject

http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/8c4007f1/platform/marmotta-backend-native/src/main/resources/META-INF/beans.xml
----------------------------------------------------------------------
diff --git a/platform/marmotta-backend-native/src/main/resources/META-INF/beans.xml b/platform/marmotta-backend-native/src/main/resources/META-INF/beans.xml
new file mode 100644
index 0000000..461858e
--- /dev/null
+++ b/platform/marmotta-backend-native/src/main/resources/META-INF/beans.xml
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+    Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements. See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership. The ASF licenses this file
+    to you under the Apache License, Version 2.0 (the
+    "License"); you may not use this file except in compliance
+    with the License.  You may obtain a copy of the License at
+
+        http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+
+-->
+<beans
+   xmlns="http://java.sun.com/xml/ns/javaee"
+   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+   xsi:schemaLocation="
+      http://java.sun.com/xml/ns/javaee
+      http://java.sun.com/xml/ns/javaee/beans_1_0.xsd">
+
+</beans>

http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/8c4007f1/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/api/triplestore/GarbageCollectionProvider.java
----------------------------------------------------------------------
diff --git a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/api/triplestore/GarbageCollectionProvider.java b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/api/triplestore/GarbageCollectionProvider.java
new file mode 100644
index 0000000..344042e
--- /dev/null
+++ b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/api/triplestore/GarbageCollectionProvider.java
@@ -0,0 +1,37 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.marmotta.platform.core.api.triplestore;
+
+import org.openrdf.sail.Sail;
+import org.openrdf.sail.SailException;
+
+/**
+ * This interface can be implemented by services in the backend in case the underlying triple store supports
+ * explicit garbage colleciton
+ *
+ * @author Sebastian Schaffert (sschaffert@apache.org)
+ */
+public interface GarbageCollectionProvider {
+
+    /**
+     * Run garbage collection for the sail given as argument.
+     *
+     * @param sail
+     */
+    public void garbageCollect(Sail sail) throws SailException;
+}

http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/8c4007f1/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 620e6a7..118d208 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
@@ -18,22 +18,12 @@
 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.kiwi.generator.IDGeneratorType;
-import org.apache.marmotta.kiwi.persistence.KiWiDialect;
-import org.apache.marmotta.kiwi.persistence.h2.H2Dialect;
-import org.apache.marmotta.kiwi.persistence.mysql.MySQLDialect;
-import org.apache.marmotta.kiwi.persistence.pgsql.PostgreSQLDialect;
-import org.apache.marmotta.kiwi.sail.KiWiStore;
 import org.apache.marmotta.kiwi.transactions.api.TransactionListener;
 import org.apache.marmotta.kiwi.transactions.api.TransactionalSail;
 import org.apache.marmotta.kiwi.transactions.model.TransactionData;
 import org.apache.marmotta.kiwi.transactions.sail.KiWiTransactionalSail;
 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;
-import org.apache.marmotta.platform.core.api.triplestore.StandardSailProvider;
-import org.apache.marmotta.platform.core.api.triplestore.TransactionalSailProvider;
+import org.apache.marmotta.platform.core.api.triplestore.*;
 import org.apache.marmotta.platform.core.qualifiers.event.transaction.AfterCommit;
 import org.apache.marmotta.platform.core.qualifiers.event.transaction.AfterRollback;
 import org.apache.marmotta.platform.core.qualifiers.event.transaction.BeforeCommit;
@@ -98,6 +88,12 @@ public class SesameServiceImpl implements SesameService {
     private Event<TransactionData> afterRollbackEvent;
 
     /**
+     * triple store providers from backend modules
+     */
+    @Inject
+    private Instance<StoreProvider> storeProviders;
+
+    /**
      * notifying sail providers from other modules
      */
     @Inject
@@ -115,8 +111,13 @@ public class SesameServiceImpl implements SesameService {
     @Inject
     private Instance<StandardSailProvider> standardSailProviders;
 
+    /**
+     * garbage collectors for backends that support it
+     */
+    @Inject
+    private Instance<GarbageCollectionProvider> garbageCollectionProviders;
 
-    private KiWiStore  store;
+    private NotifyingSail store;
 
     private KiWiTransactionalSail tsail;
 
@@ -137,40 +138,16 @@ public class SesameServiceImpl implements SesameService {
                 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");
-            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));
-
-            String generatorType = configurationService.getStringConfiguration("database.generator", "uuid-time");
-            if("uuid-time".equals(generatorType)) {
-                configuration.setIdGeneratorType(IDGeneratorType.UUID_TIME);
-            } else if("uuid-random".equals(generatorType)) {
-                configuration.setIdGeneratorType(IDGeneratorType.UUID_RANDOM);
-            } else if("sequence".equals(generatorType)) {
-                configuration.setIdGeneratorType(IDGeneratorType.DATABASE_SEQUENCE);
-            } else if("memory".equals(generatorType)) {
-                configuration.setIdGeneratorType(IDGeneratorType.MEMORY_SEQUENCE);
-            } else if("snowflake".equals(generatorType)) {
-                configuration.setIdGeneratorType(IDGeneratorType.SNOWFLAKE);
+            if(storeProviders.isAmbiguous()) {
+                log.error("more than one storage backend in classpath; please only select one storage backend");
+                return;
+            }
+            if(storeProviders.isUnsatisfied()) {
+                log.error("no storage backend found in classpath; please add one of the marmotta-backend-XXX modules");
+                return;
             }
 
-            store = new KiWiStore(configuration);
+            store = storeProviders.get().createStore();
 
             tsail = new KiWiTransactionalSail(store);
 
@@ -212,7 +189,7 @@ public class SesameServiceImpl implements SesameService {
             // 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 = storeProviders.get().createRepository(standardSail);
 
             try {
                 repository.initialize();
@@ -324,7 +301,9 @@ public class SesameServiceImpl implements SesameService {
     @Override
     public void garbageCollect() throws SailException {
         if(store != null) {
-            store.garbageCollect();
+            for(GarbageCollectionProvider p : garbageCollectionProviders) {
+                p.garbageCollect(store);
+            }
         }
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/8c4007f1/platform/marmotta-ldcache-common/pom.xml
----------------------------------------------------------------------
diff --git a/platform/marmotta-ldcache-common/pom.xml b/platform/marmotta-ldcache-common/pom.xml
new file mode 100644
index 0000000..49cf342
--- /dev/null
+++ b/platform/marmotta-ldcache-common/pom.xml
@@ -0,0 +1,198 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  ~ Licensed to the Apache Software Foundation (ASF) under one or more
+  ~ contributor license agreements.  See the NOTICE file distributed with
+  ~ this work for additional information regarding copyright ownership.
+  ~ The ASF licenses this file to You under the Apache License, Version 2.0
+  ~ (the "License"); you may not use this file except in compliance with
+  ~ the License.  You may obtain a copy of the License at
+  ~
+  ~      http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing, software
+  ~ distributed under the License is distributed on an "AS IS" BASIS,
+  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  ~ See the License for the specific language governing permissions and
+  ~ limitations under the License.
+  -->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+
+    <parent>
+        <groupId>org.apache.marmotta</groupId>
+        <artifactId>marmotta-parent</artifactId>
+        <version>3.2.0-incubating-SNAPSHOT</version>
+        <relativePath>../../parent</relativePath>
+    </parent>
+
+    <artifactId>marmotta-ldcache-common</artifactId>
+    <packaging>jar</packaging>
+
+    <name>Apache Marmotta Platform: Linked Data Caching (Common Services)</name>
+    <description>
+        Provides transparent Linked Data Caching in the LMF triple store. When a resource is queried using e.g. LDPath
+        or SPARQL and it represents an external resource (e.g. on DBPedia or GeoNames), the resource is transparently
+        fetched on demand and cached locally. This module contains the backend-independent services.
+    </description>
+
+    <build>
+        <pluginManagement>
+            <plugins>
+                <plugin> <!-- generate JRebel Configuration -->
+                    <groupId>org.zeroturnaround</groupId>
+                    <artifactId>jrebel-maven-plugin</artifactId>
+                    <version>1.1.3</version>
+                    <executions>
+                        <execution>
+                            <id>generate-rebel-xml</id>
+                            <phase>process-resources</phase>
+                            <goals>
+                                <goal>generate</goal>
+                            </goals>
+                        </execution>
+                    </executions>
+                    <configuration>
+                        <relativePath>../../</relativePath>
+                        <rootPath>$${rebel.root}</rootPath>
+                        <classpath>
+                            <resources>
+                                <resource><!-- default resource --></resource>
+                                <resource><directory>src/main/resources</directory></resource>
+                            </resources>
+                        </classpath>
+                    </configuration>
+                </plugin>
+            </plugins>
+        </pluginManagement>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.marmotta</groupId>
+                <artifactId>buildinfo-maven-plugin</artifactId>
+                <configuration>
+                    <systemProperties>
+                        <systemProperty>user.name</systemProperty>
+                        <systemProperty>user.timezone</systemProperty>
+                        <systemProperty>java.vm.vendor</systemProperty>
+                        <systemProperty>java.vm.version</systemProperty>
+                        <systemProperty>java.vm.name</systemProperty>
+                        <systemProperty>java.runtime.version</systemProperty>
+                        <systemProperty>os.name</systemProperty>
+                        <systemProperty>os.version</systemProperty>
+                        <systemProperty>os.arch</systemProperty>
+                    </systemProperties>
+                </configuration>
+                <executions>
+                    <execution>
+                        <phase>process-resources</phase>
+                        <goals>
+                            <goal>extract</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
+
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-javadoc-plugin</artifactId>
+                <executions>
+                    <!--
+                    <execution>
+                        <id>aggregate</id>
+                        <goals>
+                            <goal>aggregate</goal>
+                        </goals>
+                        <phase>site</phase>
+                    </execution>
+                    -->
+                    <execution>
+                        <!-- configure how the REST API documentation will be produced -->
+                        <id>restapi</id>
+                        <configuration>
+                            <doclet>com.lunatech.doclets.jax.jaxrs.JAXRSDoclet</doclet>
+
+                            <name>REST API</name>
+                            <description>REST API for LMF Webservices</description>
+
+                            <outputDirectory>${project.build.outputDirectory}/doc</outputDirectory>
+                            <reportOutputDirectory>${project.build.outputDirectory}/web/doc</reportOutputDirectory>
+                            <destDir>rest</destDir>
+
+                            <docletArtifact>
+                                <groupId>com.lunatech.jax-doclets</groupId>
+                                <artifactId>doclets</artifactId>
+                                <version>0.10.0</version>
+                            </docletArtifact>
+                            <additionalparam>
+                                -jaxrscontext {BASE}
+                                -charset UTF-8
+                            </additionalparam>
+
+                            <!--
+                                                        <stylesheetfile>${project.parent.basedir}/config/doc/doclet.css</stylesheetfile>
+                            -->
+
+                            <header><![CDATA[<!--###BEGIN_CONTENT###--><div class="javadoc">]]></header>
+                            <footer><![CDATA[</div><!--###END_CONTENT###-->]]></footer>
+                            <encoding>UTF-8</encoding>
+                            <detectOfflineLinks>false</detectOfflineLinks>
+
+                            <!-- For the project-reports page -->
+                        </configuration>
+                        <goals>
+                            <goal>javadoc</goal>
+                        </goals>
+                        <phase>generate-resources</phase>
+                    </execution>
+                </executions>
+            </plugin>
+        </plugins>
+    </build>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.apache.marmotta</groupId>
+            <artifactId>marmotta-core</artifactId>
+            <version>${project.parent.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.marmotta</groupId>
+            <artifactId>ldclient-api</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.marmotta</groupId>
+            <artifactId>ldclient-core</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.marmotta</groupId>
+            <artifactId>ldclient-provider-rdf</artifactId>
+        </dependency>
+        <!--
+        <dependency>
+            <groupId>org.apache.marmotta</groupId>
+            <artifactId>ldclient-provider-xml</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.marmotta</groupId>
+            <artifactId>ldclient-provider-html</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.marmotta</groupId>
+            <artifactId>ldclient-provider-ldap</artifactId>
+        </dependency>
+        -->
+        <dependency>
+            <groupId>org.apache.marmotta</groupId>
+            <artifactId>ldcache-api</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.marmotta</groupId>
+            <artifactId>ldcache-core</artifactId>
+        </dependency>
+
+
+    </dependencies>
+    
+</project>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/8c4007f1/platform/marmotta-ldcache-kiwi/pom.xml
----------------------------------------------------------------------
diff --git a/platform/marmotta-ldcache-kiwi/pom.xml b/platform/marmotta-ldcache-kiwi/pom.xml
index 4b2be45..1614dc9 100644
--- a/platform/marmotta-ldcache-kiwi/pom.xml
+++ b/platform/marmotta-ldcache-kiwi/pom.xml
@@ -156,43 +156,13 @@
         </dependency>
         <dependency>
             <groupId>org.apache.marmotta</groupId>
-            <artifactId>marmotta-backend-kiwi</artifactId>
-            <version>${project.version}</version>
-        </dependency>
-
-        <dependency>
-            <groupId>org.apache.marmotta</groupId>
-            <artifactId>ldclient-api</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.marmotta</groupId>
-            <artifactId>ldclient-core</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.marmotta</groupId>
-            <artifactId>ldclient-provider-rdf</artifactId>
-        </dependency>
-        <!--
-        <dependency>
-            <groupId>org.apache.marmotta</groupId>
-            <artifactId>ldclient-provider-xml</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.marmotta</groupId>
-            <artifactId>ldclient-provider-html</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.marmotta</groupId>
-            <artifactId>ldclient-provider-ldap</artifactId>
-        </dependency>
-        -->
-        <dependency>
-            <groupId>org.apache.marmotta</groupId>
-            <artifactId>ldcache-api</artifactId>
+            <artifactId>marmotta-ldcache-common</artifactId>
+            <version>${project.parent.version}</version>
         </dependency>
         <dependency>
             <groupId>org.apache.marmotta</groupId>
-            <artifactId>ldcache-core</artifactId>
+            <artifactId>marmotta-backend-kiwi</artifactId>
+            <version>${project.version}</version>
         </dependency>
         <dependency>
             <groupId>org.apache.marmotta</groupId>

http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/8c4007f1/platform/marmotta-sparql/src/main/java/org/apache/marmotta/platform/sparql/services/sail/SPARQLSailProvider.java
----------------------------------------------------------------------
diff --git a/platform/marmotta-sparql/src/main/java/org/apache/marmotta/platform/sparql/services/sail/SPARQLSailProvider.java b/platform/marmotta-sparql/src/main/java/org/apache/marmotta/platform/sparql/services/sail/SPARQLSailProvider.java
deleted file mode 100644
index e91be5d..0000000
--- a/platform/marmotta-sparql/src/main/java/org/apache/marmotta/platform/sparql/services/sail/SPARQLSailProvider.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.marmotta.platform.sparql.services.sail;
-
-import org.apache.marmotta.kiwi.sparql.sail.KiWiSparqlSail;
-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;
-import org.apache.marmotta.platform.core.events.ConfigurationChangedEvent;
-import org.openrdf.sail.NotifyingSail;
-import org.openrdf.sail.helpers.NotifyingSailWrapper;
-
-import javax.enterprise.context.ApplicationScoped;
-import javax.enterprise.event.Observes;
-import javax.inject.Inject;
-
-/**
- * This service wraps enhanced KiWi SPARQL support around the KiWi Store to improve the performance of typical
- * SPARQL queries.
- *
- * @author Sebastian Schaffert (sschaffert@apache.org)
- */
-@ApplicationScoped
-public class SPARQLSailProvider implements NotifyingSailProvider {
-
-    public static final String SPARQL_STRATEGY = "sparql.strategy";
-
-
-    @Inject
-    private ConfigurationService configurationService;
-
-    @Inject
-    private SesameService sesameService;
-
-    @Override
-    public NotifyingSailWrapper createSail(NotifyingSail parent) {
-        KiWiSparqlSail sail = new KiWiSparqlSail(parent);
-
-        return sail;
-    }
-
-    public void configurationChanged(@Observes ConfigurationChangedEvent e) {
-        if(e.containsChangedKey(SPARQL_STRATEGY)) {
-            sesameService.restart();
-        }
-    }
-
-
-    @Override
-    public String getName() {
-        return "SPARQL Optimizer";
-    }
-
-    @Override
-    public boolean isEnabled() {
-        if("native".equalsIgnoreCase(configurationService.getStringConfiguration(SPARQL_STRATEGY))) {
-            return true;
-        } else {
-            return false;
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/8c4007f1/platform/marmotta-user/src/main/java/org/apache/marmotta/platform/user/services/AccountServiceImpl.java
----------------------------------------------------------------------
diff --git a/platform/marmotta-user/src/main/java/org/apache/marmotta/platform/user/services/AccountServiceImpl.java b/platform/marmotta-user/src/main/java/org/apache/marmotta/platform/user/services/AccountServiceImpl.java
index b94033b..f0ab876 100644
--- a/platform/marmotta-user/src/main/java/org/apache/marmotta/platform/user/services/AccountServiceImpl.java
+++ b/platform/marmotta-user/src/main/java/org/apache/marmotta/platform/user/services/AccountServiceImpl.java
@@ -17,22 +17,21 @@
  */
 package org.apache.marmotta.platform.user.services;
 
-import org.apache.marmotta.platform.core.model.user.MarmottaUser;
-import org.apache.marmotta.platform.core.qualifiers.cache.MarmottaCache;
-import org.apache.marmotta.platform.user.api.AccountService;
-import org.apache.marmotta.platform.user.model.UserAccount;
-import org.apache.marmotta.platform.user.model.UserAccount.PasswordHash;
 import com.google.common.base.Preconditions;
+import net.sf.ehcache.Ehcache;
+import net.sf.ehcache.Element;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.marmotta.commons.sesame.model.Namespaces;
 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.ConfigurationChangedEvent;
 import org.apache.marmotta.platform.core.events.SystemStartupEvent;
 import org.apache.marmotta.platform.core.exception.UserExistsException;
-import net.sf.ehcache.Ehcache;
-import net.sf.ehcache.Element;
-import org.apache.commons.lang3.StringUtils;
-import org.apache.marmotta.commons.sesame.model.Namespaces;
-import org.apache.marmotta.kiwi.model.rdf.KiWiUriResource;
+import org.apache.marmotta.platform.core.model.user.MarmottaUser;
+import org.apache.marmotta.platform.core.qualifiers.cache.MarmottaCache;
+import org.apache.marmotta.platform.user.api.AccountService;
+import org.apache.marmotta.platform.user.model.UserAccount;
+import org.apache.marmotta.platform.user.model.UserAccount.PasswordHash;
 import org.openrdf.model.Resource;
 import org.openrdf.model.URI;
 import org.slf4j.Logger;
@@ -159,17 +158,11 @@ public class AccountServiceImpl implements AccountService {
             }
         }
 
-        if(webid instanceof KiWiUriResource) {
-            UserAccount account = new UserAccount(login, webid.stringValue());
+        UserAccount account = new UserAccount(login, webid.stringValue());
 
-            save(account);
-
-            return account;
-        } else {
-            log.error("could not create user account, the backend is not KiWi");
+        save(account);
 
-            return null;
-        }
+        return account;
     }
 
     private void save(UserAccount account) {

http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/8c4007f1/platform/marmotta-versioning-common/pom.xml
----------------------------------------------------------------------
diff --git a/platform/marmotta-versioning-common/pom.xml b/platform/marmotta-versioning-common/pom.xml
new file mode 100644
index 0000000..84c336e
--- /dev/null
+++ b/platform/marmotta-versioning-common/pom.xml
@@ -0,0 +1,168 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  ~ Licensed to the Apache Software Foundation (ASF) under one or more
+  ~ contributor license agreements.  See the NOTICE file distributed with
+  ~ this work for additional information regarding copyright ownership.
+  ~ The ASF licenses this file to You under the Apache License, Version 2.0
+  ~ (the "License"); you may not use this file except in compliance with
+  ~ the License.  You may obtain a copy of the License at
+  ~
+  ~      http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing, software
+  ~ distributed under the License is distributed on an "AS IS" BASIS,
+  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  ~ See the License for the specific language governing permissions and
+  ~ limitations under the License.
+  -->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+
+    <parent>
+        <groupId>org.apache.marmotta</groupId>
+        <artifactId>marmotta-parent</artifactId>
+        <version>3.2.0-incubating-SNAPSHOT</version>
+        <relativePath>../../parent</relativePath>
+    </parent>
+
+    <artifactId>marmotta-versioning-common</artifactId>
+    <packaging>jar</packaging>
+
+    <name>Apache Marmotta Platform: Versioning (Common Services)</name>
+    <description>
+        This module provides versioning support for all modifications of the data contained in the LMF System (triples,
+        resources, namespaces). Versions are accessible according to the Memento protocol using a special webservice.
+        Versioning is triggered when a transaction finishes successfully and will store additional
+        versioning information in the database. Note that this implies a certain performance overhead.
+        This module contains the backend-independent services.
+    </description>
+
+    <build>
+        <pluginManagement>
+            <plugins>
+                <plugin> <!-- generate JRebel Configuration -->
+                    <groupId>org.zeroturnaround</groupId>
+                    <artifactId>jrebel-maven-plugin</artifactId>
+                    <version>1.1.3</version>
+                    <executions>
+                        <execution>
+                            <id>generate-rebel-xml</id>
+                            <phase>process-resources</phase>
+                            <goals>
+                                <goal>generate</goal>
+                            </goals>
+                        </execution>
+                    </executions>
+                    <configuration>
+                        <relativePath>../../</relativePath>
+                        <rootPath>$${rebel.root}</rootPath>
+                        <classpath>
+                            <resources>
+                                <resource><!-- default resource --></resource>
+                                <resource><directory>src/main/resources</directory></resource>
+                            </resources>
+                        </classpath>
+                    </configuration>
+                </plugin>
+            </plugins>
+        </pluginManagement>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.marmotta</groupId>
+                <artifactId>buildinfo-maven-plugin</artifactId>
+                <configuration>
+                    <systemProperties>
+                        <systemProperty>user.name</systemProperty>
+                        <systemProperty>user.timezone</systemProperty>
+                        <systemProperty>java.vm.vendor</systemProperty>
+                        <systemProperty>java.vm.version</systemProperty>
+                        <systemProperty>java.vm.name</systemProperty>
+                        <systemProperty>java.runtime.version</systemProperty>
+                        <systemProperty>os.name</systemProperty>
+                        <systemProperty>os.version</systemProperty>
+                        <systemProperty>os.arch</systemProperty>
+                    </systemProperties>
+                </configuration>
+                <executions>
+                    <execution>
+                        <phase>process-resources</phase>
+                        <goals>
+                            <goal>extract</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
+
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-javadoc-plugin</artifactId>
+                <executions>
+                    <!--
+                    <execution>
+                        <id>aggregate</id>
+                        <goals>
+                            <goal>aggregate</goal>
+                        </goals>
+                        <phase>site</phase>
+                    </execution>
+                    -->
+                    <execution>
+                        <!-- configure how the REST API documentation will be produced -->
+                        <id>restapi</id>
+                        <configuration>
+                            <doclet>com.lunatech.doclets.jax.jaxrs.JAXRSDoclet</doclet>
+
+                            <name>REST API</name>
+                            <description>REST API for LMF Webservices</description>
+
+                            <outputDirectory>${project.build.outputDirectory}/doc</outputDirectory>
+                            <reportOutputDirectory>${project.build.outputDirectory}/web/doc</reportOutputDirectory>
+                            <destDir>rest</destDir>
+
+                            <docletArtifact>
+                                <groupId>com.lunatech.jax-doclets</groupId>
+                                <artifactId>doclets</artifactId>
+                                <version>0.10.0</version>
+                            </docletArtifact>
+                            <additionalparam>
+                                -jaxrscontext {BASE}
+                                -charset UTF-8
+                            </additionalparam>
+
+                            <!--
+                                                        <stylesheetfile>${project.parent.basedir}/config/doc/doclet.css</stylesheetfile>
+                            -->
+
+                            <header><![CDATA[<!--###BEGIN_CONTENT###--><div class="javadoc">]]></header>
+                            <footer><![CDATA[</div><!--###END_CONTENT###-->]]></footer>
+                            <encoding>UTF-8</encoding>
+                            <detectOfflineLinks>false</detectOfflineLinks>
+
+                            <!-- For the project-reports page -->
+                        </configuration>
+                        <goals>
+                            <goal>javadoc</goal>
+                        </goals>
+                        <phase>generate-resources</phase>
+                    </execution>
+                </executions>
+            </plugin>
+        </plugins>
+    </build>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.apache.marmotta</groupId>
+            <artifactId>marmotta-core</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.freemarker</groupId>
+            <artifactId>freemarker</artifactId>
+        </dependency>
+    </dependencies>
+
+</project>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/8c4007f1/platform/marmotta-versioning-kiwi/pom.xml
----------------------------------------------------------------------
diff --git a/platform/marmotta-versioning-kiwi/pom.xml b/platform/marmotta-versioning-kiwi/pom.xml
index a7ce33c..c203a75 100644
--- a/platform/marmotta-versioning-kiwi/pom.xml
+++ b/platform/marmotta-versioning-kiwi/pom.xml
@@ -28,12 +28,13 @@
     <artifactId>marmotta-versioning-kiwi</artifactId>
     <packaging>jar</packaging>
 
-    <name>Apache Marmotta Platform: Versioning</name>
+    <name>Apache Marmotta Platform: Versioning (KiWi Backend)</name>
     <description>
         This module provides versioning support for all modifications of the data contained in the LMF System (triples,
         resources, namespaces). Versions are accessible according to the Memento protocol using a special webservice.
         Versioning is triggered when a transaction finishes successfully and will store additional
         versioning information in the database. Note that this implies a certain performance overhead.
+        This module contains the KiWi backend for versioning.
     </description>
 
     <build>
@@ -157,16 +158,17 @@
         </dependency>
         <dependency>
             <groupId>org.apache.marmotta</groupId>
-            <artifactId>marmotta-backend-kiwi</artifactId>
+            <artifactId>marmotta-versioning-common</artifactId>
             <version>${project.version}</version>
         </dependency>
         <dependency>
             <groupId>org.apache.marmotta</groupId>
-            <artifactId>kiwi-versioning</artifactId>
+            <artifactId>marmotta-backend-kiwi</artifactId>
+            <version>${project.version}</version>
         </dependency>
         <dependency>
-            <groupId>org.freemarker</groupId>
-            <artifactId>freemarker</artifactId>
+            <groupId>org.apache.marmotta</groupId>
+            <artifactId>kiwi-versioning</artifactId>
         </dependency>
     </dependencies>
 

http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/8c4007f1/platform/pom.xml
----------------------------------------------------------------------
diff --git a/platform/pom.xml b/platform/pom.xml
index fff7130..b095064 100644
--- a/platform/pom.xml
+++ b/platform/pom.xml
@@ -65,6 +65,9 @@
         <module>marmotta-sparql</module>
         <module>marmotta-user</module>
 
+        <module>marmotta-ldcache-common</module>
+        <module>marmotta-versioning-common</module>
+
         <!-- KiWi backend specific modules -->
         <module>marmotta-ldcache-kiwi</module>
         <module>marmotta-reasoner-kiwi</module>


Mime
View raw message