You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@marmotta.apache.org by ss...@apache.org on 2013/10/21 17:27:47 UTC
[6/6] git commit: reorganize platform modules to give more overview
over different backends
reorganize platform modules to give more overview over different backends
Project: http://git-wip-us.apache.org/repos/asf/incubator-marmotta/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-marmotta/commit/47855a4b
Tree: http://git-wip-us.apache.org/repos/asf/incubator-marmotta/tree/47855a4b
Diff: http://git-wip-us.apache.org/repos/asf/incubator-marmotta/diff/47855a4b
Branch: refs/heads/develop
Commit: 47855a4bcfaabda6d9faff66c72fa83f79942805
Parents: 91a7f21
Author: Sebastian Schaffert <ss...@apache.org>
Authored: Mon Oct 21 17:27:35 2013 +0200
Committer: Sebastian Schaffert <ss...@apache.org>
Committed: Mon Oct 21 17:27:35 2013 +0200
----------------------------------------------------------------------
.../backends/marmotta-backend-bigdata/pom.xml | 193 ++++++++++
.../bigdata/BigDataSesame27Repository.java | 144 ++++++++
.../backend/bigdata/BigDataSesame27Sail.java | 281 +++++++++++++++
.../backend/bigdata/BigDataStoreProvider.java | 125 +++++++
.../src/main/resources/META-INF/beans.xml | 28 ++
.../main/resources/config-defaults.properties | 24 ++
.../resources/config-descriptions.properties | 24 ++
.../src/main/resources/kiwi-module.properties | 38 ++
.../src/main/resources/web/admin/about.html | 43 +++
.../main/resources/web/admin/configuration.html | 53 +++
platform/backends/marmotta-backend-kiwi/pom.xml | 172 +++++++++
.../backend/kiwi/DatabaseWebService.java | 109 ++++++
.../kiwi/KiWiGarbageCollectionProvider.java | 46 +++
.../backend/kiwi/KiWiStoreProvider.java | 161 +++++++++
.../src/main/resources/META-INF/beans.xml | 28 ++
.../main/resources/config-defaults.properties | 75 ++++
.../resources/config-descriptions.properties | 61 ++++
.../src/main/resources/kiwi-module.properties | 41 +++
.../src/main/resources/web/admin/about.html | 62 ++++
.../main/resources/web/admin/configuration.html | 46 +++
.../src/main/resources/web/admin/database.html | 37 ++
.../resources/web/admin/js/widgets/database.js | 303 ++++++++++++++++
.../backends/marmotta-backend-memory/pom.xml | 154 ++++++++
.../backend/memory/MemoryStoreProvider.java | 83 +++++
.../src/main/resources/META-INF/beans.xml | 28 ++
.../src/main/resources/kiwi-module.properties | 38 ++
.../backends/marmotta-backend-native/pom.xml | 170 +++++++++
.../backend/sesame/NativeStoreProvider.java | 94 +++++
.../src/main/resources/META-INF/beans.xml | 28 ++
.../src/main/resources/kiwi-module.properties | 38 ++
platform/backends/pom.xml | 72 ++++
.../ldcache/marmotta-ldcache-common/pom.xml | 198 ++++++++++
.../api/endpoint/LinkedDataEndpointService.java | 87 +++++
.../api/ldcache/LDCacheSailProvider.java | 191 ++++++++++
.../model/filter/LDCacheIgnoreFilter.java | 32 ++
.../model/filter/MarmottaNotCachedFilter.java | 85 +++++
.../endpoint/LinkedDataEndpointServiceImpl.java | 207 +++++++++++
.../LinkedDataCachingWebService.java | 313 ++++++++++++++++
.../src/main/resources/META-INF/beans.xml | 28 ++
.../main/resources/config-defaults.properties | 49 +++
.../resources/config-descriptions.properties | 41 +++
.../src/main/resources/kiwi-module.properties | 35 ++
.../src/main/resources/web/admin/about.html | 271 ++++++++++++++
.../main/resources/web/admin/configuration.html | 83 +++++
.../main/resources/web/admin/img/ld-caching.png | Bin 0 -> 758 bytes
.../resources/web/admin/widgets/lmf_ldcache.js | 360 +++++++++++++++++++
platform/ldcache/marmotta-ldcache-file/pom.xml | 174 +++++++++
.../services/kiwi/FileLDCacheSailProvider.java | 131 +++++++
.../src/main/resources/META-INF/beans.xml | 28 ++
platform/ldcache/marmotta-ldcache-kiwi/pom.xml | 174 +++++++++
.../services/kiwi/KiWiLDCacheSailProvider.java | 113 ++++++
.../src/main/resources/META-INF/beans.xml | 28 ++
platform/ldcache/pom.xml | 65 ++++
platform/marmotta-backend-bigdata/pom.xml | 193 ----------
.../bigdata/BigDataSesame27Repository.java | 145 --------
.../backend/bigdata/BigDataSesame27Sail.java | 283 ---------------
.../backend/bigdata/BigDataStoreProvider.java | 125 -------
.../src/main/resources/META-INF/beans.xml | 28 --
.../main/resources/config-defaults.properties | 24 --
.../resources/config-descriptions.properties | 24 --
.../src/main/resources/kiwi-module.properties | 38 --
.../src/main/resources/web/admin/about.html | 43 ---
.../main/resources/web/admin/configuration.html | 53 ---
platform/marmotta-backend-kiwi/pom.xml | 172 ---------
.../backend/kiwi/DatabaseWebService.java | 109 ------
.../kiwi/KiWiGarbageCollectionProvider.java | 46 ---
.../backend/kiwi/KiWiStoreProvider.java | 161 ---------
.../src/main/resources/META-INF/beans.xml | 28 --
.../main/resources/config-defaults.properties | 75 ----
.../resources/config-descriptions.properties | 61 ----
.../src/main/resources/kiwi-module.properties | 41 ---
.../src/main/resources/web/admin/about.html | 62 ----
.../main/resources/web/admin/configuration.html | 46 ---
.../src/main/resources/web/admin/database.html | 37 --
.../resources/web/admin/js/widgets/database.js | 303 ----------------
platform/marmotta-backend-native/pom.xml | 170 ---------
.../backend/sesame/NativeStoreProvider.java | 94 -----
.../src/main/resources/META-INF/beans.xml | 28 --
.../src/main/resources/kiwi-module.properties | 41 ---
.../core/test/base/TestStoreProvider.java | 8 +-
platform/marmotta-ldcache-common/pom.xml | 198 ----------
.../api/endpoint/LinkedDataEndpointService.java | 87 -----
.../api/ldcache/LDCacheSailProvider.java | 191 ----------
.../model/filter/LDCacheIgnoreFilter.java | 32 --
.../model/filter/MarmottaNotCachedFilter.java | 85 -----
.../endpoint/LinkedDataEndpointServiceImpl.java | 207 -----------
.../LinkedDataCachingWebService.java | 314 ----------------
.../src/main/resources/META-INF/beans.xml | 28 --
.../main/resources/config-defaults.properties | 49 ---
.../resources/config-descriptions.properties | 41 ---
.../src/main/resources/kiwi-module.properties | 35 --
.../src/main/resources/web/admin/about.html | 271 --------------
.../main/resources/web/admin/configuration.html | 83 -----
.../main/resources/web/admin/img/ld-caching.png | Bin 758 -> 0 bytes
.../resources/web/admin/widgets/lmf_ldcache.js | 360 -------------------
platform/marmotta-ldcache-file/pom.xml | 174 ---------
.../services/kiwi/FileLDCacheSailProvider.java | 131 -------
.../src/main/resources/META-INF/beans.xml | 28 --
platform/marmotta-ldcache-kiwi/pom.xml | 174 ---------
.../services/kiwi/KiWiLDCacheSailProvider.java | 113 ------
.../src/main/resources/META-INF/beans.xml | 28 --
platform/pom.xml | 18 +-
102 files changed, 5496 insertions(+), 5081 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/47855a4b/platform/backends/marmotta-backend-bigdata/pom.xml
----------------------------------------------------------------------
diff --git a/platform/backends/marmotta-backend-bigdata/pom.xml b/platform/backends/marmotta-backend-bigdata/pom.xml
new file mode 100644
index 0000000..28cd8fe
--- /dev/null
+++ b/platform/backends/marmotta-backend-bigdata/pom.xml
@@ -0,0 +1,193 @@
+<?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>
+
+ <groupId>org.apache.marmotta</groupId>
+ <artifactId>marmotta-backend-bigdata</artifactId>
+
+ <name>Apache Marmotta Platform: BigData Backend</name>
+ <description>
+ This module provides an Apache Marmotta backend using a BigData Store. This is a suitable backend in
+ high performance or big data scenarios. It does not support rule-based reasoning and versioning. NOTE:
+ This backend uses the GPL licensed BigData library from http://www.systap.com/bigdata.htm. Software using
+ this backend therefore needs to clarify the licensing before distributing.
+ </description>
+
+ <repositories>
+ <repository>
+ <id>bigdata.releases</id>
+ <url>http://www.systap.com/maven/releases/</url>
+ </repository>
+ </repositories>
+
+ <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.apache.marmotta</groupId>
+ <artifactId>kiwi-transactions</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>com.bigdata</groupId>
+ <artifactId>bigdata</artifactId>
+ <version>1.2.3</version>
+ <exclusions>
+ <exclusion>
+ <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>
+
+</project>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/47855a4b/platform/backends/marmotta-backend-bigdata/src/main/java/org/apache/marmotta/platform/backend/bigdata/BigDataSesame27Repository.java
----------------------------------------------------------------------
diff --git a/platform/backends/marmotta-backend-bigdata/src/main/java/org/apache/marmotta/platform/backend/bigdata/BigDataSesame27Repository.java b/platform/backends/marmotta-backend-bigdata/src/main/java/org/apache/marmotta/platform/backend/bigdata/BigDataSesame27Repository.java
new file mode 100644
index 0000000..9d6d718
--- /dev/null
+++ b/platform/backends/marmotta-backend-bigdata/src/main/java/org/apache/marmotta/platform/backend/bigdata/BigDataSesame27Repository.java
@@ -0,0 +1,144 @@
+/*
+ * 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.sail.BigdataSailRepositoryConnection;
+import com.bigdata.rdf.store.AbstractTripleStore;
+import org.openrdf.query.MalformedQueryException;
+import org.openrdf.query.QueryLanguage;
+import org.openrdf.query.Update;
+import org.openrdf.repository.RepositoryException;
+import org.openrdf.sail.Sail;
+import org.openrdf.sail.SailConnection;
+import org.openrdf.sail.SailException;
+import org.openrdf.sail.helpers.SailConnectionWrapper;
+import org.openrdf.sail.helpers.SailWrapper;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * A wrapper to allow using BigData in a modular Sesame 2.7 environment. Provides a fast lane to the BigData SPARQL
+ * implementation.
+ * <p/>
+ * The implementation essentially wraps the BigdataSailRepository provided by BigData, but also allows using a
+ * sail stack.
+ *
+ * @author Sebastian Schaffert (sschaffert@apache.org)
+ */
+public class BigDataSesame27Repository extends SailRepository {
+
+ private static Logger log = LoggerFactory.getLogger(BigDataSesame27Repository.class);
+
+ private Sail wrapped;
+
+ public BigDataSesame27Repository(Sail sail) {
+ super(sail);
+ }
+
+ /**
+ * Return the wrapped bigdata sail, even if it is somewhere deep in the stack
+ * @return
+ */
+ private BigdataSail getBaseSail() {
+ Sail sail = wrapped;
+ while(sail instanceof SailWrapper) {
+ sail = ((SailWrapper) sail).getBaseSail();
+ }
+ if(sail instanceof BigDataSesame27Sail) {
+ return ((BigDataSesame27Sail) sail).getWrapped();
+ }
+ if(sail instanceof BigdataSail) {
+ return (BigdataSail) sail;
+ }
+ return null;
+ }
+
+ private BigdataSail.BigdataSailConnection getBaseSailConnection(SailConnection con) {
+ SailConnection wrapped = con;
+ while(wrapped instanceof SailConnectionWrapper) {
+ wrapped = ((SailConnectionWrapper) wrapped).getWrappedConnection();
+ }
+ if(wrapped instanceof BigDataSesame27Sail.BigDataSesame27SailConnection) {
+ return ((BigDataSesame27Sail.BigDataSesame27SailConnection) wrapped).getWrapped();
+ }
+ if(wrapped instanceof BigdataSail.BigdataSailConnection) {
+ return (BigdataSail.BigdataSailConnection) wrapped;
+ }
+ return null;
+ }
+
+ /**
+ * Direct access to the Bigdata database (for SPARQL query evaluation).
+ *
+ * @return
+ */
+ public AbstractTripleStore getDatabase() {
+ return getBaseSail().getDatabase();
+ }
+
+
+ /**
+ * Return a custom version of a repository connection with special SPARQL optimizations.
+ * Similar to {@link com.bigdata.rdf.sail.BigdataSailRepositoryConnection}, but a nicer citizen
+ * in a sail stack.
+ *
+ * @return
+ * @throws RepositoryException
+ */
+ @Override
+ public SailRepositoryConnection getConnection() throws RepositoryException {
+ try {
+ final SailConnection con = getSail().getConnection();
+
+ // a wrapper so we can access the SPARQL implementations without needing to replicate their code
+ final BigdataSailRepositoryConnection wrapped = new BigdataSailRepositoryConnection(null,getBaseSailConnection(con));
+
+ return new SailRepositoryConnection(this, con) {
+
+
+ @Override
+ public SailBooleanQuery prepareBooleanQuery(QueryLanguage ql, String queryString, String baseURI) throws MalformedQueryException {
+ return wrapped.prepareBooleanQuery(ql, queryString, baseURI);
+ }
+
+ @Override
+ public SailGraphQuery prepareGraphQuery(QueryLanguage ql, String queryString, String baseURI) throws MalformedQueryException {
+ return wrapped.prepareGraphQuery(ql, queryString, baseURI);
+ }
+
+ @Override
+ public SailQuery prepareQuery(QueryLanguage ql, String queryString, String baseURI) throws MalformedQueryException {
+ return wrapped.prepareQuery(ql,queryString,baseURI);
+ }
+
+ @Override
+ public SailTupleQuery prepareTupleQuery(QueryLanguage ql, String queryString, String baseURI) throws MalformedQueryException {
+ return wrapped.prepareTupleQuery(ql, queryString, baseURI);
+ }
+
+ @Override
+ public Update prepareUpdate(QueryLanguage ql, String update, String baseURI) throws RepositoryException, MalformedQueryException {
+ return wrapped.prepareUpdate(ql, update, baseURI);
+ }
+ };
+ } catch (SailException e) {
+ throw new RepositoryException("could not create repository connection",e);
+ }
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/47855a4b/platform/backends/marmotta-backend-bigdata/src/main/java/org/apache/marmotta/platform/backend/bigdata/BigDataSesame27Sail.java
----------------------------------------------------------------------
diff --git a/platform/backends/marmotta-backend-bigdata/src/main/java/org/apache/marmotta/platform/backend/bigdata/BigDataSesame27Sail.java b/platform/backends/marmotta-backend-bigdata/src/main/java/org/apache/marmotta/platform/backend/bigdata/BigDataSesame27Sail.java
new file mode 100644
index 0000000..0cc5613
--- /dev/null
+++ b/platform/backends/marmotta-backend-bigdata/src/main/java/org/apache/marmotta/platform/backend/bigdata/BigDataSesame27Sail.java
@@ -0,0 +1,281 @@
+/*
+ * 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.query.BindingSet;
+import org.openrdf.query.Dataset;
+import org.openrdf.query.QueryEvaluationException;
+import org.openrdf.query.algebra.TupleExpr;
+import org.openrdf.sail.helpers.NotifyingSailBase;
+import org.openrdf.sail.helpers.NotifyingSailConnectionBase;
+import org.openrdf.sail.helpers.SailBase;
+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 {
+ return new BigDataSesame27SailConnection(this,wrapped.getConnection());
+ }
+
+ /**
+ * 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();
+ }
+
+ /**
+ * Get the wrapped BigdataSail
+ *
+ * @return
+ */
+ protected BigdataSail getWrapped() {
+ return wrapped;
+ }
+
+ /**
+ * A wrapper around the (Sesame 2.6) BigdataSailConnection, adding the new API methods of Sesame 2.7
+ */
+ protected static class BigDataSesame27SailConnection extends NotifyingSailConnectionBase {
+ BigdataSail.BigdataSailConnection con;
+
+ public BigDataSesame27SailConnection(SailBase sailBase, BigdataSail.BigdataSailConnection con) {
+ super(sailBase);
+ this.con = con;
+ }
+
+ protected BigdataSail.BigdataSailConnection getWrapped() {
+ return con;
+ }
+
+ @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();
+ }
+
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/47855a4b/platform/backends/marmotta-backend-bigdata/src/main/java/org/apache/marmotta/platform/backend/bigdata/BigDataStoreProvider.java
----------------------------------------------------------------------
diff --git a/platform/backends/marmotta-backend-bigdata/src/main/java/org/apache/marmotta/platform/backend/bigdata/BigDataStoreProvider.java b/platform/backends/marmotta-backend-bigdata/src/main/java/org/apache/marmotta/platform/backend/bigdata/BigDataStoreProvider.java
new file mode 100644
index 0000000..5ae5b60
--- /dev/null
+++ b/platform/backends/marmotta-backend-bigdata/src/main/java/org/apache/marmotta/platform/backend/bigdata/BigDataStoreProvider.java
@@ -0,0 +1,125 @@
+/*
+ * 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.Banner;
+import com.bigdata.rdf.sail.BigdataSail;
+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;
+import java.io.File;
+import java.util.Properties;
+
+/**
+ * A store provider implementation for Apache Marmotta providing instances of "BigData" stores. This provider uses
+ * the BigData library developed by SysTap (http://www.systap.com/bigdata.htm).
+ *
+ *
+ * NOTE: the BigData library is published under GPL license, and therefore requires special consideration when distributing packages.
+ *
+ * @author Sebastian Schaffert (sschaffert@apache.org)
+ */
+@ApplicationScoped
+public class BigDataStoreProvider implements StoreProvider {
+
+ @Inject
+ private Logger log;
+
+ @Inject
+ private ConfigurationService configurationService;
+
+
+ @Inject
+ private SesameService sesameService;
+
+
+
+ /**
+ * Create the store provided by this SailProvider
+ *
+ * @return a new instance of the store
+ */
+ @Override
+ public NotifyingSail createStore() {
+ log.info("Initializing Backend: BigData Store");
+
+ File journal = new File(configurationService.getHome() + File.separator + "bigdata" + File.separator + "bigdata.jnl");
+
+ 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, ""+configurationService.getBooleanConfiguration("bigdata.textIndex",true));
+ properties.setProperty( Banner.Options.LOG4J_MBEANS_DISABLE, "true");
+
+
+ return new BigDataSesame27Sail(properties);
+ }
+
+
+ public void configurationChanged(@Observes ConfigurationChangedEvent e) {
+ if(e.containsChangedKeyWithPrefix("bigdata")) {
+ sesameService.restart();
+ }
+ }
+
+
+ /**
+ * Create the repository using the sail given as argument. This method is needed because some backends
+ * use custom implementations of SailRepository.
+ *
+ * @param sail
+ * @return
+ */
+ @Override
+ public SailRepository createRepository(Sail sail) {
+ return new BigDataSesame27Repository(sail);
+ }
+
+
+ /**
+ * Return the name of the provider. Used e.g. for displaying status information or logging.
+ *
+ * @return
+ */
+ @Override
+ public String getName() {
+ return "BigData Store";
+ }
+
+ /**
+ * Return true if this sail provider is enabled in the configuration.
+ *
+ * @return
+ */
+ @Override
+ public boolean isEnabled() {
+ return true;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/47855a4b/platform/backends/marmotta-backend-bigdata/src/main/resources/META-INF/beans.xml
----------------------------------------------------------------------
diff --git a/platform/backends/marmotta-backend-bigdata/src/main/resources/META-INF/beans.xml b/platform/backends/marmotta-backend-bigdata/src/main/resources/META-INF/beans.xml
new file mode 100644
index 0000000..461858e
--- /dev/null
+++ b/platform/backends/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/47855a4b/platform/backends/marmotta-backend-bigdata/src/main/resources/config-defaults.properties
----------------------------------------------------------------------
diff --git a/platform/backends/marmotta-backend-bigdata/src/main/resources/config-defaults.properties b/platform/backends/marmotta-backend-bigdata/src/main/resources/config-defaults.properties
new file mode 100644
index 0000000..787484e
--- /dev/null
+++ b/platform/backends/marmotta-backend-bigdata/src/main/resources/config-defaults.properties
@@ -0,0 +1,24 @@
+#
+# 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.
+#
+
+
+###############################################################################
+# BigData storage configuration
+###############################################################################
+
+bigdata.textIndex = true
+
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/47855a4b/platform/backends/marmotta-backend-bigdata/src/main/resources/config-descriptions.properties
----------------------------------------------------------------------
diff --git a/platform/backends/marmotta-backend-bigdata/src/main/resources/config-descriptions.properties b/platform/backends/marmotta-backend-bigdata/src/main/resources/config-descriptions.properties
new file mode 100644
index 0000000..3d44328
--- /dev/null
+++ b/platform/backends/marmotta-backend-bigdata/src/main/resources/config-descriptions.properties
@@ -0,0 +1,24 @@
+#
+# 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.
+#
+
+###############################################################################
+# BigData storage configuration
+###############################################################################
+
+bigdata.textIndex.description = Boolean option (default "true") enables support for a full text index that may be used \
+ to lookup literals by tokens found in the text of those literals
+bigdata.textIndex.type = java.lang.Boolean
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/47855a4b/platform/backends/marmotta-backend-bigdata/src/main/resources/kiwi-module.properties
----------------------------------------------------------------------
diff --git a/platform/backends/marmotta-backend-bigdata/src/main/resources/kiwi-module.properties b/platform/backends/marmotta-backend-bigdata/src/main/resources/kiwi-module.properties
new file mode 100644
index 0000000..833473d
--- /dev/null
+++ b/platform/backends/marmotta-backend-bigdata/src/main/resources/kiwi-module.properties
@@ -0,0 +1,38 @@
+#
+# 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.
+#
+
+name=Storage Backend: BigData
+
+container=Generic
+container.weight = 10
+
+subtitle = Configure BigData Backend
+weight = 10
+
+icon_small = /admin/img/config_small.png
+
+#do not change!!!
+baseurl=/storage-bigdata
+
+adminpage.0.title=About
+adminpage.0.link=/admin/about.html
+
+adminpage.1.title=Configuration
+adminpage.1.link=/admin/configuration.html
+
+webservices=
+
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/47855a4b/platform/backends/marmotta-backend-bigdata/src/main/resources/web/admin/about.html
----------------------------------------------------------------------
diff --git a/platform/backends/marmotta-backend-bigdata/src/main/resources/web/admin/about.html b/platform/backends/marmotta-backend-bigdata/src/main/resources/web/admin/about.html
new file mode 100644
index 0000000..cb5651e
--- /dev/null
+++ b/platform/backends/marmotta-backend-bigdata/src/main/resources/web/admin/about.html
@@ -0,0 +1,43 @@
+<!--
+ ~ 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.
+ -->
+<html>
+<head>
+ <!--###BEGIN_HEAD###-->
+ <title>Storage Backend: BigData</title>
+ <!--###END_HEAD###-->
+</head>
+<body>
+<!--###BEGIN_CONTENT###-->
+<h1>Storage Backend: BigData</h1>
+
+<p>
+ This module provides an Apache Marmotta storage backend based on the <a href="http://www.systap.com/bigdata.htm">BigData</a>
+ triple store. BigData is a highly scalable, highly performant, highly concurrent triple store implementation that you can
+ use in cases where your volume of data is very high and/or you do not want/need to store your data in a relational database
+ as with the KiWi backend.
+</p>
+<p>
+ <strong>Note:</strong> The BigData triple store is licensed under
+ <a href="http://www.gnu.org/licenses/old-licenses/gpl-2.0.html">GNU General Public License (GPLv2)</a>. For you, this
+ means that you cannot distribute custom packages making use of this backend if you do not obtain a separate license from
+ Systap. For the same reason, the Apache Marmotta team also cannot offer pre-packaged distributions. However, if you
+ build the distribution for your own use, you are free to use the system without additional license requirements.
+</p>
+<!--###END_CONTENT###-->
+</body>
+</html>
+
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/47855a4b/platform/backends/marmotta-backend-bigdata/src/main/resources/web/admin/configuration.html
----------------------------------------------------------------------
diff --git a/platform/backends/marmotta-backend-bigdata/src/main/resources/web/admin/configuration.html b/platform/backends/marmotta-backend-bigdata/src/main/resources/web/admin/configuration.html
new file mode 100644
index 0000000..2631de0
--- /dev/null
+++ b/platform/backends/marmotta-backend-bigdata/src/main/resources/web/admin/configuration.html
@@ -0,0 +1,53 @@
+<!--
+ ~ 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.
+ -->
+<html>
+<head>
+<title>Storage Backend: BigData</title>
+<script type="text/javascript">
+ var _SERVER_URL = "http://localhost:8080/LMF/";
+</script>
+<!--###BEGIN_HEAD###-->
+ <script type="text/javascript" src="../../webjars/jquery/1.8.2/jquery.min.js"></script>
+ <script type="text/javascript" src="../../core/public/js/widgets/configurator/configurator.js"></script>
+ <link rel="stylesheet" href="style.css" />
+ <link type="text/css" rel="stylesheet" href="../../core/public/js/widgets/configurator/style.css">
+ <script type="text/javascript">
+ jQuery(document).ready(function(){
+ var options = {
+ url : _SERVER_URL,
+ container : "bigdata_configurator",
+ prefix : 'bigdata'
+ }
+ var configurator = new Configurator(options);
+ });
+ </script>
+<!--###END_HEAD###-->
+</head>
+<body>
+ <!--###BEGIN_CONTENT###-->
+ <h1>BigData Backend Configuration</h1>
+ <p>
+ Here you can configure options offered by the BigData triple store. Some documentation on these options is available
+ <a href="http://www.bigdata.com/bigdata/docs/api/com/bigdata/rdf/sail/BigdataSail.Options.html">at the BigData webpage</a><br />
+ The configuration currently contains:
+ </p>
+ <div id="bigdata_configurator">
+ <h4>Loading configurator</h4>
+ </div>
+ <!--###END_CONTENT###-->
+</body>
+</html>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/47855a4b/platform/backends/marmotta-backend-kiwi/pom.xml
----------------------------------------------------------------------
diff --git a/platform/backends/marmotta-backend-kiwi/pom.xml b/platform/backends/marmotta-backend-kiwi/pom.xml
new file mode 100644
index 0000000..f715228
--- /dev/null
+++ b/platform/backends/marmotta-backend-kiwi/pom.xml
@@ -0,0 +1,172 @@
+<?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>
+
+ <groupId>org.apache.marmotta</groupId>
+ <artifactId>marmotta-backend-kiwi</artifactId>
+
+ <name>Apache Marmotta Platform: KiWi Backend</name>
+ <description>
+ This module provides an Apache Marmotta backend based on the KiWi triple store. This is a reasonable setting
+ for most setups, provides more features than other backends and is therefore also the default backend for Marmotta.
+ </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.apache.marmotta</groupId>
+ <artifactId>kiwi-triplestore</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.marmotta</groupId>
+ <artifactId>kiwi-sparql</artifactId>
+ </dependency>
+ </dependencies>
+
+
+
+</project>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/47855a4b/platform/backends/marmotta-backend-kiwi/src/main/java/org/apache/marmotta/platform/backend/kiwi/DatabaseWebService.java
----------------------------------------------------------------------
diff --git a/platform/backends/marmotta-backend-kiwi/src/main/java/org/apache/marmotta/platform/backend/kiwi/DatabaseWebService.java b/platform/backends/marmotta-backend-kiwi/src/main/java/org/apache/marmotta/platform/backend/kiwi/DatabaseWebService.java
new file mode 100644
index 0000000..8c68a96
--- /dev/null
+++ b/platform/backends/marmotta-backend-kiwi/src/main/java/org/apache/marmotta/platform/backend/kiwi/DatabaseWebService.java
@@ -0,0 +1,109 @@
+/*
+ * 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.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;
+import javax.inject.Inject;
+import javax.ws.rs.POST;
+import javax.ws.rs.Path;
+import javax.ws.rs.QueryParam;
+import javax.ws.rs.core.Response;
+import java.sql.Connection;
+import java.sql.DriverManager;
+import java.sql.SQLException;
+
+/**
+ * Add file description here!
+ *
+ * @author Sebastian Schaffert (sschaffert@apache.org)
+ */
+@Path("/storage-kiwi")
+@ApplicationScoped
+public class DatabaseWebService {
+
+
+ @Inject
+ private Logger log;
+
+ @Inject
+ private ConfigurationService configurationService;
+
+ @Inject
+ private SesameService sesameService;
+
+
+ @POST
+ @Path("/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) {
+ return Response.status(400).entity("one or more values are not defined").build();
+ }
+
+ //get driver
+ String db_driver = configurationService.getStringConfiguration("database."+type+".driver");
+ if(db_driver==null) {
+ return ErrorResponse.errorResponse(Response.Status.INTERNAL_SERVER_ERROR, "driver for " + type + " not defined");
+ }
+
+ //try if type matches url
+ if(!url.startsWith("jdbc:"+type)) {
+ return ErrorResponse.errorResponse(Response.Status.INTERNAL_SERVER_ERROR,"database and url do not match properly");
+ }
+
+ //try to connect
+ try {
+ Class.forName(db_driver);
+ Connection conn = DriverManager.getConnection(url, user, pwd);
+ conn.close();
+ return Response.ok().build();
+ } catch (ClassNotFoundException e) {
+ return ErrorResponse.errorResponse(Response.Status.INTERNAL_SERVER_ERROR,"Can't load driver ",e);
+ } catch (SQLException e) {
+ return ErrorResponse.errorResponse(Response.Status.INTERNAL_SERVER_ERROR,"Database access failed ",e);
+ }
+ }
+
+ /**
+ * 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("/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);
+ }
+ }
+
+
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/47855a4b/platform/backends/marmotta-backend-kiwi/src/main/java/org/apache/marmotta/platform/backend/kiwi/KiWiGarbageCollectionProvider.java
----------------------------------------------------------------------
diff --git a/platform/backends/marmotta-backend-kiwi/src/main/java/org/apache/marmotta/platform/backend/kiwi/KiWiGarbageCollectionProvider.java b/platform/backends/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/backends/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/47855a4b/platform/backends/marmotta-backend-kiwi/src/main/java/org/apache/marmotta/platform/backend/kiwi/KiWiStoreProvider.java
----------------------------------------------------------------------
diff --git a/platform/backends/marmotta-backend-kiwi/src/main/java/org/apache/marmotta/platform/backend/kiwi/KiWiStoreProvider.java b/platform/backends/marmotta-backend-kiwi/src/main/java/org/apache/marmotta/platform/backend/kiwi/KiWiStoreProvider.java
new file mode 100644
index 0000000..c406f88
--- /dev/null
+++ b/platform/backends/marmotta-backend-kiwi/src/main/java/org/apache/marmotta/platform/backend/kiwi/KiWiStoreProvider.java
@@ -0,0 +1,161 @@
+/*
+ * 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.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.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;
+
+/**
+ * A store implementation providing an instance of a KiWi triple store as backend for the Marmotta platform. Uses the
+ * following configuration properties from the configuration service:
+ * <ul>
+ * <li>database.type: which database dialect to use (currently "h2", "mysql", "postgres")</li>
+ * <li>database.url: the JDBC url of the database to connect to</li>
+ * <li>database.user: the user to use for connecting to the database</li>
+ * <li>database.password: the password to use for connecting to the database</li>
+ * <li>database.batchcommit: commit triples in batches instead of individual inserts - faster but no recovery if
+ * system stops during transaction</li>
+ * <li>database.batchsize: how many triples to keep in one batch (default 10000)</li>
+ * <li>database.generator: which strategy to use for generating database ids (options are "snowflake", "database",
+ * "memory", "uuid-time", and "uuid-random", "snowflake" is very fast and reliable and therefore preferred)</li>
+ * </ul>
+ *
+ * @author Sebastian Schaffert (sschaffert@apache.org)
+ */
+@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
+ *
+ * @return a new instance of the store
+ */
+ @Override
+ public NotifyingSail createStore() {
+ log.info("Initializing Backend: KiWi Store");
+
+ 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");
+
+ KiWiConfiguration configuration = new KiWiConfiguration("lmf", jdbcUrl, dbUser, dbPass, dialect, configurationService.getDefaultContext(), configurationService.getInferredContext());
+ configuration.setQueryLoggingEnabled(configurationService.getBooleanConfiguration("database.debug.slowqueries",false));
+ configuration.setTripleBatchCommit(configurationService.getBooleanConfiguration("database.triples.batchcommit", true));
+ configuration.setTripleBatchSize(configurationService.getIntConfiguration("database.triples.batchsize", 10000));
+ configuration.setNodeBatchCommit(configurationService.getBooleanConfiguration("database.nodes.batchcommit", true));
+ configuration.setNodeBatchSize(configurationService.getIntConfiguration("database.nodes.batchsize", 1000));
+
+ 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("native".equalsIgnoreCase(configurationService.getStringConfiguration(SPARQL_STRATEGY))) {
+ return new KiWiSparqlSail(new KiWiStore(configuration));
+ } else {
+ return new KiWiStore(configuration);
+ }
+ }
+
+ /**
+ * Create the repository using the sail given as argument. This method is needed because some backends
+ * use custom implementations of SailRepository.
+ *
+ * @param sail
+ * @return
+ */
+ @Override
+ public SailRepository createRepository(Sail sail) {
+ return new SailRepository(sail);
+ }
+
+ /**
+ * Return the name of the provider. Used e.g. for displaying status information or logging.
+ *
+ * @return
+ */
+ @Override
+ public String getName() {
+ return "KiWi Store";
+ }
+
+ /**
+ * Return true if this sail provider is enabled in the configuration.
+ *
+ * @return
+ */
+ @Override
+ 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/47855a4b/platform/backends/marmotta-backend-kiwi/src/main/resources/META-INF/beans.xml
----------------------------------------------------------------------
diff --git a/platform/backends/marmotta-backend-kiwi/src/main/resources/META-INF/beans.xml b/platform/backends/marmotta-backend-kiwi/src/main/resources/META-INF/beans.xml
new file mode 100644
index 0000000..461858e
--- /dev/null
+++ b/platform/backends/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/47855a4b/platform/backends/marmotta-backend-kiwi/src/main/resources/config-defaults.properties
----------------------------------------------------------------------
diff --git a/platform/backends/marmotta-backend-kiwi/src/main/resources/config-defaults.properties b/platform/backends/marmotta-backend-kiwi/src/main/resources/config-defaults.properties
new file mode 100644
index 0000000..dfd128a
--- /dev/null
+++ b/platform/backends/marmotta-backend-kiwi/src/main/resources/config-defaults.properties
@@ -0,0 +1,75 @@
+#
+# 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.
+#
+
+
+###############################################################################
+# KiWi database configuration
+###############################################################################
+
+# the database type (h2, postgres or mysql)
+database.type = h2
+
+# the URL to access the database
+database.url =
+
+# the database user
+database.user =
+
+# the database password
+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.triples.batchcommit = true
+
+# the maximum size of a batch before it is committed to the database; only applicable if batchcommit is enabled
+database.triples.batchsize = 10000
+
+# turn on batch commits for database transactions (EXPERIMENTAL); if supported by the database backend, this can
+# lead to considerable performance improvements
+database.nodes.batchcommit = true
+
+# the maximum size of a batch before it is committed to the database; only applicable if batchcommit is enabled
+database.nodes.batchsize = 1000
+
+
+# generator to use for creating database IDs; possible values are uuid-time, uuid-random, sequence, memory, snowflake
+database.generator = snowflake
+
+# 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
+
+# Hibernate-specific configuration for PostgreSQL
+database.postgres.driver = org.postgresql.Driver
+database.postgres.url = jdbc:postgresql://localhost:5432/lmf?prepareThreshold=3
+
+# Hibernate-specific configuration for MySQL
+database.mysql.driver = com.mysql.jdbc.Driver
+database.mysql.url = jdbc:mysql://localhost:3306/lmf?useUnicode=true&characterEncoding=UTF-8&rewriteBatchedStatements=true
+
+# Hibernate-specific configuration for Oracle
+database.oracle.url = jdbc:oracle:thin:@//localhost:1521/XE
+database.oracle.driver = oracle.jdbc.OracleDriver
+
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/47855a4b/platform/backends/marmotta-backend-kiwi/src/main/resources/config-descriptions.properties
----------------------------------------------------------------------
diff --git a/platform/backends/marmotta-backend-kiwi/src/main/resources/config-descriptions.properties b/platform/backends/marmotta-backend-kiwi/src/main/resources/config-descriptions.properties
new file mode 100644
index 0000000..4bf17df
--- /dev/null
+++ b/platform/backends/marmotta-backend-kiwi/src/main/resources/config-descriptions.properties
@@ -0,0 +1,61 @@
+#
+# 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.
+#
+
+###############################################################################
+# LMF database configuration
+###############################################################################
+
+database.type.description = the database type (h2, postgres or mysql)
+database.type.type = java.lang.Enum("h2"|"postgres"|"mysql"|"oracle")
+
+database.url.description = the URL to access the database
+database.url.type = java.net.URL
+
+database.user.description = the database user
+database.user.type = java.lang.String
+
+database.password.description = the database password
+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.triples.batchcommit.description = turn on batch commits when storing triples in database transactions (EXPERIMENTAL); \
+ if supported by the database backend, this can lead to considerable performance improvements
+database.triples.batchcommit.type = java.lang.Boolean
+
+database.triples.batchsize.description = the maximum size of a batch before it is committed to the database; only applicable if \
+ batchcommit is enabled
+database.triples.batchsize.type = java.lang.Integer(10|0|*)
+
+database.nodes.batchcommit.description = turn on batch commits when storing RDF nodes in database transactions (EXPERIMENTAL); \
+ if supported by the database backend, this can lead to considerable performance improvements; should be disabled in clustered setups
+database.nodes.batchcommit.type = java.lang.Boolean
+
+database.nodes.batchsize.description = the maximum size of a node batch before it is committed to the database; only applicable if \
+ batchcommit is enabled
+database.nodes.batchsize.type = java.lang.Integer(10|0|*)
+
+database.generator.description = generator for creating database identifiers; uuid-time creates unique identifiers based \
+ on time and machine, uuid-random creates random identifiers, sequence uses a database sequence, memory loads a database \
+ sequence and increments in-memory (fast but requires exclusive database access), snowflake uses the Twitter Snowflake \
+ algorithm (fast and reliable)
+database.generator.type = java.lang.Enum("uuid-time"|"uuid-random"|"sequence"|"memory"|"snowflake")
+
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/47855a4b/platform/backends/marmotta-backend-kiwi/src/main/resources/kiwi-module.properties
----------------------------------------------------------------------
diff --git a/platform/backends/marmotta-backend-kiwi/src/main/resources/kiwi-module.properties b/platform/backends/marmotta-backend-kiwi/src/main/resources/kiwi-module.properties
new file mode 100644
index 0000000..de7f308
--- /dev/null
+++ b/platform/backends/marmotta-backend-kiwi/src/main/resources/kiwi-module.properties
@@ -0,0 +1,41 @@
+#
+# 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.
+#
+
+name=Storage Backend: KiWi
+
+container=Generic
+container.weight = 10
+
+subtitle = Configure KiWi Backend
+weight = 10
+
+icon_small = /admin/img/config_small.png
+
+#do not change!!!
+baseurl=/storage-kiwi
+
+adminpage.0.title=About
+adminpage.0.link=/admin/about.html
+
+adminpage.1.title=Configuration
+adminpage.1.link=/admin/configuration.html
+
+adminpage.2.title=Database
+adminpage.2.link=/admin/database.html
+
+webservices=org.apache.marmotta.platform.backend.kiwi.DatabaseWebService
+
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/47855a4b/platform/backends/marmotta-backend-kiwi/src/main/resources/web/admin/about.html
----------------------------------------------------------------------
diff --git a/platform/backends/marmotta-backend-kiwi/src/main/resources/web/admin/about.html b/platform/backends/marmotta-backend-kiwi/src/main/resources/web/admin/about.html
new file mode 100644
index 0000000..706bfda
--- /dev/null
+++ b/platform/backends/marmotta-backend-kiwi/src/main/resources/web/admin/about.html
@@ -0,0 +1,62 @@
+<!--
+
+ 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.
+
+-->
+<html>
+<head>
+ <!--###BEGIN_HEAD###-->
+ <title>Core Module</title>
+ <!--###END_HEAD###-->
+</head>
+<body>
+<!--###BEGIN_CONTENT###-->
+<h1>Apache Marmotta</h1>
+<h2>
+ An Open Platform for Linked Data
+</h2>
+<p>The goal of Apache Marmotta is to provide an open implementation of a Linked Data Platform that can be used, extended, and deployed easily by organizations who want to publish Linked Data or build custom applications on Linked Data.</p>
+<p>You can find more information about the project and the supported features on <a href="http://marmotta.incubator.apache.org/">http://marmotta.incubator.apache.org</a>.</p>
+<h2>
+ Links to common features
+</h2>
+<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.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>
+ <li><a href="tasks.html">Inspect your tasks:</a> check the status of the running tasks.</li>
+</ul>
+
+<h2>Marmotta Modules</h2>
+<p>Apache Marmotta provides some modules:</p>
+<dl>
+ <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>
+</html>
+