You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@marmotta.apache.org by ja...@apache.org on 2013/10/24 17:09:22 UTC
[01/30] git commit: fix a small bug in configuration service
Updated Branches:
refs/heads/MARMOTTA-345 2651f76d5 -> e4df7bdb5
fix a small bug in configuration service
Project: http://git-wip-us.apache.org/repos/asf/incubator-marmotta/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-marmotta/commit/c7a58525
Tree: http://git-wip-us.apache.org/repos/asf/incubator-marmotta/tree/c7a58525
Diff: http://git-wip-us.apache.org/repos/asf/incubator-marmotta/diff/c7a58525
Branch: refs/heads/MARMOTTA-345
Commit: c7a5852561b1b1e8b1ce06e007bc386d38660dab
Parents: 8b12887
Author: Sebastian Schaffert <ss...@apache.org>
Authored: Wed Oct 16 10:57:16 2013 +0200
Committer: Sebastian Schaffert <ss...@apache.org>
Committed: Wed Oct 16 10:57:16 2013 +0200
----------------------------------------------------------------------
.../kiwi/sparql/test/ContextAwareTest.java | 40 ++++++++++++++++++++
.../config/ConfigurationServiceImpl.java | 1 +
2 files changed, 41 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/c7a58525/libraries/kiwi/kiwi-sparql/src/test/java/org/apache/marmotta/kiwi/sparql/test/ContextAwareTest.java
----------------------------------------------------------------------
diff --git a/libraries/kiwi/kiwi-sparql/src/test/java/org/apache/marmotta/kiwi/sparql/test/ContextAwareTest.java b/libraries/kiwi/kiwi-sparql/src/test/java/org/apache/marmotta/kiwi/sparql/test/ContextAwareTest.java
index 8f1cf2f..fa4fd0c 100644
--- a/libraries/kiwi/kiwi-sparql/src/test/java/org/apache/marmotta/kiwi/sparql/test/ContextAwareTest.java
+++ b/libraries/kiwi/kiwi-sparql/src/test/java/org/apache/marmotta/kiwi/sparql/test/ContextAwareTest.java
@@ -15,6 +15,7 @@ import org.openrdf.model.URI;
import org.openrdf.query.BindingSet;
import org.openrdf.query.QueryLanguage;
import org.openrdf.query.TupleQuery;
+import org.openrdf.query.impl.DatasetImpl;
import org.openrdf.repository.Repository;
import org.openrdf.repository.RepositoryConnection;
import org.openrdf.repository.RepositoryException;
@@ -161,4 +162,43 @@ public class ContextAwareTest {
}
}
+ @Test
+ public void testNamedGraphQuery() throws Exception {
+ ContextAwareConnection con = new ContextAwareConnection(repository, repository.getConnection());
+ try {
+ con.setInsertContext(context1);
+ con.setReadContexts(context1);
+ con.setRemoveContexts(context1);
+
+ Assert.assertTrue(con.hasStatement(subject,predicate1, object11));
+ Assert.assertFalse(con.hasStatement(subject, predicate2, object21));
+
+ String queryStr1 = "SELECT * WHERE { GRAPH <"+context1.stringValue()+"> { ?X ?P ?Y } }";
+
+ TupleQuery query1 = con.prepareTupleQuery(QueryLanguage.SPARQL, queryStr1);
+
+ // workaround for a bug in sesame
+ DatasetImpl ds = new DatasetImpl();
+ ds.addDefaultGraph(context1);
+ ds.addNamedGraph(context1);
+ ds.addDefaultRemoveGraph(context1);
+ ds.setDefaultInsertGraph(context1);
+ query1.setDataset(ds);
+
+
+ List<BindingSet> result1 = Iterations.asList(query1.evaluate());
+ Assert.assertEquals(2, result1.size());
+
+ String queryStr2 = "SELECT * WHERE { GRAPH <"+context2.stringValue()+"> { ?X ?P ?Y } }";
+
+ TupleQuery query2 = con.prepareTupleQuery(QueryLanguage.SPARQL, queryStr2);
+ List<BindingSet> result2 = Iterations.asList(query2.evaluate());
+ Assert.assertEquals(0, result2.size());
+
+ con.commit();
+ } finally {
+ con.close();
+ }
+ }
+
}
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/c7a58525/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/services/config/ConfigurationServiceImpl.java
----------------------------------------------------------------------
diff --git a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/services/config/ConfigurationServiceImpl.java b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/services/config/ConfigurationServiceImpl.java
index 2de2c41..4d5edcc 100644
--- a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/services/config/ConfigurationServiceImpl.java
+++ b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/services/config/ConfigurationServiceImpl.java
@@ -1007,6 +1007,7 @@ public class ConfigurationServiceImpl implements ConfigurationService {
config.clearProperty(key);
configDescriptions.clearProperty(key+".type");
configDescriptions.clearProperty(key+".description");
+ save();
} finally {
lock.writeLock().unlock();
}
[12/30] git commit: cleanups
Posted by ja...@apache.org.
cleanups
Project: http://git-wip-us.apache.org/repos/asf/incubator-marmotta/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-marmotta/commit/a9e99d62
Tree: http://git-wip-us.apache.org/repos/asf/incubator-marmotta/tree/a9e99d62
Diff: http://git-wip-us.apache.org/repos/asf/incubator-marmotta/diff/a9e99d62
Branch: refs/heads/MARMOTTA-345
Commit: a9e99d62e6160df06fe7d18da7dbb0ff32edb914
Parents: b5b336b
Author: Sebastian Schaffert <ss...@apache.org>
Authored: Mon Oct 21 12:59:12 2013 +0200
Committer: Sebastian Schaffert <ss...@apache.org>
Committed: Mon Oct 21 12:59:12 2013 +0200
----------------------------------------------------------------------
.../platform/core/api/user/UserToken.java | 84 --------------------
1 file changed, 84 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/a9e99d62/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/api/user/UserToken.java
----------------------------------------------------------------------
diff --git a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/api/user/UserToken.java b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/api/user/UserToken.java
deleted file mode 100644
index 940c795..0000000
--- a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/api/user/UserToken.java
+++ /dev/null
@@ -1,84 +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.core.api.user;
-
-
-import org.openrdf.model.URI;
-
-import java.util.Date;
-import java.util.UUID;
-
-/**
- * Add file description here!
- * <p/>
- * User: sschaffe
- */
-public class UserToken {
-
- private Date created, modified;
-
- private UUID uuid;
-
- private URI user;
-
-
- public UserToken(URI user) {
- this.user = user;
- this.uuid = UUID.randomUUID();
- this.created = new Date();
- this.modified = new Date();
- }
-
- public Date getCreated() {
- return new Date(created.getTime());
- }
-
- public void setCreated(Date created) {
- this.created = new Date(created.getTime());
- }
-
- public UUID getUuid() {
- return uuid;
- }
-
- public void setUuid(UUID uuid) {
- this.uuid = uuid;
- }
-
- public URI getUser() {
- return user;
- }
-
- public void setUser(URI user) {
- this.user = user;
- }
-
- public Date getModified() {
- return new Date(modified.getTime());
- }
-
- public void setModified(Date modified) {
- this.modified = new Date(modified.getTime());
- }
-
- @Override
- public String toString() {
- return String.format("%s; %tFT%<tTZ", user, modified);
- // return uuid.toString();
- }
-}
[27/30] git commit: Merge branch 'develop' into MARMOTTA-345
Posted by ja...@apache.org.
Merge branch 'develop' into MARMOTTA-345
Project: http://git-wip-us.apache.org/repos/asf/incubator-marmotta/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-marmotta/commit/ff85aef7
Tree: http://git-wip-us.apache.org/repos/asf/incubator-marmotta/tree/ff85aef7
Diff: http://git-wip-us.apache.org/repos/asf/incubator-marmotta/diff/ff85aef7
Branch: refs/heads/MARMOTTA-345
Commit: ff85aef7bffc2030c8438bd92262f47ee81ee1ef
Parents: 2651f76 1610290
Author: Jakob Frank <ja...@apache.org>
Authored: Thu Oct 24 14:02:12 2013 +0200
Committer: Jakob Frank <ja...@apache.org>
Committed: Thu Oct 24 14:02:12 2013 +0200
----------------------------------------------------------------------
.../commons/sesame/model/StatementCommons.java | 4 +-
libraries/kiwi/kiwi-loader/pom.xml | 64 +++++++++++++++-----
parent/pom.xml | 5 ++
3 files changed, 56 insertions(+), 17 deletions(-)
----------------------------------------------------------------------
[22/30] git commit: fixed missing imports in
LinkedDataCachingWebservice
Posted by ja...@apache.org.
fixed missing imports in LinkedDataCachingWebservice
Project: http://git-wip-us.apache.org/repos/asf/incubator-marmotta/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-marmotta/commit/56fb5813
Tree: http://git-wip-us.apache.org/repos/asf/incubator-marmotta/tree/56fb5813
Diff: http://git-wip-us.apache.org/repos/asf/incubator-marmotta/diff/56fb5813
Branch: refs/heads/MARMOTTA-345
Commit: 56fb5813e3937a3d5560c5ab6336b05b6fcc3235
Parents: fd8673b
Author: Jakob Frank <ja...@apache.org>
Authored: Wed Oct 23 15:23:11 2013 +0200
Committer: Jakob Frank <ja...@apache.org>
Committed: Wed Oct 23 15:23:11 2013 +0200
----------------------------------------------------------------------
.../LinkedDataCachingWebService.java | 32 ++++++++++++++------
1 file changed, 23 insertions(+), 9 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/56fb5813/platform/ldcache/marmotta-ldcache-common/src/main/java/org/apache/marmotta/platform/ldcache/webservices/LinkedDataCachingWebService.java
----------------------------------------------------------------------
diff --git a/platform/ldcache/marmotta-ldcache-common/src/main/java/org/apache/marmotta/platform/ldcache/webservices/LinkedDataCachingWebService.java b/platform/ldcache/marmotta-ldcache-common/src/main/java/org/apache/marmotta/platform/ldcache/webservices/LinkedDataCachingWebService.java
index c1e6c81..fe3e1cd 100644
--- a/platform/ldcache/marmotta-ldcache-common/src/main/java/org/apache/marmotta/platform/ldcache/webservices/LinkedDataCachingWebService.java
+++ b/platform/ldcache/marmotta-ldcache-common/src/main/java/org/apache/marmotta/platform/ldcache/webservices/LinkedDataCachingWebService.java
@@ -17,6 +17,29 @@
*/
package org.apache.marmotta.platform.ldcache.webservices;
+import java.io.ByteArrayOutputStream;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.regex.Pattern;
+import java.util.regex.PatternSyntaxException;
+
+import javax.enterprise.context.ApplicationScoped;
+import javax.inject.Inject;
+import javax.ws.rs.DELETE;
+import javax.ws.rs.DefaultValue;
+import javax.ws.rs.GET;
+import javax.ws.rs.POST;
+import javax.ws.rs.Path;
+import javax.ws.rs.PathParam;
+import javax.ws.rs.Produces;
+import javax.ws.rs.QueryParam;
+import javax.ws.rs.core.Response;
+import javax.ws.rs.core.Response.Status;
+
import org.apache.marmotta.commons.sesame.model.Namespaces;
import org.apache.marmotta.ldclient.api.endpoint.Endpoint;
import org.apache.marmotta.ldclient.api.provider.DataProvider;
@@ -31,15 +54,6 @@ import org.openrdf.rio.RDFHandler;
import org.openrdf.rio.rdfxml.util.RDFXMLPrettyWriter;
import org.slf4j.Logger;
-import javax.enterprise.context.ApplicationScoped;
-import javax.inject.Inject;
-import javax.ws.rs.core.Response;
-import javax.ws.rs.core.Response.Status;
-import java.io.ByteArrayOutputStream;
-import java.util.*;
-import java.util.regex.Pattern;
-import java.util.regex.PatternSyntaxException;
-
/**
* Add file description here!
* <p/>
[25/30] git commit: fixed missing imports in marmotta-backend-bigdata
Posted by ja...@apache.org.
fixed missing imports in marmotta-backend-bigdata
Project: http://git-wip-us.apache.org/repos/asf/incubator-marmotta/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-marmotta/commit/3c319589
Tree: http://git-wip-us.apache.org/repos/asf/incubator-marmotta/tree/3c319589
Diff: http://git-wip-us.apache.org/repos/asf/incubator-marmotta/diff/3c319589
Branch: refs/heads/MARMOTTA-345
Commit: 3c31958980e6f87f95b38b9d88af52bbc23fa6da
Parents: 75bbbc9
Author: Jakob Frank <ja...@apache.org>
Authored: Wed Oct 23 16:05:30 2013 +0200
Committer: Jakob Frank <ja...@apache.org>
Committed: Wed Oct 23 16:05:30 2013 +0200
----------------------------------------------------------------------
.../bigdata/BigDataSesame27Repository.java | 13 ++++++++---
.../backend/bigdata/BigDataSesame27Sail.java | 24 +++++++++++++++-----
2 files changed, 28 insertions(+), 9 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/3c319589/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
index 9d6d718..b6878b8 100644
--- 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
@@ -17,13 +17,16 @@
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.repository.sail.SailBooleanQuery;
+import org.openrdf.repository.sail.SailGraphQuery;
+import org.openrdf.repository.sail.SailQuery;
+import org.openrdf.repository.sail.SailRepository;
+import org.openrdf.repository.sail.SailRepositoryConnection;
+import org.openrdf.repository.sail.SailTupleQuery;
import org.openrdf.sail.Sail;
import org.openrdf.sail.SailConnection;
import org.openrdf.sail.SailException;
@@ -32,6 +35,10 @@ import org.openrdf.sail.helpers.SailWrapper;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import com.bigdata.rdf.sail.BigdataSail;
+import com.bigdata.rdf.sail.BigdataSailRepositoryConnection;
+import com.bigdata.rdf.store.AbstractTripleStore;
+
/**
* A wrapper to allow using BigData in a modular Sesame 2.7 environment. Provides a fast lane to the BigData SPARQL
* implementation.
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/3c319589/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
index 0cc5613..1da9ad1 100644
--- 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
@@ -14,25 +14,37 @@
* 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 java.util.HashSet;
+import java.util.Properties;
+import java.util.Set;
+
+import org.openrdf.model.Namespace;
+import org.openrdf.model.Resource;
+import org.openrdf.model.Statement;
+import org.openrdf.model.URI;
+import org.openrdf.model.Value;
+import org.openrdf.model.ValueFactory;
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.NotifyingSail;
+import org.openrdf.sail.NotifyingSailConnection;
+import org.openrdf.sail.SailChangedEvent;
+import org.openrdf.sail.SailChangedListener;
+import org.openrdf.sail.SailException;
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;
+import com.bigdata.rdf.sail.BigdataSail;
+import com.bigdata.rdf.store.AbstractTripleStore;
/**
* Add file description here!
[13/30] git commit: moved bigdata backend to non-free profile
Posted by ja...@apache.org.
moved bigdata backend to non-free profile
Project: http://git-wip-us.apache.org/repos/asf/incubator-marmotta/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-marmotta/commit/91a7f217
Tree: http://git-wip-us.apache.org/repos/asf/incubator-marmotta/tree/91a7f217
Diff: http://git-wip-us.apache.org/repos/asf/incubator-marmotta/diff/91a7f217
Branch: refs/heads/MARMOTTA-345
Commit: 91a7f217bb35843d222fe7d3e9c38e6276e186c5
Parents: a9e99d6
Author: Sebastian Schaffert <ss...@apache.org>
Authored: Mon Oct 21 13:06:30 2013 +0200
Committer: Sebastian Schaffert <ss...@apache.org>
Committed: Mon Oct 21 13:06:30 2013 +0200
----------------------------------------------------------------------
platform/pom.xml | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/91a7f217/platform/pom.xml
----------------------------------------------------------------------
diff --git a/platform/pom.xml b/platform/pom.xml
index 722e000..e68243c 100644
--- a/platform/pom.xml
+++ b/platform/pom.xml
@@ -57,7 +57,6 @@
<!-- alternative backend implementations, only include exactly one in your classpath -->
<module>marmotta-backend-kiwi</module>
<module>marmotta-backend-native</module>
- <module>marmotta-backend-bigdata</module>
<!-- generic modules -->
<module>marmotta-ldpath</module>
@@ -78,4 +77,15 @@
</modules>
+
+ <profiles>
+ <!-- non-free backends and modules -->
+ <profile>
+ <id>non-free</id>
+ <modules>
+ <module>marmotta-backend-bigdata</module>
+ </modules>
+ </profile>
+ </profiles>
+
</project>
[24/30] git commit: fixed jrebel relativePath in marmotta-platform
Posted by ja...@apache.org.
fixed jrebel relativePath in marmotta-platform
Project: http://git-wip-us.apache.org/repos/asf/incubator-marmotta/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-marmotta/commit/75bbbc90
Tree: http://git-wip-us.apache.org/repos/asf/incubator-marmotta/tree/75bbbc90
Diff: http://git-wip-us.apache.org/repos/asf/incubator-marmotta/diff/75bbbc90
Branch: refs/heads/MARMOTTA-345
Commit: 75bbbc900bc7c23ce360e28fc86ec5897b5b8696
Parents: dd234c1
Author: Jakob Frank <ja...@apache.org>
Authored: Wed Oct 23 16:02:41 2013 +0200
Committer: Jakob Frank <ja...@apache.org>
Committed: Wed Oct 23 16:04:46 2013 +0200
----------------------------------------------------------------------
commons/marmotta-commons/pom.xml | 1 -
platform/backends/marmotta-backend-bigdata/pom.xml | 3 +--
platform/backends/marmotta-backend-kiwi/pom.xml | 4 ++--
platform/backends/marmotta-backend-memory/pom.xml | 4 ++--
platform/backends/marmotta-backend-native/pom.xml | 4 ++--
platform/ldcache/marmotta-ldcache-common/pom.xml | 4 ++--
platform/ldcache/marmotta-ldcache-file/pom.xml | 2 +-
platform/ldcache/marmotta-ldcache-kiwi/pom.xml | 2 +-
8 files changed, 11 insertions(+), 13 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/75bbbc90/commons/marmotta-commons/pom.xml
----------------------------------------------------------------------
diff --git a/commons/marmotta-commons/pom.xml b/commons/marmotta-commons/pom.xml
index a4d013a..6fbf429 100644
--- a/commons/marmotta-commons/pom.xml
+++ b/commons/marmotta-commons/pom.xml
@@ -33,7 +33,6 @@
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
- <version>1.7</version>
<executions>
<execution>
<id>add-ext</id>
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/75bbbc90/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
index 28cd8fe..cb7753e 100644
--- a/platform/backends/marmotta-backend-bigdata/pom.xml
+++ b/platform/backends/marmotta-backend-bigdata/pom.xml
@@ -28,7 +28,6 @@
<relativePath>../../../parent</relativePath>
</parent>
- <groupId>org.apache.marmotta</groupId>
<artifactId>marmotta-backend-bigdata</artifactId>
<name>Apache Marmotta Platform: BigData Backend</name>
@@ -63,7 +62,7 @@
</execution>
</executions>
<configuration>
- <relativePath>../../</relativePath>
+ <relativePath>../../../</relativePath>
<rootPath>$${rebel.root}</rootPath>
<classpath>
<resources>
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/75bbbc90/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
index f715228..b0002a4 100644
--- a/platform/backends/marmotta-backend-kiwi/pom.xml
+++ b/platform/backends/marmotta-backend-kiwi/pom.xml
@@ -54,7 +54,7 @@
</execution>
</executions>
<configuration>
- <relativePath>../../</relativePath>
+ <relativePath>../../../</relativePath>
<rootPath>$${rebel.root}</rootPath>
<classpath>
<resources>
@@ -169,4 +169,4 @@
-</project>
\ No newline at end of file
+</project>
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/75bbbc90/platform/backends/marmotta-backend-memory/pom.xml
----------------------------------------------------------------------
diff --git a/platform/backends/marmotta-backend-memory/pom.xml b/platform/backends/marmotta-backend-memory/pom.xml
index 126b643..7c28815 100644
--- a/platform/backends/marmotta-backend-memory/pom.xml
+++ b/platform/backends/marmotta-backend-memory/pom.xml
@@ -37,7 +37,7 @@
</execution>
</executions>
<configuration>
- <relativePath>../../</relativePath>
+ <relativePath>../../../</relativePath>
<rootPath>$${rebel.root}</rootPath>
<classpath>
<resources>
@@ -151,4 +151,4 @@
-</project>
\ No newline at end of file
+</project>
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/75bbbc90/platform/backends/marmotta-backend-native/pom.xml
----------------------------------------------------------------------
diff --git a/platform/backends/marmotta-backend-native/pom.xml b/platform/backends/marmotta-backend-native/pom.xml
index 2021834..d082a08 100644
--- a/platform/backends/marmotta-backend-native/pom.xml
+++ b/platform/backends/marmotta-backend-native/pom.xml
@@ -54,7 +54,7 @@
</execution>
</executions>
<configuration>
- <relativePath>../../</relativePath>
+ <relativePath>../../../</relativePath>
<rootPath>$${rebel.root}</rootPath>
<classpath>
<resources>
@@ -167,4 +167,4 @@
</dependencies>
-</project>
\ No newline at end of file
+</project>
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/75bbbc90/platform/ldcache/marmotta-ldcache-common/pom.xml
----------------------------------------------------------------------
diff --git a/platform/ldcache/marmotta-ldcache-common/pom.xml b/platform/ldcache/marmotta-ldcache-common/pom.xml
index 9af8e41..56be5f8 100644
--- a/platform/ldcache/marmotta-ldcache-common/pom.xml
+++ b/platform/ldcache/marmotta-ldcache-common/pom.xml
@@ -55,7 +55,7 @@
</execution>
</executions>
<configuration>
- <relativePath>../../</relativePath>
+ <relativePath>../../../</relativePath>
<rootPath>$${rebel.root}</rootPath>
<classpath>
<resources>
@@ -195,4 +195,4 @@
</dependencies>
-</project>
\ No newline at end of file
+</project>
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/75bbbc90/platform/ldcache/marmotta-ldcache-file/pom.xml
----------------------------------------------------------------------
diff --git a/platform/ldcache/marmotta-ldcache-file/pom.xml b/platform/ldcache/marmotta-ldcache-file/pom.xml
index 7bcd070..ecaf45d 100644
--- a/platform/ldcache/marmotta-ldcache-file/pom.xml
+++ b/platform/ldcache/marmotta-ldcache-file/pom.xml
@@ -52,7 +52,7 @@
</execution>
</executions>
<configuration>
- <relativePath>../../</relativePath>
+ <relativePath>../../../</relativePath>
<rootPath>$${rebel.root}</rootPath>
<classpath>
<resources>
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/75bbbc90/platform/ldcache/marmotta-ldcache-kiwi/pom.xml
----------------------------------------------------------------------
diff --git a/platform/ldcache/marmotta-ldcache-kiwi/pom.xml b/platform/ldcache/marmotta-ldcache-kiwi/pom.xml
index f9b49e1..f9744a0 100644
--- a/platform/ldcache/marmotta-ldcache-kiwi/pom.xml
+++ b/platform/ldcache/marmotta-ldcache-kiwi/pom.xml
@@ -52,7 +52,7 @@
</execution>
</executions>
<configuration>
- <relativePath>../../</relativePath>
+ <relativePath>../../../</relativePath>
<rootPath>$${rebel.root}</rootPath>
<classpath>
<resources>
[26/30] git commit: fixed file-permissions
Posted by ja...@apache.org.
fixed file-permissions
Project: http://git-wip-us.apache.org/repos/asf/incubator-marmotta/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-marmotta/commit/362ecbec
Tree: http://git-wip-us.apache.org/repos/asf/incubator-marmotta/tree/362ecbec
Diff: http://git-wip-us.apache.org/repos/asf/incubator-marmotta/diff/362ecbec
Branch: refs/heads/MARMOTTA-345
Commit: 362ecbec8d556d18073a365aed5e4a27e2242635
Parents: 3c31958
Author: Jakob Frank <ja...@apache.org>
Authored: Wed Oct 23 16:38:33 2013 +0200
Committer: Jakob Frank <ja...@apache.org>
Committed: Wed Oct 23 16:38:33 2013 +0200
----------------------------------------------------------------------
.../commons/sesame/rio/vcard/Denis_Hennessy.vcf | 0
.../marmotta/commons/sesame/rio/vcard/Tony_Small.vcf | 0
extras/webjars/snorql/src/main/resources/LICENSE | 0
extras/webjars/snorql/src/main/resources/README | 0
extras/webjars/snorql/src/main/resources/link.png | Bin
extras/webjars/snorql/src/main/resources/namespaces.js | 0
extras/webjars/snorql/src/main/resources/prototype.js | 0
.../webjars/snorql/src/main/resources/rdf_flyer.24.gif | Bin
.../snorql/src/main/resources/scriptaculous/builder.js | 0
.../src/main/resources/scriptaculous/controls.js | 0
.../src/main/resources/scriptaculous/dragdrop.js | 0
.../snorql/src/main/resources/scriptaculous/effects.js | 0
.../src/main/resources/scriptaculous/scriptaculous.js | 0
.../snorql/src/main/resources/scriptaculous/slider.js | 0
.../snorql/src/main/resources/scriptaculous/sound.js | 0
.../src/main/resources/scriptaculous/unittest.js | 0
extras/webjars/snorql/src/main/resources/snorql.js | 0
extras/webjars/snorql/src/main/resources/sparql.js | 0
extras/webjars/snorql/src/main/resources/style.css | 0
.../webjars/snorql/src/main/resources/xml-to-html.xsl | 0
.../org/apache/marmotta/splash/systray/systray.png | Bin
.../src/main/resources/web/admin/img/ld-caching.png | Bin
.../src/main/resources/web/public/img/icon/link.png | Bin
.../src/main/resources/web/admin/img/ld_path_small.png | Bin
.../main/resources/web/admin/img/reasoner_small.png | Bin
.../src/main/resources/web/admin/img/sparql_small.png | Bin
.../src/main/resources/web/admin/link.png | Bin
.../src/main/resources/web/admin/snorql.html | 0
.../src/main/resources/web/admin/img/clock_small.png | Bin
29 files changed, 0 insertions(+), 0 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/362ecbec/commons/sesame-tools-rio-vcard/src/test/resources/org/apache/marmotta/commons/sesame/rio/vcard/Denis_Hennessy.vcf
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-vcard/src/test/resources/org/apache/marmotta/commons/sesame/rio/vcard/Denis_Hennessy.vcf b/commons/sesame-tools-rio-vcard/src/test/resources/org/apache/marmotta/commons/sesame/rio/vcard/Denis_Hennessy.vcf
old mode 100755
new mode 100644
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/362ecbec/commons/sesame-tools-rio-vcard/src/test/resources/org/apache/marmotta/commons/sesame/rio/vcard/Tony_Small.vcf
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-vcard/src/test/resources/org/apache/marmotta/commons/sesame/rio/vcard/Tony_Small.vcf b/commons/sesame-tools-rio-vcard/src/test/resources/org/apache/marmotta/commons/sesame/rio/vcard/Tony_Small.vcf
old mode 100755
new mode 100644
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/362ecbec/extras/webjars/snorql/src/main/resources/LICENSE
----------------------------------------------------------------------
diff --git a/extras/webjars/snorql/src/main/resources/LICENSE b/extras/webjars/snorql/src/main/resources/LICENSE
old mode 100755
new mode 100644
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/362ecbec/extras/webjars/snorql/src/main/resources/README
----------------------------------------------------------------------
diff --git a/extras/webjars/snorql/src/main/resources/README b/extras/webjars/snorql/src/main/resources/README
old mode 100755
new mode 100644
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/362ecbec/extras/webjars/snorql/src/main/resources/link.png
----------------------------------------------------------------------
diff --git a/extras/webjars/snorql/src/main/resources/link.png b/extras/webjars/snorql/src/main/resources/link.png
old mode 100755
new mode 100644
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/362ecbec/extras/webjars/snorql/src/main/resources/namespaces.js
----------------------------------------------------------------------
diff --git a/extras/webjars/snorql/src/main/resources/namespaces.js b/extras/webjars/snorql/src/main/resources/namespaces.js
old mode 100755
new mode 100644
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/362ecbec/extras/webjars/snorql/src/main/resources/prototype.js
----------------------------------------------------------------------
diff --git a/extras/webjars/snorql/src/main/resources/prototype.js b/extras/webjars/snorql/src/main/resources/prototype.js
old mode 100755
new mode 100644
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/362ecbec/extras/webjars/snorql/src/main/resources/rdf_flyer.24.gif
----------------------------------------------------------------------
diff --git a/extras/webjars/snorql/src/main/resources/rdf_flyer.24.gif b/extras/webjars/snorql/src/main/resources/rdf_flyer.24.gif
old mode 100755
new mode 100644
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/362ecbec/extras/webjars/snorql/src/main/resources/scriptaculous/builder.js
----------------------------------------------------------------------
diff --git a/extras/webjars/snorql/src/main/resources/scriptaculous/builder.js b/extras/webjars/snorql/src/main/resources/scriptaculous/builder.js
old mode 100755
new mode 100644
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/362ecbec/extras/webjars/snorql/src/main/resources/scriptaculous/controls.js
----------------------------------------------------------------------
diff --git a/extras/webjars/snorql/src/main/resources/scriptaculous/controls.js b/extras/webjars/snorql/src/main/resources/scriptaculous/controls.js
old mode 100755
new mode 100644
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/362ecbec/extras/webjars/snorql/src/main/resources/scriptaculous/dragdrop.js
----------------------------------------------------------------------
diff --git a/extras/webjars/snorql/src/main/resources/scriptaculous/dragdrop.js b/extras/webjars/snorql/src/main/resources/scriptaculous/dragdrop.js
old mode 100755
new mode 100644
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/362ecbec/extras/webjars/snorql/src/main/resources/scriptaculous/effects.js
----------------------------------------------------------------------
diff --git a/extras/webjars/snorql/src/main/resources/scriptaculous/effects.js b/extras/webjars/snorql/src/main/resources/scriptaculous/effects.js
old mode 100755
new mode 100644
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/362ecbec/extras/webjars/snorql/src/main/resources/scriptaculous/scriptaculous.js
----------------------------------------------------------------------
diff --git a/extras/webjars/snorql/src/main/resources/scriptaculous/scriptaculous.js b/extras/webjars/snorql/src/main/resources/scriptaculous/scriptaculous.js
old mode 100755
new mode 100644
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/362ecbec/extras/webjars/snorql/src/main/resources/scriptaculous/slider.js
----------------------------------------------------------------------
diff --git a/extras/webjars/snorql/src/main/resources/scriptaculous/slider.js b/extras/webjars/snorql/src/main/resources/scriptaculous/slider.js
old mode 100755
new mode 100644
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/362ecbec/extras/webjars/snorql/src/main/resources/scriptaculous/sound.js
----------------------------------------------------------------------
diff --git a/extras/webjars/snorql/src/main/resources/scriptaculous/sound.js b/extras/webjars/snorql/src/main/resources/scriptaculous/sound.js
old mode 100755
new mode 100644
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/362ecbec/extras/webjars/snorql/src/main/resources/scriptaculous/unittest.js
----------------------------------------------------------------------
diff --git a/extras/webjars/snorql/src/main/resources/scriptaculous/unittest.js b/extras/webjars/snorql/src/main/resources/scriptaculous/unittest.js
old mode 100755
new mode 100644
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/362ecbec/extras/webjars/snorql/src/main/resources/snorql.js
----------------------------------------------------------------------
diff --git a/extras/webjars/snorql/src/main/resources/snorql.js b/extras/webjars/snorql/src/main/resources/snorql.js
old mode 100755
new mode 100644
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/362ecbec/extras/webjars/snorql/src/main/resources/sparql.js
----------------------------------------------------------------------
diff --git a/extras/webjars/snorql/src/main/resources/sparql.js b/extras/webjars/snorql/src/main/resources/sparql.js
old mode 100755
new mode 100644
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/362ecbec/extras/webjars/snorql/src/main/resources/style.css
----------------------------------------------------------------------
diff --git a/extras/webjars/snorql/src/main/resources/style.css b/extras/webjars/snorql/src/main/resources/style.css
old mode 100755
new mode 100644
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/362ecbec/extras/webjars/snorql/src/main/resources/xml-to-html.xsl
----------------------------------------------------------------------
diff --git a/extras/webjars/snorql/src/main/resources/xml-to-html.xsl b/extras/webjars/snorql/src/main/resources/xml-to-html.xsl
old mode 100755
new mode 100644
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/362ecbec/launchers/marmotta-splash/src/main/resources/org/apache/marmotta/splash/systray/systray.png
----------------------------------------------------------------------
diff --git a/launchers/marmotta-splash/src/main/resources/org/apache/marmotta/splash/systray/systray.png b/launchers/marmotta-splash/src/main/resources/org/apache/marmotta/splash/systray/systray.png
old mode 100755
new mode 100644
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/362ecbec/platform/ldcache/marmotta-ldcache-common/src/main/resources/web/admin/img/ld-caching.png
----------------------------------------------------------------------
diff --git a/platform/ldcache/marmotta-ldcache-common/src/main/resources/web/admin/img/ld-caching.png b/platform/ldcache/marmotta-ldcache-common/src/main/resources/web/admin/img/ld-caching.png
old mode 100755
new mode 100644
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/362ecbec/platform/marmotta-core/src/main/resources/web/public/img/icon/link.png
----------------------------------------------------------------------
diff --git a/platform/marmotta-core/src/main/resources/web/public/img/icon/link.png b/platform/marmotta-core/src/main/resources/web/public/img/icon/link.png
old mode 100755
new mode 100644
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/362ecbec/platform/marmotta-ldpath/src/main/resources/web/admin/img/ld_path_small.png
----------------------------------------------------------------------
diff --git a/platform/marmotta-ldpath/src/main/resources/web/admin/img/ld_path_small.png b/platform/marmotta-ldpath/src/main/resources/web/admin/img/ld_path_small.png
old mode 100755
new mode 100644
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/362ecbec/platform/marmotta-reasoner-kiwi/src/main/resources/web/admin/img/reasoner_small.png
----------------------------------------------------------------------
diff --git a/platform/marmotta-reasoner-kiwi/src/main/resources/web/admin/img/reasoner_small.png b/platform/marmotta-reasoner-kiwi/src/main/resources/web/admin/img/reasoner_small.png
old mode 100755
new mode 100644
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/362ecbec/platform/marmotta-sparql/src/main/resources/web/admin/img/sparql_small.png
----------------------------------------------------------------------
diff --git a/platform/marmotta-sparql/src/main/resources/web/admin/img/sparql_small.png b/platform/marmotta-sparql/src/main/resources/web/admin/img/sparql_small.png
old mode 100755
new mode 100644
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/362ecbec/platform/marmotta-sparql/src/main/resources/web/admin/link.png
----------------------------------------------------------------------
diff --git a/platform/marmotta-sparql/src/main/resources/web/admin/link.png b/platform/marmotta-sparql/src/main/resources/web/admin/link.png
old mode 100755
new mode 100644
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/362ecbec/platform/marmotta-sparql/src/main/resources/web/admin/snorql.html
----------------------------------------------------------------------
diff --git a/platform/marmotta-sparql/src/main/resources/web/admin/snorql.html b/platform/marmotta-sparql/src/main/resources/web/admin/snorql.html
old mode 100755
new mode 100644
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/362ecbec/platform/marmotta-versioning-kiwi/src/main/resources/web/admin/img/clock_small.png
----------------------------------------------------------------------
diff --git a/platform/marmotta-versioning-kiwi/src/main/resources/web/admin/img/clock_small.png b/platform/marmotta-versioning-kiwi/src/main/resources/web/admin/img/clock_small.png
old mode 100755
new mode 100644
[17/30] reorganize platform modules to give more overview over
different backends
Posted by ja...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/47855a4b/platform/ldcache/marmotta-ldcache-common/src/main/java/org/apache/marmotta/platform/ldcache/webservices/LinkedDataCachingWebService.java
----------------------------------------------------------------------
diff --git a/platform/ldcache/marmotta-ldcache-common/src/main/java/org/apache/marmotta/platform/ldcache/webservices/LinkedDataCachingWebService.java b/platform/ldcache/marmotta-ldcache-common/src/main/java/org/apache/marmotta/platform/ldcache/webservices/LinkedDataCachingWebService.java
new file mode 100644
index 0000000..c1e6c81
--- /dev/null
+++ b/platform/ldcache/marmotta-ldcache-common/src/main/java/org/apache/marmotta/platform/ldcache/webservices/LinkedDataCachingWebService.java
@@ -0,0 +1,313 @@
+/**
+ * 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.ldcache.webservices;
+
+import org.apache.marmotta.commons.sesame.model.Namespaces;
+import org.apache.marmotta.ldclient.api.endpoint.Endpoint;
+import org.apache.marmotta.ldclient.api.provider.DataProvider;
+import org.apache.marmotta.ldclient.model.ClientResponse;
+import org.apache.marmotta.ldclient.provider.rdf.LinkedDataProvider;
+import org.apache.marmotta.platform.core.api.triplestore.SesameService;
+import org.apache.marmotta.platform.ldcache.api.endpoint.LinkedDataEndpointService;
+import org.apache.marmotta.platform.ldcache.api.ldcache.LDCacheSailProvider;
+import org.openrdf.model.URI;
+import org.openrdf.repository.RepositoryConnection;
+import org.openrdf.rio.RDFHandler;
+import org.openrdf.rio.rdfxml.util.RDFXMLPrettyWriter;
+import org.slf4j.Logger;
+
+import javax.enterprise.context.ApplicationScoped;
+import javax.inject.Inject;
+import javax.ws.rs.core.Response;
+import javax.ws.rs.core.Response.Status;
+import java.io.ByteArrayOutputStream;
+import java.util.*;
+import java.util.regex.Pattern;
+import java.util.regex.PatternSyntaxException;
+
+/**
+ * Add file description here!
+ * <p/>
+ * User: sschaffe
+ */
+@ApplicationScoped
+@Path("/cache")
+public class LinkedDataCachingWebService {
+
+ @Inject
+ private Logger log;
+
+ @Inject
+ private LinkedDataEndpointService endpointService;
+
+ @Inject
+ private SesameService sesameService;
+
+ @Inject
+ private LDCacheSailProvider cacheSailProvider;
+
+
+ @GET
+ @Path("/live")
+ public Response retrieveLive(@QueryParam("uri") String uri) {
+ if(cacheSailProvider.isEnabled()) {
+ try {
+ ClientResponse response = cacheSailProvider.getLDClient().retrieveResource(uri);
+
+ RepositoryConnection con = response.getTriples().getConnection();
+ con.begin();
+
+ ByteArrayOutputStream out = new ByteArrayOutputStream();
+ RDFHandler handler = new RDFXMLPrettyWriter(out);
+ con.export(handler);
+
+ con.commit();
+ con.close();
+
+
+ return Response.ok().entity( new String(out.toByteArray(), "utf-8")).build();
+ } catch (Exception e) {
+ log.error("exception while retrieving resource",e);
+ return Response.status(500).entity(e.getMessage()).build();
+ }
+ } else {
+ return Response.status(Status.SERVICE_UNAVAILABLE).entity("caching is disabled").build();
+ }
+ }
+
+ @GET
+ @Path("/cached")
+ public Response retrieveCached(@QueryParam("uri") String uri) {
+ if(cacheSailProvider.isEnabled()) {
+ URI resource = sesameService.getValueFactory().createURI(uri);
+
+
+ try {
+ cacheSailProvider.getLDCache().refreshResource(resource, false);
+
+ return Response.ok().build();
+ } catch (Exception e) {
+ log.error("exception while retrieving resource",e);
+ return Response.status(500).entity(e.getMessage()).build();
+ }
+ } else {
+ return Response.status(Status.SERVICE_UNAVAILABLE).entity("caching is disabled").build();
+ }
+
+ }
+
+ @GET
+ @Path("/refresh")
+ public Response refreshCached(@QueryParam("uri") String uri) {
+
+ if(cacheSailProvider.isEnabled()) {
+ URI resource = sesameService.getValueFactory().createURI(uri);
+
+
+ try {
+ cacheSailProvider.getLDCache().refreshResource(resource, true);
+
+ return Response.ok().build();
+ } catch (Exception e) {
+ log.error("exception while retrieving resource",e);
+ return Response.status(500).entity(e.getMessage()).build();
+ }
+ } else {
+ return Response.status(Status.SERVICE_UNAVAILABLE).entity("caching is disabled").build();
+ }
+
+ }
+
+ @POST
+ @Path("/expire")
+ public Response expireCache(@QueryParam("uri") String uri) {
+
+ if(cacheSailProvider.isEnabled()) {
+ if (uri != null) {
+ URI resource = sesameService.getValueFactory().createURI(uri);
+ cacheSailProvider.getLDCache().expire(resource);
+ } else {
+ cacheSailProvider.getLDCache().expireAll();
+ }
+
+ return Response.ok().build();
+ } else {
+ return Response.status(Status.SERVICE_UNAVAILABLE).entity("caching is disabled").build();
+ }
+ }
+
+ @POST
+ @Path("/endpoint")
+ public Response registerEndpoint(@QueryParam("name") String name,
+ @QueryParam("prefix") String prefix,
+ @QueryParam("endpoint") String endpointUrl,
+ @QueryParam("kind") String type,
+ @QueryParam("mimetype") String mimetype,
+ @QueryParam("expiry") long expiry) {
+
+ if(cacheSailProvider.isEnabled()) {
+ if (type == null || !getProviderNames().contains(type.toLowerCase())) {
+ type = LinkedDataProvider.PROVIDER_NAME;
+ }
+
+ // Check for valid Regex
+ if (prefix != null) {
+ try {
+ if (prefix.startsWith(Endpoint.REGEX_INDICATOR)) {
+ Pattern.compile(prefix.substring(Endpoint.REGEX_INDICATOR.length()));
+ } else {
+ Pattern.compile(prefix);
+ }
+ } catch (PatternSyntaxException pse) {
+ return Response.status(Status.BAD_REQUEST).entity("Invalid Regex in prefix detected").build();
+ }
+ }
+ if (endpointUrl != null) {
+ endpointUrl = endpointUrl.replace('<', '{').replace('>', '}');
+ } else {
+ endpointUrl = "";
+ }
+ if (mimetype == null) {
+ mimetype ="";
+ }
+ Endpoint endpoint = new Endpoint(name, type, prefix, endpointUrl, mimetype, expiry);
+ endpointService.addEndpoint(endpoint);
+
+ cacheSailProvider.updateEndpoints();
+
+
+ return Response.ok().build();
+ } else {
+ return Response.status(Status.SERVICE_UNAVAILABLE).entity("caching is disabled").build();
+ }
+
+ }
+
+ @GET
+ @Path("/endpoint/list")
+ @Produces("application/json")
+ public Response listEndpoints() {
+
+ List<Map<String, Object>> result = new LinkedList<Map<String, Object>>();
+ for(Endpoint endpoint : endpointService.listEndpoints()) {
+ result.add(buildEndpointJSON(endpoint, false));
+ }
+ for(Endpoint endpoint : cacheSailProvider.getVolatileEndpoints()) {
+ result.add(buildEndpointJSON(endpoint, true));
+ }
+
+ return Response.ok().entity(result).build();
+ }
+
+ @GET
+ @Path("/provider/list")
+ @Produces(Namespaces.MIME_TYPE_JSON)
+ public Response listProviders() {
+ if(cacheSailProvider.isEnabled()) {
+ return Response.ok(getProviderNames()).build();
+ } else {
+ return Response.status(Status.SERVICE_UNAVAILABLE).entity("caching is disabled").build();
+ }
+ }
+
+
+ @GET
+ @Path("/endpoint/{id}")
+ @Produces("application/json")
+ public Response retrieveEndpoint(@PathParam("id") String id) {
+
+ Endpoint endpoint = endpointService.getEndpoint(id);
+ if (endpoint == null) return notFound(id);
+
+
+ return Response.ok().entity(buildEndpointJSON(endpoint, false)).build();
+ }
+
+ @DELETE
+ @Path("/endpoint/{id}")
+ public Response removeEndpoint(@PathParam("id") String id) {
+
+ Endpoint endpoint = endpointService.getEndpoint(id);
+ if (endpoint == null) return notFound(id);
+
+ endpointService.removeEndpoint(endpoint);
+
+ cacheSailProvider.updateEndpoints();
+
+ return Response.ok().build();
+ }
+
+ @POST
+ @Path("/endpoint/{id}/enable")
+ public Response enableEndpoint(@PathParam("id") String id, @QueryParam("enable") @DefaultValue("true") boolean enable) {
+ Endpoint endpoint = endpointService.getEndpoint(id);
+ if (endpoint == null) return notFound(id);
+
+ endpoint.setActive(enable);
+ endpointService.updateEndpoint(endpoint);
+
+ cacheSailProvider.updateEndpoints();
+
+ return Response.ok().build();
+ }
+
+ private Response notFound(String id) {
+ return Response.status(Status.NOT_FOUND).entity("No endpoint with id " + id + " found!").build();
+ }
+
+ @POST
+ @Path("/endpoint/{id}/disable")
+ public Response disableEndpoint(@PathParam("id") String id) {
+ return enableEndpoint(id, false);
+ }
+
+ @GET
+ @Path("/info")
+ @Produces("application/json")
+ public Response getInformation() {
+ Map<String,String> result = new HashMap<>();
+ result.put("backend", cacheSailProvider.getName());
+ return Response.ok(result).build();
+ }
+
+ private Map<String, Object> buildEndpointJSON(Endpoint endpoint, boolean isVolatile) {
+ HashMap<String, Object> resultMap = new HashMap<String, Object>();
+ resultMap.put("id",endpoint.getName().replaceAll("[^A-Za-z0-9 ]", "").toLowerCase());
+ resultMap.put("name",endpoint.getName());
+ resultMap.put("endpoint",endpoint.getEndpointUrl());
+ resultMap.put("expiry", endpoint.getDefaultExpiry());
+ resultMap.put("prefix",endpoint.getUriPattern());
+ resultMap.put("kind",endpoint.getType().toString());
+ resultMap.put("mimetype",endpoint.getContentTypes());
+ resultMap.put("active", endpoint.isActive());
+ resultMap.put("volatile", isVolatile);
+
+ return resultMap;
+ }
+
+
+ private Set<String> getProviderNames() {
+ Set<String> result = new HashSet<String>();
+
+ for(DataProvider provider : cacheSailProvider.getLDClient().getDataProviders()) {
+ result.add(provider.getName().toLowerCase());
+ }
+
+ return result;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/47855a4b/platform/ldcache/marmotta-ldcache-common/src/main/resources/META-INF/beans.xml
----------------------------------------------------------------------
diff --git a/platform/ldcache/marmotta-ldcache-common/src/main/resources/META-INF/beans.xml b/platform/ldcache/marmotta-ldcache-common/src/main/resources/META-INF/beans.xml
new file mode 100644
index 0000000..461858e
--- /dev/null
+++ b/platform/ldcache/marmotta-ldcache-common/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/ldcache/marmotta-ldcache-common/src/main/resources/config-defaults.properties
----------------------------------------------------------------------
diff --git a/platform/ldcache/marmotta-ldcache-common/src/main/resources/config-defaults.properties b/platform/ldcache/marmotta-ldcache-common/src/main/resources/config-defaults.properties
new file mode 100644
index 0000000..750de20
--- /dev/null
+++ b/platform/ldcache/marmotta-ldcache-common/src/main/resources/config-defaults.properties
@@ -0,0 +1,49 @@
+#
+# 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 LD caching configuration
+###############################################################################
+
+# enable/disable automatic caching of remote resources from the Linked Data Cloud; enabling leads to many
+# HTTP requests when querying and should be considered with care
+ldcache.enabled = true
+
+# default expiry time in seconds if not otherwise given (default: 1 day)
+ldcache.expiry = 86400
+
+# minimum expiry time before which a resource is refreshed from the linked data cloud (use to avoid too short expiry times returned by servers)
+ldcache.minexpiry = 3600
+
+# how long to wait in ms when no data is sent over a connection
+ldcache.so_timeout = 60000
+
+# how long to wait in ms until a connection is established
+ldcache.connection_timeout = 10000
+
+# how many http retrievals to run at most in parallel
+ldcache.max_parallel_requests = 10
+
+# Sample for a cache entry
+ldcache.sample.dbpedia.name = DBPedia Sparql
+ldcache.sample.dbpedia.kind = SPARQL
+ldcache.sample.dbpedia.prefix = http://dbpedia\\.org.*
+ldcache.sample.dbpedia.endpoint = http://dbpedia.org/sparql
+ldcache.sample.dbpedia.mimetype =
+ldcache.sample.dbpedia.expiry = 86400
+
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/47855a4b/platform/ldcache/marmotta-ldcache-common/src/main/resources/config-descriptions.properties
----------------------------------------------------------------------
diff --git a/platform/ldcache/marmotta-ldcache-common/src/main/resources/config-descriptions.properties b/platform/ldcache/marmotta-ldcache-common/src/main/resources/config-descriptions.properties
new file mode 100644
index 0000000..7d6b4b4
--- /dev/null
+++ b/platform/ldcache/marmotta-ldcache-common/src/main/resources/config-descriptions.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.
+#
+
+###############################################################################
+# LMF LD caching configuration
+###############################################################################
+
+ldcache.enabled.description = enable/disable automatic caching of remote resources from the Linked Data Cloud; \
+ enabling leads to many HTTP requests when querying and should be considered with care
+ldcache.enabled.type = java.lang.Boolean
+
+ldcache.expiry.description = default expiry time in seconds if not otherwise given (default: 1 day)
+ldcache.expiry.type = java.lang.Integer(3600|0)
+
+ldcache.minexpiry.description = minimum expiry time before which a resource is refreshed from the linked data cloud \
+ (use to avoid too short expiry times returned by servers)
+ldcache.minexpiry.type = java.lang.Integer(60|0)
+
+ldcache.so_timeout.description = how long to wait in ms when no data is sent over a connection
+ldcache.so_timeout.type = java.lang.Integer(1000|1000)
+
+ldcache.connection_timeout.description = how long to wait in ms until a connection is established
+ldcache.connection_timeout.type = java.lang.Integer(1000|1000)
+
+ldcache.max_parallel_requests.description = how many http retrievals to run at most in parallel
+ldcache.max_parallel_requests.type = java.lang.Integer(1|1|100)
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/47855a4b/platform/ldcache/marmotta-ldcache-common/src/main/resources/kiwi-module.properties
----------------------------------------------------------------------
diff --git a/platform/ldcache/marmotta-ldcache-common/src/main/resources/kiwi-module.properties b/platform/ldcache/marmotta-ldcache-common/src/main/resources/kiwi-module.properties
new file mode 100644
index 0000000..3f3dd4e
--- /dev/null
+++ b/platform/ldcache/marmotta-ldcache-common/src/main/resources/kiwi-module.properties
@@ -0,0 +1,35 @@
+#
+# 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=Linked Data Caching
+subtitle = Endpoints and Caches
+
+icon_small = /admin/img/ld-caching.png
+
+baseurl=/cache
+
+webservices=org.apache.marmotta.platform.ldcache.webservices.LinkedDataCachingWebService
+
+adminpage.0.title=About
+adminpage.0.link=/admin/about.html
+
+adminpage.1.title=Configuration
+adminpage.1.link=/admin/configuration.html
+
+
+
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/47855a4b/platform/ldcache/marmotta-ldcache-common/src/main/resources/web/admin/about.html
----------------------------------------------------------------------
diff --git a/platform/ldcache/marmotta-ldcache-common/src/main/resources/web/admin/about.html b/platform/ldcache/marmotta-ldcache-common/src/main/resources/web/admin/about.html
new file mode 100644
index 0000000..39f4955
--- /dev/null
+++ b/platform/ldcache/marmotta-ldcache-common/src/main/resources/web/admin/about.html
@@ -0,0 +1,271 @@
+<!--
+
+ 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>Linked Data Caching</title>
+ <script type="text/javascript" src="../../webjars/jquery/1.8.2/jquery.min.js"></script>
+ <script type="text/javascript">
+ jQuery(document).ready(function(){
+ jQuery.getJSON(_SERVER_URL + "/cache/info", function(data) {
+ $("#title").html(data.backend);
+ });
+ });
+ </script>
+
+ <!--###END_HEAD###-->
+</head>
+<body>
+ <!--###BEGIN_CONTENT###-->
+ <h1>
+ <a id="Introduction"></a><span id="title">Introduction</span><a class="section_anchor"
+ href="#Introduction"></a>
+ </h1>
+ <p>
+ Apache Marmotta can optionally be extended with a Linked
+ Data Caching Module that transparently retrieves resources from the
+ Linked Data Cloud when they are needed (e.g. when querying a relation
+ to a remote resource) and caches them transparently. Linked Data
+ Caching is integrated at the triple store level and thus available to
+ all services accessing the triple store, including the SPARQL endpoint.
+ </p>
+ <h1>
+ <a id="Functionality"></a>Functionality<a class="section_anchor"
+ href="#Functionality"></a>
+ </h1>
+ <h2>
+ <a id="Transparent_Linked_Data_Access"></a>Transparent Linked Data
+ Access<a class="section_anchor" href="#Transparent_Linked_Data_Access"></a>
+ </h2>
+ <p>The Linked Data Caching module is a powerful component for
+ integrating with other Linked Data servers, either on the public
+ Linked Data Cloud or from local severs deployed in an intranet. It
+ provides transparent access to resources on Linked Data-aware servers.
+ When enabled, it is triggered when the triples of a non-local resource
+ are requested from the triple store. A typical case where this can
+ happen is when a local resource links to a resource in the Linked Data
+ Cloud using a triple and a query to the system requests information
+ about this external resource.</p>
+ <p>For example, the FOAF description of a user in the Marmotta might
+ contain a reference to the FOAF file of a user at some external
+ location:</p>
+ <pre class="prettyprint">
+ <span class="kwd">local</span><span class="pun">:</span><span
+ class="pln">peter foaf</span><span class="pun">:</span><span
+ class="pln">knows </span><span class="pun"><</span><span
+ class="pln">http</span><span class="pun">:</span><span class="com">//example.com/john.rdf></span>
+ </pre>
+ <p>A query could then ask for all the names of persons that peter
+ knows, e.g. in SPARQL:</p>
+ <pre class="prettyprint">
+ <span class="pln">SELECT </span><span class="pun">?</span><span
+ class="pln">name WHERE </span><span class="pun">{</span><span
+ class="pln"> </span><span class="kwd">local</span><span class="pun">:</span><span
+ class="pln">peter foaf</span><span class="pun">:</span><span
+ class="pln">knows </span><span class="pun">?</span><span class="pln">p </span><span
+ class="pun">.</span><span class="pln"> </span><span class="pun">?</span><span
+ class="pln">p foaf</span><span class="pun">:</span><span class="pln">name </span><span
+ class="pun">?</span><span class="pln">name </span><span class="pun">}</span>
+ </pre>
+ <p>
+ When evaluating the query, the Linked Data Caching module would then
+ transparently retrieve the resource <em>http://example.com/john.rdf</em>
+ and try to answer the query using the triples contained therein.
+ </p>
+ <h2>
+ <a id="Local_Caching"></a>Local Caching<a class="section_anchor"
+ href="#Local_Caching"></a>
+ </h2>
+ <p>When the triple data of a remote resource are retrieved, they
+ are cached locally in the Linked Media Framework's triple store in a
+ special named graph called "cache", together with provenance and cache
+ expiry information. The cache graph is special in the sense that
+ resources in this graph are by default not considered for direct
+ indexing in the semantic search (i.e. a foaf:Person retrieved from the
+ Linked Data Cloud will not be returned by the Semantic Search
+ component), and triples and resources in this graph are not included
+ in versioning.</p>
+ <p>A query to a resource is answered from the local cache as long
+ as the entry is not expired, i.e. subsequent queries to a resource
+ will be significantly faster than the first query as long as they are
+ carried out within a certain time frame. The expiry date of a resource
+ in the cache is determined in two ways:</p>
+ <ul>
+ <li>if the Linked Data server providing the original resource
+ sends an "Expires" header, the value of the header defines the expiry
+ date of the local cache entry</li>
+ <li>otherwise, if there is an endpoint configuration for the URI
+ prefix of the resource, the expiry time of the endpoint is used</li>
+ <li>otherwise, the default expiry time configured in the
+ configuration variable ldcache.expiry is used</li>
+ </ul>
+ <p></p>
+ <h2>
+ <a id="Modes_of_Operation"></a>Modes of Operation<a
+ class="section_anchor" href="#Modes_of_Operation"></a>
+ </h2>
+ <p>Since the Linked Data Cloud is distributed over the Web and some
+ services might not provide the reliability or availability necessary,
+ or some servers are not yet Linked Data aware, the Linked Data Caching
+ Module offers different modes of operation for accessing resources:</p>
+ <ul>
+ <li><strong>Linked Data</strong> (direct Linked Data access):
+ makes use of the HTTP content negotiation to directly retrieve a
+ Linked Data resource from the Web as defined in the Linked Data
+ Principles. This is the default behaviour if nothing else has been
+ configured</li>
+ <li><strong>Cache</strong> (access to a resource or entity cache
+ endpoint): retrieves the triples of a resource from a defined server
+ by accessing a cache endpoint. This is e.g. useful if there is a
+ local cache of a public server (e.g. to improve reliability or
+ performance) or if there is a "traditional" RDF server that does not
+ offer Linked Data access</li>
+ <li><strong>SPARQL</strong> (access to a resource via a SPARQL
+ endpoint): retrieves the triples of a resource from a defined SPARQL
+ endpoint by issuing a query for all triples with the resource as
+ subject. This is e.g. useful for traditional RDF servers that are
+ extended by a SPARQL endpoint using e.g. Joseki or other tools.</li>
+ <li><strong>NONE</strong> (block access to the resource): does
+ not try to retrieve the external resource. Useful for blocking access
+ for known "bad" Linked Data servers. For example, many Linked Data
+ sources contain references to Wikipedia, which does not offer its
+ data as Linked Data directly.</li>
+ </ul>
+ <p></p>
+ <p>The different modes of operation can be configured as described
+ below. In addition to the RDF/XML format, the Linked Data Caching
+ Module also supports additional RDF serialisation formats that can be
+ configured for certain Linked Data servers.</p>
+ <h1>
+ <a id="Configuration"></a>Configuration<a class="section_anchor"
+ href="#Configuration"></a>
+ </h1>
+ <p>The Linked Data Caching Module can be configured using Marmotta
+ configuration mechanism. The following section describes the
+ configuration options used.</p>
+ <h2>
+ <a id="Configuration_Options"></a>Configuration Options<a
+ class="section_anchor" href="#Configuration_Options"></a>
+ </h2>
+ <p>The following options affect the general behaviour of the Linked
+ Data Caching Module:</p>
+ <ul>
+ <li>ldcache.enabled (true/false): if set to true, transparent
+ Linked Data Caching is enabled; if set to false, remote resources
+ will never be retrieved</li>
+ <li>ldcache.fallback (true/false): try to retrieve a resource
+ using ordinary Linked Data call if no endpoint is specified; when set
+ to false, this option will not retrieve any remote resources except
+ those defined with endpoints; can be used to provide transparent
+ caching only to some specific Linked Data servers</li>
+ <li>ldcache.expiry (seconds): defines the default expiry time for
+ a resource in the cache if the server does not provide an "Expires"
+ header and the endpoint definition does not have an expiry time
+ (default: 1 day)</li>
+ <li>ldcache.fetchall (true/false): if set to true, even a query
+ for all resources will include the resources that are cached locally;
+ the default is set to false because this might lead to unexpected
+ behaviour and crawling of the whole Linked Data Cloud if not used
+ with care</li>
+ </ul>
+ <h2>
+ <a id="Endpoint_Configuration"></a>Endpoint Configuration<a
+ class="section_anchor" href="#Endpoint_Configuration"></a>
+ </h2>
+ <p>The Linked Data Caching Module allows to define URI prefix to
+ endpoint mappings. These can be used to either redirect Linked Data
+ queries to cache or SPARQL endpoints for improving performance or
+ accessing non-Linked Data resources, or for setting different
+ parameters for certain server. An endpoint definition consists of the
+ following parameters:</p>
+ <ul>
+ <li><strong>name</strong> (string): the public name of the
+ endpoint, used for displaying</li>
+ <li><strong>prefix</strong> (uri): the prefix of URIs that are
+ redirected to the endpoint; if a resource requested from the cache
+ has this prefix, it is handled by this endpoint</li>
+ <li><strong>kind</strong> (SPARQL/LINKEDDATA/CACHE/NONE): the
+ operation mode of the endpoint (see above)</li>
+ <li><strong>endpoint</strong> (uri with parameters): the URI
+ under which the endpoint can be accessed. Depending on the mode,
+ certain parameters will be replaced by actual values in the URI:
+ <ul>
+ <li>CACHE: the parameter {uri} will be replaced by the actual
+ URI of the requested resource, e.g. <span class="tt">http://api.sindice.com/v2/cache?url={uri}</span>
+ </li>
+ <li>SPARQL: the parameter {query} will be replaced by the SPARQL
+ query, the parameter {contenttype} will be replaced by the MIME type
+ to be requested from the server, e.g. <span class="tt">http://sparql.sindice.com/sparql?default-graph-uri=&query={query}&format={contenttype}</span>
+ </li>
+ </ul>
+ </li>
+ <li><strong>mimetype</strong> the MIME type to request/expect
+ from the endpoint; depends on the mode of operation:
+ <ul>
+ <li>CACHE/LINKEDDATA: any RDF serialization supported by the
+ Marmotta, e.g. application/rdf+xml, text/rdf+n3, ...</li>
+ <li>SPARQL: any SPARQL result format, e.g.
+ application/sparql-results+xml</li>
+ </ul>
+ </li>
+ <li><strong>expiry</strong> (seconds): the default expiry time
+ for this endpoint if not provided by the server itself</li>
+ </ul>
+ <h2>
+ <a id="Webservice"></a>Webservice<a class="section_anchor"
+ href="#Webservice"></a>
+ </h2>
+ <p>
+ Endpoints are configured using the Linked Data Caching Webservice
+ available under
+ <span class="tt"><APPDIR>/cache/endpoint</span>
+ ; the Webservice provides the following operations for managing
+ endpoints:
+ </p>
+ <ul>
+ <li><span class="tt">POST
+ <APPDIR>/cache/endpoint?name=...&prefix=...&endpoint=...&kind=...&mimetype=...&expiry=...</span>
+ will create a new endpoint with the given parameters</li>
+ <li><span class="tt">GET <APPDIR>/cache/endpoint/list</span> will return a
+ list of configured endpoints in JSON</li>
+ <li><span class="tt">GET <APPDIR>/cache/endpoint/{id}</span> will return
+ the endpoint configuration for the endpoint with the given internal
+ ID</li>
+ <li><span class="tt">DELETE <APPDIR>/cache/endpoint/{id}</span> will
+ delete the endpoint configuration for the endpoint with the given
+ internal ID</li>
+ </ul>
+ <p></p>
+ <p>In addition to managing endpoints, the webservice also offers
+ two methods for retrieving resources:</p>
+ <ul>
+ <li><span class="tt">GET <APPDIR>/cache/live?uri=...</span> directly
+ retrieves a resource from the endpoints or Linked Data Cloud without
+ caching it locally; used for testing endpoints</li>
+ <li><span class="tt">GET <APPDIR>/cache/cached?uri=...</span> refreshes
+ the resource with the given URI and returns nothing; the resource can
+ then be retrieved using the normal resource access webservices</li>
+ </ul>
+ <p></p>
+ <p>For your convenience, the Marmotta administration interface offers a
+ simple UI for adding, listing and removing endpoint definitions.</p>
+ <!--###END_CONTENT###-->
+</body>
+</html>
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/47855a4b/platform/ldcache/marmotta-ldcache-common/src/main/resources/web/admin/configuration.html
----------------------------------------------------------------------
diff --git a/platform/ldcache/marmotta-ldcache-common/src/main/resources/web/admin/configuration.html b/platform/ldcache/marmotta-ldcache-common/src/main/resources/web/admin/configuration.html
new file mode 100644
index 0000000..9a53ed3
--- /dev/null
+++ b/platform/ldcache/marmotta-ldcache-common/src/main/resources/web/admin/configuration.html
@@ -0,0 +1,83 @@
+<!--
+
+ 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 Configuration</title>
+ <script type="text/javascript" src="../../webjars/jquery/1.8.2/jquery.min.js"></script>
+ <script type="text/javascript" src="../../core/public/js/widgets/property_config.js"></script>
+ <script type="text/javascript" src="widgets/lmf_ldcache.js"></script>
+ <script type="text/javascript" src="../../core/public/js/widgets/configurator/configurator.js"></script>
+ <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 : "lmf_configurator",
+ blacklist:['ldcache.endpoint.','ldcache.sample.'],
+ prefix : 'ldcache'
+ }
+ var configurator = new Configurator(options);
+ $('#lmf_ldcache').lmf_ldcache({host:_SERVER_URL});
+ });
+ </script>
+ <style type="text/css">
+
+ .endpoint_status.on {
+ background-color: darkGreen;
+ }
+ .endpoint_status {
+ background-color: red;
+ border-radius: 10px 10px 10px 10px;
+ display: inline-block;
+ float: right;
+ height: 20px;
+ width: 20px;
+ }
+
+ </style>
+<!--###END_HEAD###-->
+</head>
+<body>
+<div id="main">
+<div id="contents">
+<!--###BEGIN_CONTENT###-->
+<h1>Linked Data Cache Configuration</h1>
+ <p>
+ Here you can configure the Marmotta Linked Data Cache mechanism.
+ </p>
+ <p>
+ The configuration contains:
+ </p>
+ <ul>
+ <li><a href="#lmf_configurator">Generic Parameter Configuration</a></li>
+ <li><a href="#lmf_ldcache">LD-Cache Configuration</a></li>
+ </ul>
+ <div id="lmf_configurator">
+ <h4>Loading configurator</h4>
+ </div>
+ <div id="lmf_ldcache">
+ <h4>Loading cache config</h4>
+ </div>
+<!--###END_CONTENT###-->
+</div>
+</div>
+</body>
+</html>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/47855a4b/platform/ldcache/marmotta-ldcache-common/src/main/resources/web/admin/img/ld-caching.png
----------------------------------------------------------------------
diff --git a/platform/ldcache/marmotta-ldcache-common/src/main/resources/web/admin/img/ld-caching.png b/platform/ldcache/marmotta-ldcache-common/src/main/resources/web/admin/img/ld-caching.png
new file mode 100755
index 0000000..b358706
Binary files /dev/null and b/platform/ldcache/marmotta-ldcache-common/src/main/resources/web/admin/img/ld-caching.png differ
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/47855a4b/platform/ldcache/marmotta-ldcache-common/src/main/resources/web/admin/widgets/lmf_ldcache.js
----------------------------------------------------------------------
diff --git a/platform/ldcache/marmotta-ldcache-common/src/main/resources/web/admin/widgets/lmf_ldcache.js b/platform/ldcache/marmotta-ldcache-common/src/main/resources/web/admin/widgets/lmf_ldcache.js
new file mode 100644
index 0000000..ee32b22
--- /dev/null
+++ b/platform/ldcache/marmotta-ldcache-common/src/main/resources/web/admin/widgets/lmf_ldcache.js
@@ -0,0 +1,360 @@
+/*
+ * 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.
+ */
+/**
+ * Created by . User: Thomas Kurz Date: 18.02.11 Time: 18:46 To change this
+ * template use File | Settings | File Templates.
+ */
+(function($) {
+
+ var contentBox;
+
+ var programs;
+ var buttonset;
+
+ var loadS;
+
+ // new program
+ var name;
+ var kind;
+ var prefix;
+ var endpoint;
+ var mime;
+ var expiry;
+
+ var samples;
+ var samp;
+
+ var loader;
+
+ $.fn.lmf_ldcache = function(options) {
+ var settings = {
+ host : 'http://localhost:8080/LMF/'
+ }
+
+ function addProgram() {
+
+ if (name.val() == '') {
+ alert("name may not be empty!");
+ return;
+ }
+ if (prefix.val() == '') {
+ alert("prefix may not be empty!");
+ return;
+ }
+ /*if (endpoint.val() == '') {
+ alert("endpoint may not be empty!");
+ return;
+ }
+ if (mime.val() == '') {
+ alert("mimetype may not be empty!");
+ return;
+ }*/
+ if (expiry.val() == '') {
+ alert("expiry may not be empty!");
+ return;
+ }
+ var url = settings.host + "cache/endpoint?name=" + encodeURIComponent(name.val()) + '&prefix='
+ + encodeURIComponent(prefix.val()) + '&endpoint=' + encodeURIComponent(endpoint.val()) + '&mimetype='
+ + encodeURIComponent(mime.val()) + '&kind=' + encodeURIComponent(kind.val()) + '&expiry='
+ + encodeURIComponent(expiry.val());
+ loader.html("<span>Save Values</span>");
+ // upload
+ $.ajax({
+ type : "POST",
+ url : url,
+ contentType : "text/plain",
+ success : function() {
+ loader.html("");
+ $.getJSON(settings.host + "cache/endpoint/list", function(data) {
+ writePrograms(data);
+ });
+ alert("success");
+ },
+ error : function(jXHR) {
+ loader.html("");
+ alert("Error: " + jXHR.responseText);
+ }
+ });
+ }
+
+ function removeProgram(b) {
+ var url = settings.host + "cache/endpoint/" + b.attr('data-id');
+ $.ajax({
+ type : "DELETE",
+ url : url,
+ success : function() {
+ $.getJSON(settings.host + "cache/endpoint/list", function(data) {
+ writePrograms(data);
+ });
+ alert("success");
+ },
+ error : function(jXHR, textStatus) {
+ alert("Error: " + jXHR.responseText);
+ }
+ });
+ }
+ function activateProgram(b, active) {
+ var enable = active || (b.attr('data-active') !== "true"),
+ url = settings.host + "cache/endpoint/" + b.attr('data-id') + "/enable?enable=" + enable;
+
+ $.ajax({
+ type : "POST",
+ url : url,
+ success : function() {
+ $.getJSON(settings.host + "cache/endpoint/list", function(data) {
+ writePrograms(data);
+ });
+ },
+ error : function(jXHR, textStatus) {
+ alert("Error: " + jXHR.responseText);
+ }
+ });
+ }
+
+ function writeSample(data) {
+ // contains method
+ var contains = function(array, obj) {
+ var i = array.length;
+ while (i--) {
+ if (array[i] == obj) {
+ return true;
+ }
+ }
+ return false;
+ }
+ var sorted = [];
+ for (property in data) {
+ property = property.substring(15);
+ property = property.substring(0, property.indexOf('.'));
+ if (!contains(sorted, property)) {
+ sorted.push(property);
+ }
+ }
+ sorted.sort();
+ samples = data;
+ samp = $('<select/>').change(function() {
+ loadSample(this);
+ });
+ var d = $("<div></div>");
+ loadS.append(d);
+ d.append('<br>Load Sample: ');
+ d.append(samp);
+ samp.append('<option>---select---</option>');
+ for (property in sorted) {
+ samp.append('<option>' + sorted[property] + '</option>');
+ }
+ }
+
+ function loadSample() {
+ if (samp.val() != '---select---') {
+ var x = samp.val();
+ name.val(samples['ldcache.sample.' + x + '.name'].value);
+ kind.val(samples['ldcache.sample.' + x + '.kind'].value);
+ prefix.val(samples['ldcache.sample.' + x + '.prefix'].value);
+ endpoint.val(samples['ldcache.sample.' + x + '.endpoint'].value);
+ mime.val(samples['ldcache.sample.' + x + '.mimetype'].value);
+ expiry.val(samples['ldcache.sample.' + x + '.expiry'].value);
+ } else {
+ var x = samp.val();
+ name.val('');
+ kind.val('');
+ prefix.val('');
+ endpoint.val('');
+ mime.val('');
+ expiry.val('');
+ }
+ }
+
+ function writePrograms(ps) {
+ if (ps.length == 0) {
+ programs.text("no endpoints defined");
+ return;
+ }
+ var table = $("<table class='simple_table'/>");
+ var tr = $("<tr class='title' valign='top' style='font-weight:bold;color: white;background-color:gray;'/>");
+ tr.append($("<td/>").html(" "));
+ tr.append($("<td/>").text("Name"));
+ tr.append($("<td/>").text("Kind"));
+ tr.append($("<td/>").text("Prefix"));
+ tr.append($("<td/>").text("Endpoint"));
+ tr.append($("<td/>").text("Mimetype"));
+ tr.append($("<td/>").text("Expiry"));
+ tr.append($("<td/>").text("Actions"));
+ table.append(tr);
+
+ function buildIcon(enabled) {
+ var icon = $("<span>", {'class': "endpoint_status"});
+ if (enabled) icon.addClass("on");
+ return icon;
+ }
+
+ function ctToString(obj) {
+ var ret = "";
+ for(var i = 0; i < obj.length; i++) {
+ ret += obj[i].mime;
+ if(i != obj.length-1) ret += ",";
+ }
+ return ret;
+ }
+
+ for ( var i = 0; i < ps.length; i++) {
+ if(!ps[i].volatile) {
+ var delBtn = $("<button/>").text("delete");
+ delBtn.attr('data-id', ps[i].id);
+ delBtn.click(function() {
+ removeProgram($(this));
+ });
+ var modBtn = $("<button>", {text: (ps[i].active?"deactivate":"activate"), 'data-id': ps[i].id, 'data-active':ps[i].active})
+ modBtn.click(function() {
+ activateProgram($(this));
+ });
+ }
+ var col = "";
+ if (i % 2) {
+ col = "even";
+ } else {
+ col = "odd";
+ }
+ var tr = $("<tr class='" + col + "'/>");
+ $("<td/>").append(buildIcon(ps[i].active)).appendTo(tr);
+ $("<td/>").text(ps[i].name || '').appendTo(tr);
+ $("<td/>").text(ps[i].kind || '').appendTo(tr);
+ $("<td/>").text(ps[i].prefix || '').appendTo(tr);
+ $("<td/>").text(ps[i].endpoint || '').appendTo(tr);
+ $("<td/>").text(ps[i].mimetype != undefined ? ctToString(ps[i].mimetype) : '').appendTo(tr);
+ $("<td/>").text(ps[i].expiry || '').appendTo(tr);
+ if(!ps[i].volatile) {
+ $("<td/>").append(modBtn).append(delBtn).appendTo(tr);
+ } else {
+ $("<td>autoregistered</td>").appendTo(tr);
+ }
+ table.append(tr);
+ }
+ programs.empty().append(table);
+ }
+
+ function writeContent() {
+ // set Buttons
+ var button = $("<button/>", {
+ disabled : true
+ }).text("Upload");
+
+ programs = $("<div/>").text('loading');
+ var newprogram = $("<table/>");
+ buttonset = $("<div/>");
+ button.click(function() {
+ addProgram();
+ });
+
+ loader = $("<div/>");
+ buttonset.append(button);
+ buttonset.append(loader);
+
+ loadS = $("<div style='float: right;margin-top: -60px;'></div>");
+
+ contentBox.html("<h2 style='margin-bottom: 10px;'>LD-Cache Endpoints</h2>");
+ contentBox.append(programs);
+ contentBox.append("<h4 style='margin-bottom: 10px;margin-top: 25px'>Add LD-Cache Endpoint</h4>");
+ contentBox.append(loadS);
+ contentBox.append(newprogram);
+ contentBox.append(buttonset);
+
+ $.getJSON(settings.host + "config/list?prefix=ldcache.sample", function(data) {
+ writeSample(data);
+ });
+ $.getJSON(settings.host + "cache/endpoint/list", function(data) {
+ writePrograms(data);
+ });
+
+ // add new program stuff
+ name = $("<input style='width: 100%;' type='text' size='100'>");
+ kind = $("<select>");
+ $.getJSON(settings.host + "cache/provider/list", function(data) {
+ kind.empty();
+ for ( var d in data) {
+ $("<option/>", {
+ value : data[d],
+ text : data[d]
+ }).appendTo(kind);
+ }
+ $("<option/>", {
+ value : "NONE",
+ text : "NONE (Blacklist)"
+ }).appendTo(kind);
+ }).complete(function() {
+ button.removeAttr("disabled");
+ });
+ prefix = $("<input style='width: 100%;' type='text' size='100'>");
+ endpoint = $("<input style='width: 100%;' type='text' size='100'>");
+ mime = $("<input style='width: 100%;' type='text' size='100'>");
+ expiry = $("<input style='width: 100%;' type='text' size='100'>");
+
+ newprogram.append("<tr class='title'><td>Name</td><td>Value</td></tr>")
+
+ var tr1 = $("<tr></tr>");
+ tr1.append("<td>Name</td>");
+ var td1 = $("<td></td>").append(name);
+ tr1.append(td1);
+ newprogram.append(tr1);
+
+ var tr2 = $("<tr></tr>");
+ tr2.append("<td>Kind / Provider</td>");
+ var td2 = $("<td></td>").append(kind);
+ tr2.append(td2);
+ newprogram.append(tr2);
+
+ var tr3 = $("<tr></tr>");
+ tr3.append("<td>Prefix</td>");
+ var td3 = $("<td></td>").append(prefix);
+ tr3.append(td3);
+ newprogram.append(tr3);
+
+ var tr4 = $("<tr></tr>");
+ tr4.append("<td>Enpoint</td>");
+ var td4 = $("<td></td>").append(endpoint);
+ tr4.append(td4);
+ newprogram.append(tr4);
+
+ var tr5 = $("<tr></tr>");
+ tr5.append("<td>Mimetype</td>");
+ var td5 = $("<td></td>").append(mime);
+ tr5.append(td5);
+ newprogram.append(tr5);
+
+ var tr6 = $("<tr></tr>");
+ tr6.append("<td>Expiry Time</td>");
+ var td6 = $("<td></td>").append(expiry);
+ tr6.append(td6);
+ newprogram.append(tr6);
+ }
+
+ return this.each(function() {
+ // merge options
+ if (options) {
+ $.extend(settings, options);
+ }
+ contentBox = $(this);
+ // build skeleton
+
+ writeContent();
+
+ // $.getJSON(settings.host+"import/types",
+ // function(data){write(data);});
+ });
+ };
+})(jQuery);
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/47855a4b/platform/ldcache/marmotta-ldcache-file/pom.xml
----------------------------------------------------------------------
diff --git a/platform/ldcache/marmotta-ldcache-file/pom.xml b/platform/ldcache/marmotta-ldcache-file/pom.xml
new file mode 100644
index 0000000..7bcd070
--- /dev/null
+++ b/platform/ldcache/marmotta-ldcache-file/pom.xml
@@ -0,0 +1,174 @@
+<?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-file</artifactId>
+ <packaging>jar</packaging>
+
+ <name>Apache Marmotta Platform: Linked Data Caching (File Backend)</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.
+ </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>marmotta-ldcache-common</artifactId>
+ <version>${project.parent.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.marmotta</groupId>
+ <artifactId>ldcache-sail-generic</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.marmotta</groupId>
+ <artifactId>ldcache-backend-file</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+
+
+ </dependencies>
+</project>
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/47855a4b/platform/ldcache/marmotta-ldcache-file/src/main/java/org/apache/marmotta/platform/ldcache/services/kiwi/FileLDCacheSailProvider.java
----------------------------------------------------------------------
diff --git a/platform/ldcache/marmotta-ldcache-file/src/main/java/org/apache/marmotta/platform/ldcache/services/kiwi/FileLDCacheSailProvider.java b/platform/ldcache/marmotta-ldcache-file/src/main/java/org/apache/marmotta/platform/ldcache/services/kiwi/FileLDCacheSailProvider.java
new file mode 100644
index 0000000..394a4a2
--- /dev/null
+++ b/platform/ldcache/marmotta-ldcache-file/src/main/java/org/apache/marmotta/platform/ldcache/services/kiwi/FileLDCacheSailProvider.java
@@ -0,0 +1,131 @@
+/*
+ * 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.ldcache.services.kiwi;
+
+import com.google.common.collect.Lists;
+import org.apache.marmotta.commons.sesame.filter.NotFilter;
+import org.apache.marmotta.commons.sesame.filter.OneOfFilter;
+import org.apache.marmotta.commons.sesame.filter.SesameFilter;
+import org.apache.marmotta.ldcache.backend.file.LDCachingFileBackend;
+import org.apache.marmotta.ldcache.sail.GenericLinkedDataSail;
+import org.apache.marmotta.ldcache.services.LDCache;
+import org.apache.marmotta.ldclient.api.ldclient.LDClientService;
+import org.apache.marmotta.platform.core.model.filter.MarmottaLocalFilter;
+import org.apache.marmotta.platform.ldcache.api.ldcache.LDCacheSailProvider;
+import org.openrdf.model.Resource;
+import org.openrdf.repository.RepositoryException;
+import org.openrdf.sail.NotifyingSail;
+import org.openrdf.sail.helpers.NotifyingSailWrapper;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import javax.enterprise.context.ApplicationScoped;
+import java.io.File;
+import java.util.HashSet;
+import java.util.Set;
+
+/**
+ * A sail provider service that allows wrapping a transparent Linked Data caching component around the
+ * main SAIL. This service builds on any triple stores and represents cache entries in a file structure
+ * inside the Marmotta home directory
+ *
+ * <p/>
+ * Author: Sebastian Schaffert (sschaffert@apache.org)
+ */
+@ApplicationScoped
+public class FileLDCacheSailProvider extends LDCacheSailProvider {
+
+ private static Logger log = LoggerFactory.getLogger(FileLDCacheSailProvider.class);
+
+ private LDCachingFileBackend backend;
+
+ private GenericLinkedDataSail sail;
+
+ private File directory;
+
+ /**
+ * Return the name of the provider. Used e.g. for displaying status information or logging.
+ *
+ * @return
+ */
+ @Override
+ public String getName() {
+ return "Linked Data Caching (File Backend)";
+ }
+
+
+ /**
+ * Create the sail wrapper provided by this SailProvider
+ *
+ * @param parent the parent sail to wrap by the provider
+ * @return the wrapped sail
+ */
+ @Override
+ public NotifyingSailWrapper createSail(NotifyingSail parent) {
+ Set<SesameFilter<Resource>> filters = new HashSet<SesameFilter<Resource>>();
+ filters.add(MarmottaLocalFilter.getInstance());
+ filters.addAll(Lists.newArrayList(ignoreFilters));
+
+ SesameFilter<Resource> cacheFilters = new OneOfFilter<Resource>(filters);
+
+ String cache_context = configurationService.getCacheContext();
+
+ directory = new File(configurationService.getHome() + File.separator + "ldcache");
+
+ try {
+ backend = new LDCachingFileBackend(directory);
+ sail = new GenericLinkedDataSail(parent, backend, new NotFilter<Resource>(cacheFilters), ldclientConfig);
+ return sail;
+ } catch (RepositoryException e) {
+ log.error("could not initialize LDCache file backend",e);
+ return null;
+ }
+ }
+
+
+ /**
+ * Return the Linked Data Client used by the caching system (e.g. for debugging).
+ * @return
+ */
+ public LDClientService getLDClient() {
+ if(sail != null) {
+ return sail.getLDCache().getLDClient();
+ } else {
+ return null;
+ }
+ }
+
+ /**
+ * Return the caching backend used by the caching system (e.g. for debugging)
+ * @return
+ */
+ public LDCache getLDCache() {
+ if(sail != null) {
+ return sail.getLDCache();
+ } else {
+ return null;
+ }
+ }
+
+ /**
+ * Clear the currently configured Linked Data Sail.
+ */
+ @Override
+ public void clearSail() {
+ sail = null;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/47855a4b/platform/ldcache/marmotta-ldcache-file/src/main/resources/META-INF/beans.xml
----------------------------------------------------------------------
diff --git a/platform/ldcache/marmotta-ldcache-file/src/main/resources/META-INF/beans.xml b/platform/ldcache/marmotta-ldcache-file/src/main/resources/META-INF/beans.xml
new file mode 100644
index 0000000..461858e
--- /dev/null
+++ b/platform/ldcache/marmotta-ldcache-file/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/ldcache/marmotta-ldcache-kiwi/pom.xml
----------------------------------------------------------------------
diff --git a/platform/ldcache/marmotta-ldcache-kiwi/pom.xml b/platform/ldcache/marmotta-ldcache-kiwi/pom.xml
new file mode 100644
index 0000000..f9b49e1
--- /dev/null
+++ b/platform/ldcache/marmotta-ldcache-kiwi/pom.xml
@@ -0,0 +1,174 @@
+<?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-kiwi</artifactId>
+ <packaging>jar</packaging>
+
+ <name>Apache Marmotta Platform: Linked Data Caching (KiWi Backend)</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.
+ </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>marmotta-ldcache-common</artifactId>
+ <version>${project.parent.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.marmotta</groupId>
+ <artifactId>marmotta-backend-kiwi</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.marmotta</groupId>
+ <artifactId>ldcache-sail-kiwi</artifactId>
+ </dependency>
+
+
+ </dependencies>
+</project>
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/47855a4b/platform/ldcache/marmotta-ldcache-kiwi/src/main/java/org/apache/marmotta/platform/ldcache/services/kiwi/KiWiLDCacheSailProvider.java
----------------------------------------------------------------------
diff --git a/platform/ldcache/marmotta-ldcache-kiwi/src/main/java/org/apache/marmotta/platform/ldcache/services/kiwi/KiWiLDCacheSailProvider.java b/platform/ldcache/marmotta-ldcache-kiwi/src/main/java/org/apache/marmotta/platform/ldcache/services/kiwi/KiWiLDCacheSailProvider.java
new file mode 100644
index 0000000..e97737d
--- /dev/null
+++ b/platform/ldcache/marmotta-ldcache-kiwi/src/main/java/org/apache/marmotta/platform/ldcache/services/kiwi/KiWiLDCacheSailProvider.java
@@ -0,0 +1,113 @@
+/**
+ * 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.ldcache.services.kiwi;
+
+import com.google.common.collect.Lists;
+import org.apache.marmotta.commons.sesame.filter.NotFilter;
+import org.apache.marmotta.commons.sesame.filter.OneOfFilter;
+import org.apache.marmotta.commons.sesame.filter.SesameFilter;
+import org.apache.marmotta.ldcache.sail.KiWiLinkedDataSail;
+import org.apache.marmotta.ldcache.services.LDCache;
+import org.apache.marmotta.ldclient.api.ldclient.LDClientService;
+import org.apache.marmotta.platform.core.model.filter.MarmottaLocalFilter;
+import org.apache.marmotta.platform.ldcache.api.ldcache.LDCacheSailProvider;
+import org.openrdf.model.Resource;
+import org.openrdf.sail.NotifyingSail;
+import org.openrdf.sail.helpers.NotifyingSailWrapper;
+
+import javax.enterprise.context.ApplicationScoped;
+import java.util.HashSet;
+import java.util.Set;
+
+/**
+ * A sail provider service that allows wrapping a transparent Linked Data caching component around the
+ * main SAIL. This service builds on the KiWi triple store and represents cache entries in a separate table
+ * of the database.
+ *
+ * <p/>
+ * Author: Sebastian Schaffert (sschaffert@apache.org)
+ */
+@ApplicationScoped
+public class KiWiLDCacheSailProvider extends LDCacheSailProvider {
+
+
+ private KiWiLinkedDataSail sail;
+
+ /**
+ * Return the name of the provider. Used e.g. for displaying status information or logging.
+ *
+ * @return
+ */
+ @Override
+ public String getName() {
+ return "Linked Data Caching (KiWi Backend)";
+ }
+
+
+ /**
+ * Create the sail wrapper provided by this SailProvider
+ *
+ * @param parent the parent sail to wrap by the provider
+ * @return the wrapped sail
+ */
+ @Override
+ public NotifyingSailWrapper createSail(NotifyingSail parent) {
+ Set<SesameFilter<Resource>> filters = new HashSet<SesameFilter<Resource>>();
+ filters.add(MarmottaLocalFilter.getInstance());
+ filters.addAll(Lists.newArrayList(ignoreFilters));
+
+ SesameFilter<Resource> cacheFilters = new OneOfFilter<Resource>(filters);
+
+ String cache_context = configurationService.getCacheContext();
+ sail = new KiWiLinkedDataSail(parent, new NotFilter<Resource>(cacheFilters), cache_context, ldclientConfig);
+ return sail;
+ }
+
+
+ /**
+ * Return the Linked Data Client used by the caching system (e.g. for debugging).
+ * @return
+ */
+ public LDClientService getLDClient() {
+ if(sail != null) {
+ return sail.getLDCache().getLDClient();
+ } else {
+ return null;
+ }
+ }
+
+ /**
+ * Return the caching backend used by the caching system (e.g. for debugging)
+ * @return
+ */
+ public LDCache getLDCache() {
+ if(sail != null) {
+ return sail.getLDCache();
+ } else {
+ return null;
+ }
+ }
+
+ /**
+ * Clear the currently configured Linked Data Sail.
+ */
+ @Override
+ public void clearSail() {
+ sail = null;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/47855a4b/platform/ldcache/marmotta-ldcache-kiwi/src/main/resources/META-INF/beans.xml
----------------------------------------------------------------------
diff --git a/platform/ldcache/marmotta-ldcache-kiwi/src/main/resources/META-INF/beans.xml b/platform/ldcache/marmotta-ldcache-kiwi/src/main/resources/META-INF/beans.xml
new file mode 100644
index 0000000..461858e
--- /dev/null
+++ b/platform/ldcache/marmotta-ldcache-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/ldcache/pom.xml
----------------------------------------------------------------------
diff --git a/platform/ldcache/pom.xml b/platform/ldcache/pom.xml
new file mode 100644
index 0000000..3acda06
--- /dev/null
+++ b/platform/ldcache/pom.xml
@@ -0,0 +1,65 @@
+<?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>platform-ldcache-reactor</artifactId>
+ <packaging>pom</packaging>
+
+ <name>Apache Marmotta Backends: Reactor</name>
+ <description>Different ldcache backends for the Apache Marmotta Platform</description>
+
+
+ <!-- release management -->
+ <build>
+ <plugins>
+ <!-- do not install / deploy reactor -->
+ <plugin>
+ <artifactId>maven-deploy-plugin</artifactId>
+ <configuration>
+ <skip>true</skip>
+ </configuration>
+ </plugin>
+ <plugin>
+ <artifactId>maven-install-plugin</artifactId>
+ <configuration>
+ <skip>true</skip>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+ <modules>
+ <module>marmotta-ldcache-common</module>
+
+ <!-- KiWi backend specific modules -->
+ <module>marmotta-ldcache-kiwi</module>
+
+ <!-- Native/BigData specific modules -->
+ <module>marmotta-ldcache-file</module>
+ </modules>
+
+
+</project>
[04/30] git commit: updated dependencies for kiwi-loader (now
packaged with sesame-rio-*)
Posted by ja...@apache.org.
updated dependencies for kiwi-loader (now packaged with sesame-rio-*)
Project: http://git-wip-us.apache.org/repos/asf/incubator-marmotta/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-marmotta/commit/16102901
Tree: http://git-wip-us.apache.org/repos/asf/incubator-marmotta/tree/16102901
Diff: http://git-wip-us.apache.org/repos/asf/incubator-marmotta/diff/16102901
Branch: refs/heads/MARMOTTA-345
Commit: 16102901c3899faaadd231f4a695c70c1d1d5888
Parents: 4d9a115
Author: Jakob Frank <ja...@apache.org>
Authored: Thu Oct 17 17:47:26 2013 +0200
Committer: Jakob Frank <ja...@apache.org>
Committed: Thu Oct 17 17:47:26 2013 +0200
----------------------------------------------------------------------
libraries/kiwi/kiwi-loader/pom.xml | 64 +++++++++++++++++++++++++--------
parent/pom.xml | 5 +++
2 files changed, 54 insertions(+), 15 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/16102901/libraries/kiwi/kiwi-loader/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/kiwi/kiwi-loader/pom.xml b/libraries/kiwi/kiwi-loader/pom.xml
index 9483775..c35d6e6 100644
--- a/libraries/kiwi/kiwi-loader/pom.xml
+++ b/libraries/kiwi/kiwi-loader/pom.xml
@@ -116,32 +116,66 @@
</dependency>
<dependency>
+ <groupId>org.openrdf.sesame</groupId>
+ <artifactId>sesame-rio-rdfxml</artifactId>
+ <scope>runtime</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.openrdf.sesame</groupId>
+ <artifactId>sesame-rio-turtle</artifactId>
+ <scope>runtime</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.openrdf.sesame</groupId>
+ <artifactId>sesame-rio-ntriples</artifactId>
+ <scope>runtime</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.openrdf.sesame</groupId>
+ <artifactId>sesame-rio-n3</artifactId>
+ <scope>runtime</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.openrdf.sesame</groupId>
+ <artifactId>sesame-rio-nquads</artifactId>
+ <scope>runtime</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.openrdf.sesame</groupId>
+ <artifactId>sesame-rio-ntriples</artifactId>
+ <scope>runtime</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.openrdf.sesame</groupId>
+ <artifactId>sesame-rio-rdfjson</artifactId>
+ <scope>runtime</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.openrdf.sesame</groupId>
+ <artifactId>sesame-rio-trig</artifactId>
+ <scope>runtime</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.openrdf.sesame</groupId>
+ <artifactId>sesame-rio-trig</artifactId>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
<groupId>org.apache.marmotta</groupId>
<artifactId>kiwi-triplestore</artifactId>
<scope>test</scope>
<type>test-jar</type>
</dependency>
<dependency>
- <!--
- License: CPL-1.0 http://www.opensource.org/licenses/cpl1.0
- As a MAVEN dependency it is not included in a source release.
- As a TEST dependency it is not included in a BINARY release, so no need to mention in N&L.
- -->
+ <!-- License: CPL-1.0 http://www.opensource.org/licenses/cpl1.0
+ As a MAVEN dependency it is not included in a source release. As a TEST dependency
+ it is not included in a BINARY release, so no need to mention in N&L. -->
<groupId>com.github.stefanbirkner</groupId>
<artifactId>system-rules</artifactId>
<version>1.4.0</version>
<scope>test</scope>
</dependency>
- <dependency>
- <groupId>org.openrdf.sesame</groupId>
- <artifactId>sesame-rio-turtle</artifactId>
- <scope>runtime</scope>
- </dependency>
- <dependency>
- <groupId>org.openrdf.sesame</groupId>
- <artifactId>sesame-rio-rdfxml</artifactId>
- <scope>runtime</scope>
- </dependency>
</dependencies>
</project>
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/16102901/parent/pom.xml
----------------------------------------------------------------------
diff --git a/parent/pom.xml b/parent/pom.xml
index d07a7ba..b2ac2a7 100644
--- a/parent/pom.xml
+++ b/parent/pom.xml
@@ -1082,6 +1082,11 @@
</dependency>
<dependency>
<groupId>org.openrdf.sesame</groupId>
+ <artifactId>sesame-rio-nquads</artifactId>
+ <version>${sesame.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.openrdf.sesame</groupId>
<artifactId>sesame-rio-trig</artifactId>
<version>${sesame.version}</version>
</dependency>
[02/30] git commit: Merge remote-tracking branch 'origin/develop'
into develop
Posted by ja...@apache.org.
Merge remote-tracking branch 'origin/develop' into develop
Project: http://git-wip-us.apache.org/repos/asf/incubator-marmotta/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-marmotta/commit/8d6dd726
Tree: http://git-wip-us.apache.org/repos/asf/incubator-marmotta/tree/8d6dd726
Diff: http://git-wip-us.apache.org/repos/asf/incubator-marmotta/diff/8d6dd726
Branch: refs/heads/MARMOTTA-345
Commit: 8d6dd726d241967eb23eca46a8666962d2969631
Parents: c7a5852 6fd4e02
Author: Sebastian Schaffert <ss...@apache.org>
Authored: Wed Oct 16 10:57:23 2013 +0200
Committer: Sebastian Schaffert <ss...@apache.org>
Committed: Wed Oct 16 10:57:23 2013 +0200
----------------------------------------------------------------------
.../src/main/webapp/WEB-INF/web.xml | 96 +---
.../src/test/resources/test-config.properties | 5 +-
.../src/main/webapp/WEB-INF/web.xml | 92 +---
.../src/main/webapp/WEB-INF/web.xml | 91 +---
.../src/test/resources/test-config.properties | 3 -
libraries/kiwi/kiwi-loader/pom.xml | 147 +++++
.../apache/marmotta/kiwi/loader/KiWiLoader.java | 541 +++++++++++++++++++
.../marmotta/kiwi/loader/KiWiLoaderTest.java | 219 ++++++++
.../src/test/resources/logback-test.xml | 28 +
libraries/kiwi/pom.xml | 1 +
parent/pom.xml | 8 +-
.../core/api/triplestore/ContextService.java | 27 +-
.../core/jndi/MarmottaJndiListener.java | 8 +-
.../config/ConfigurationServiceImpl.java | 1 -
.../importer/ImportWatchServiceImpl.java | 70 +--
.../triplestore/ContextServiceImpl.java | 38 +-
.../core/servlet/MarmottaH2ConsoleFilter.java | 11 +-
.../core/servlet/MarmottaOptionsFilter.java | 19 +-
.../core/servlet/MarmottaPostStartupFilter.java | 2 +
.../core/servlet/MarmottaPreStartupFilter.java | 13 +-
.../servlet/MarmottaPreStartupListener.java | 15 +-
.../core/servlet/MarmottaResourceFilter.java | 4 +
.../core/webservices/io/ImportWebService.java | 68 ++-
.../webservices/resource/MetaWebService.java | 108 ++--
.../main/resources/config-defaults.properties | 3 -
.../resources/config-descriptions.properties | 21 +-
.../webservices/SparqlWebServiceTest.java | 3 +-
27 files changed, 1188 insertions(+), 454 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/8d6dd726/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/services/config/ConfigurationServiceImpl.java
----------------------------------------------------------------------
[16/30] reorganize platform modules to give more overview over
different backends
Posted by ja...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/47855a4b/platform/marmotta-backend-bigdata/pom.xml
----------------------------------------------------------------------
diff --git a/platform/marmotta-backend-bigdata/pom.xml b/platform/marmotta-backend-bigdata/pom.xml
deleted file mode 100644
index a0bf329..0000000
--- a/platform/marmotta-backend-bigdata/pom.xml
+++ /dev/null
@@ -1,193 +0,0 @@
-<?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/marmotta-backend-bigdata/src/main/java/org/apache/marmotta/platform/backend/bigdata/BigDataSesame27Repository.java
----------------------------------------------------------------------
diff --git a/platform/marmotta-backend-bigdata/src/main/java/org/apache/marmotta/platform/backend/bigdata/BigDataSesame27Repository.java b/platform/marmotta-backend-bigdata/src/main/java/org/apache/marmotta/platform/backend/bigdata/BigDataSesame27Repository.java
deleted file mode 100644
index 1519a0b..0000000
--- a/platform/marmotta-backend-bigdata/src/main/java/org/apache/marmotta/platform/backend/bigdata/BigDataSesame27Repository.java
+++ /dev/null
@@ -1,145 +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.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.repository.sail.*;
-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/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
deleted file mode 100644
index aabced4..0000000
--- a/platform/marmotta-backend-bigdata/src/main/java/org/apache/marmotta/platform/backend/bigdata/BigDataSesame27Sail.java
+++ /dev/null
@@ -1,283 +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.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.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/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
deleted file mode 100644
index 5ae5b60..0000000
--- a/platform/marmotta-backend-bigdata/src/main/java/org/apache/marmotta/platform/backend/bigdata/BigDataStoreProvider.java
+++ /dev/null
@@ -1,125 +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.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/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
deleted file mode 100644
index 461858e..0000000
--- a/platform/marmotta-backend-bigdata/src/main/resources/META-INF/beans.xml
+++ /dev/null
@@ -1,28 +0,0 @@
-<?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/marmotta-backend-bigdata/src/main/resources/config-defaults.properties
----------------------------------------------------------------------
diff --git a/platform/marmotta-backend-bigdata/src/main/resources/config-defaults.properties b/platform/marmotta-backend-bigdata/src/main/resources/config-defaults.properties
deleted file mode 100644
index 787484e..0000000
--- a/platform/marmotta-backend-bigdata/src/main/resources/config-defaults.properties
+++ /dev/null
@@ -1,24 +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.
-#
-
-
-###############################################################################
-# BigData storage configuration
-###############################################################################
-
-bigdata.textIndex = true
-
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/47855a4b/platform/marmotta-backend-bigdata/src/main/resources/config-descriptions.properties
----------------------------------------------------------------------
diff --git a/platform/marmotta-backend-bigdata/src/main/resources/config-descriptions.properties b/platform/marmotta-backend-bigdata/src/main/resources/config-descriptions.properties
deleted file mode 100644
index 3d44328..0000000
--- a/platform/marmotta-backend-bigdata/src/main/resources/config-descriptions.properties
+++ /dev/null
@@ -1,24 +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.
-#
-
-###############################################################################
-# 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/marmotta-backend-bigdata/src/main/resources/kiwi-module.properties
----------------------------------------------------------------------
diff --git a/platform/marmotta-backend-bigdata/src/main/resources/kiwi-module.properties b/platform/marmotta-backend-bigdata/src/main/resources/kiwi-module.properties
deleted file mode 100644
index 833473d..0000000
--- a/platform/marmotta-backend-bigdata/src/main/resources/kiwi-module.properties
+++ /dev/null
@@ -1,38 +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.
-#
-
-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/marmotta-backend-bigdata/src/main/resources/web/admin/about.html
----------------------------------------------------------------------
diff --git a/platform/marmotta-backend-bigdata/src/main/resources/web/admin/about.html b/platform/marmotta-backend-bigdata/src/main/resources/web/admin/about.html
deleted file mode 100644
index cb5651e..0000000
--- a/platform/marmotta-backend-bigdata/src/main/resources/web/admin/about.html
+++ /dev/null
@@ -1,43 +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.
- -->
-<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/marmotta-backend-bigdata/src/main/resources/web/admin/configuration.html
----------------------------------------------------------------------
diff --git a/platform/marmotta-backend-bigdata/src/main/resources/web/admin/configuration.html b/platform/marmotta-backend-bigdata/src/main/resources/web/admin/configuration.html
deleted file mode 100644
index 2631de0..0000000
--- a/platform/marmotta-backend-bigdata/src/main/resources/web/admin/configuration.html
+++ /dev/null
@@ -1,53 +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.
- -->
-<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/marmotta-backend-kiwi/pom.xml
----------------------------------------------------------------------
diff --git a/platform/marmotta-backend-kiwi/pom.xml b/platform/marmotta-backend-kiwi/pom.xml
deleted file mode 100644
index abe6f37..0000000
--- a/platform/marmotta-backend-kiwi/pom.xml
+++ /dev/null
@@ -1,172 +0,0 @@
-<?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/marmotta-backend-kiwi/src/main/java/org/apache/marmotta/platform/backend/kiwi/DatabaseWebService.java
----------------------------------------------------------------------
diff --git a/platform/marmotta-backend-kiwi/src/main/java/org/apache/marmotta/platform/backend/kiwi/DatabaseWebService.java b/platform/marmotta-backend-kiwi/src/main/java/org/apache/marmotta/platform/backend/kiwi/DatabaseWebService.java
deleted file mode 100644
index 8c68a96..0000000
--- a/platform/marmotta-backend-kiwi/src/main/java/org/apache/marmotta/platform/backend/kiwi/DatabaseWebService.java
+++ /dev/null
@@ -1,109 +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.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/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
deleted file mode 100644
index 76ca65b..0000000
--- a/platform/marmotta-backend-kiwi/src/main/java/org/apache/marmotta/platform/backend/kiwi/KiWiGarbageCollectionProvider.java
+++ /dev/null
@@ -1,46 +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.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/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
deleted file mode 100644
index c406f88..0000000
--- a/platform/marmotta-backend-kiwi/src/main/java/org/apache/marmotta/platform/backend/kiwi/KiWiStoreProvider.java
+++ /dev/null
@@ -1,161 +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.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/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
deleted file mode 100644
index 461858e..0000000
--- a/platform/marmotta-backend-kiwi/src/main/resources/META-INF/beans.xml
+++ /dev/null
@@ -1,28 +0,0 @@
-<?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/marmotta-backend-kiwi/src/main/resources/config-defaults.properties
----------------------------------------------------------------------
diff --git a/platform/marmotta-backend-kiwi/src/main/resources/config-defaults.properties b/platform/marmotta-backend-kiwi/src/main/resources/config-defaults.properties
deleted file mode 100644
index dfd128a..0000000
--- a/platform/marmotta-backend-kiwi/src/main/resources/config-defaults.properties
+++ /dev/null
@@ -1,75 +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.
-#
-
-
-###############################################################################
-# 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/marmotta-backend-kiwi/src/main/resources/config-descriptions.properties
----------------------------------------------------------------------
diff --git a/platform/marmotta-backend-kiwi/src/main/resources/config-descriptions.properties b/platform/marmotta-backend-kiwi/src/main/resources/config-descriptions.properties
deleted file mode 100644
index 4bf17df..0000000
--- a/platform/marmotta-backend-kiwi/src/main/resources/config-descriptions.properties
+++ /dev/null
@@ -1,61 +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.
-#
-
-###############################################################################
-# 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/marmotta-backend-kiwi/src/main/resources/kiwi-module.properties
----------------------------------------------------------------------
diff --git a/platform/marmotta-backend-kiwi/src/main/resources/kiwi-module.properties b/platform/marmotta-backend-kiwi/src/main/resources/kiwi-module.properties
deleted file mode 100644
index de7f308..0000000
--- a/platform/marmotta-backend-kiwi/src/main/resources/kiwi-module.properties
+++ /dev/null
@@ -1,41 +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.
-#
-
-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/marmotta-backend-kiwi/src/main/resources/web/admin/about.html
----------------------------------------------------------------------
diff --git a/platform/marmotta-backend-kiwi/src/main/resources/web/admin/about.html b/platform/marmotta-backend-kiwi/src/main/resources/web/admin/about.html
deleted file mode 100644
index 706bfda..0000000
--- a/platform/marmotta-backend-kiwi/src/main/resources/web/admin/about.html
+++ /dev/null
@@ -1,62 +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.
-
--->
-<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>
-
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/47855a4b/platform/marmotta-backend-kiwi/src/main/resources/web/admin/configuration.html
----------------------------------------------------------------------
diff --git a/platform/marmotta-backend-kiwi/src/main/resources/web/admin/configuration.html b/platform/marmotta-backend-kiwi/src/main/resources/web/admin/configuration.html
deleted file mode 100644
index af9961f..0000000
--- a/platform/marmotta-backend-kiwi/src/main/resources/web/admin/configuration.html
+++ /dev/null
@@ -1,46 +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.
- -->
-<html>
-<head>
-<!--###BEGIN_HEAD###-->
- <title>Core Module Configuration</title>
- <link type="text/css" rel="stylesheet" href="../public/js/widgets/configurator/style.css">
- <script type="text/javascript" src="../../webjars/jquery/1.8.2/jquery.min.js"></script>
- <script type="text/javascript" src="js/widgets/database.js"></script>
- <script type="text/javascript">
- jQuery(document).ready(function(){
- $('#lmf_database').lmf_database({host:_SERVER_URL});
- });
- </script>
-<!--###END_HEAD###-->
-</head>
-<body>
-<div id="main">
-<div id="contents">
-<!--###BEGIN_CONTENT###-->
-<h1>KiWi Storage Backend Configuration</h1>
- <p>
- Here you can configure the database options for the Marmotta KiWi Storage Backend.<br/>
- </p>
- <div id="lmf_database">
- <h4>Loading database manager</h4>
- </div>
-<!--###END_CONTENT###-->
-</div>
-</div>
-</body>
-</html>
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/47855a4b/platform/marmotta-backend-kiwi/src/main/resources/web/admin/database.html
----------------------------------------------------------------------
diff --git a/platform/marmotta-backend-kiwi/src/main/resources/web/admin/database.html b/platform/marmotta-backend-kiwi/src/main/resources/web/admin/database.html
deleted file mode 100644
index 87b6835..0000000
--- a/platform/marmotta-backend-kiwi/src/main/resources/web/admin/database.html
+++ /dev/null
@@ -1,37 +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.
-
--->
-<html>
-<head>
- <!--###BEGIN_HEAD###-->
- <title>Core Module</title>
- <script type="text/javascript">
- (function() {
- window.open('../../database/');
- })();
- </script>
- <!--###END_HEAD###-->
-</head>
-<body>
-<!--###BEGIN_CONTENT###-->
-<h1>Manage Marmotta database via web-interface</h1>
-<a href="../../database/" target="_blank">Open database administration page in new window.</a>
-<!--###END_CONTENT###-->
-</body>
-</html>
\ No newline at end of file
[15/30] reorganize platform modules to give more overview over
different backends
Posted by ja...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/47855a4b/platform/marmotta-backend-kiwi/src/main/resources/web/admin/js/widgets/database.js
----------------------------------------------------------------------
diff --git a/platform/marmotta-backend-kiwi/src/main/resources/web/admin/js/widgets/database.js b/platform/marmotta-backend-kiwi/src/main/resources/web/admin/js/widgets/database.js
deleted file mode 100644
index 42efb8e..0000000
--- a/platform/marmotta-backend-kiwi/src/main/resources/web/admin/js/widgets/database.js
+++ /dev/null
@@ -1,303 +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.
- */
-(function( $ ){
- $.fn.lmf_database = function(options) {
- var settings = {
- host: 'http://localhost:8080/LMF/',
- anker_name: 'database',
- title: 'Database Configuration',
- loading_img: '../public/img/loader/ajax-loader_small.gif',
- toplink:true
- }
-
- //jquery elements
- var table;
-
- //basically there are 2 functions
- //1. getValues from server and write it to inputFields
- //2. storeValues after testing Configuration
- var functions = {
- input_fields:undefined,
- getValues : function(callback) {
-
- var writeValues = function(databases, values) {
- table.html("");
- this.input_fields={};
-
- //DB Type
- var tr1 = $("<tr/>");
- var td11 = $("<td/>").css({"font-weight":"bold"}).text("Database: ");
- var td12 = $("<td/>");
- this.input_fields.db_select = $("<select/>").css({'width':'200px'});
- for (value in databases) {
- this.input_fields.db_select.append("<option>" + databases[value] + "</option>");
- }
- this.input_fields.db_select.val(values["database.type"]);
- td12.append(this.input_fields.db_select);
- this.input_fields.l_div = $("<div style='float:right;margin-top: -55px;'></div>");
- table.parent().append(this.input_fields.l_div);
- td11.appendTo(tr1);
- td12.appendTo(tr1);
- tr1.appendTo(table);
-
- //DBHost
- var tr2 = $("<tr/>");
- var td21 = $("<td/>").css({"font-weight":"bold"}).text("Host: ");
- var td22 = $("<td/>");
- this.input_fields.db_host = $("<input type='text' style='width:100%'/>");
- this.input_fields.db_host.val(values["database.url"]);
- td22.append(this.input_fields.db_host);
- td21.appendTo(tr2);
- td22.appendTo(tr2);
- tr2.appendTo(table);
-
- //DBUser
- var tr3 = $("<tr/>");
- var td31 = $("<td/>").css({"font-weight":"bold"}).text("User: ");
- var td32 = $("<td/>");
- this.input_fields.db_user = $("<input type='text' style='width:100%'/>");
- this.input_fields.db_user.val(values["database.user"]);
- td32.append(this.input_fields.db_user);
- td31.appendTo(tr3);
- td32.appendTo(tr3);
- tr3.appendTo(table);
-
- //DB password
- var tr4 = $("<tr/>");
- var td41 = $("<td/>").css({"font-weight":"bold"}).text("Password: ");
- var td42 = $("<td/>");
- this.input_fields.db_pass = $("<input type='password' style='width:100%'/>");
- this.input_fields.db_pass.val(values["database.password"]);
- td42.append(this.input_fields.db_pass);
- td41.appendTo(tr4);
- td42.appendTo(tr4);
- tr4.appendTo(table);
-
- this.input_fields.db_select.change(function() {
- getUrlValue();
- });
-
- if (callback) callback();
- };
-
- var getDatabases = function() {
- //get prefixes
- var url = settings.host+"config/list?prefix=database";
- var that = this;
- $.getJSON(url,function(data) {
- var values = [];
- var databases = new Array();
- for(var property in data) {
- property = property.substring(property.indexOf('.')+1);
- property = property.substring(0,property.indexOf('.'));
- if(property!="") {
- if($.inArray(property,databases)==-1) {
- databases.push(property);
- }
- }
- }
- getDBType(databases,new Array());
- });
- };
-
- var getDBType = function(databases,values) {
- var cid = "database.type";
- var url = settings.host+"config/data/"+cid;
- $.getJSON(url,function(data) {
- values[cid] = data[cid];
- getDBHost(databases,values);
- });
- };
-
- var getDBHost = function(databases,values) {
- var cid = "database.url";
- var url = settings.host+"config/data/"+cid;
- $.getJSON(url,function(data) {
- values[cid] = data[cid];
- getDBUser(databases,values);
- });
- };
-
- var getDBUser = function(databases,values) {
- var cid = "database.user";
- var url = settings.host+"config/data/"+cid;
- $.getJSON(url,function(data) {
- values[cid] = data[cid];
- getDBPass(databases,values);
- });
- };
-
- var getDBPass = function(databases,values) {
- var cid = "database.password";
- var url = settings.host+"config/data/"+cid;
- $.getJSON(url,function(data) {
- values[cid] = data[cid];
- writeValues(databases,values);
- });
-
- };
- getDatabases();
-
- //helper
- function getUrlValue() {
- var that = this;
- $.getJSON(settings.host+"config/data/"+"database."+this.input_fields.db_select.val()+".url",function(data){
- that.input_fields.db_host.val(data["database."+that.input_fields.db_select.val()+".url"]);
- })
- }
- },
-
- ping:function() {
- var that = this;
- var dburl = input_fields.db_host.val();
- if (input_fields.db_host.val().indexOf(";") > 0) {
- dburl = input_fields.db_host.val().substring(0, input_fields.db_host.val().indexOf(";"));
- }
- var url = settings.host + "storage-kiwi/ping?type=" + input_fields.db_select.val() + "&url=" + dburl + "&user=" + input_fields.db_user.val() + "&pwd=" + input_fields.db_pass.val();
- $.ajax({
- type:"POST",
- url: url,
- success: function() {
- if(confirm("Configuration Test successfully! Save values?")){
- that.saveValues();
- }
- },
- error: function(jqXHR, statusText, errorThrown) {
- alert(errorThrown + "(" + jqXHR.status + "):\n"+jqXHR.responseText)
- }
- });
- },
-
- saveValues: function(callback) {
-
- var saveDatabase = function() {
- $.ajax({
- type:"POST",
- contentType: "application/json",
- url: settings.host + "config/data/database.type",
- data: '["' + input_fields.db_select.val() + '"]',
- success: function() {
- saveUrl();
- },
- error: function(jqXHR, statusText, errorThrown) {
- that.input_fields.l_div.html("");
- alert("Error: " + errorThrown + "(" + jqXHR.status + ")" + jqXHR.responseText);
- }
- });
- }
-
- function saveUrl() {
- $.ajax({
- type:"POST",
- contentType: "application/json",
- url: settings.host + "config/data/database.url",
- data: '["' + input_fields.db_host.val() + '"]',
- success: function() {
- saveUser();
- },
- error: function(jqXHR, statusText, errorThrown) {
- that.input_fields.l_div.html("");
- alert("Error: " + errorThrown + "(" + jqXHR.status + ")" + jqXHR.responseText);
- }
- });
- }
-
- function saveUser() {
- $.ajax({
- type:"POST",
- contentType: "application/json",
- url: settings.host + "config/data/database.user",
- data: '["' + input_fields.db_user.val() + '"]',
- success: function() {
- savePwd();
- },
- error: function(jqXHR, statusText, errorThrown) {
- that.input_fields.l_div.html("");
- alert("Error: " + errorThrown + "(" + jqXHR.status + ")" + jqXHR.responseText);
- }
- });
- }
-
- function savePwd() {
- $.ajax({
- type:"POST",
- contentType: "application/json",
- url: settings.host + "config/data/database.password",
- data: '["' + input_fields.db_pass.val() + '"]',
- success: function() {
- reinit();
- },
- error: function(jqXHR, statusText, errorThrown) {
- that.input_fields.l_div.html("");
- alert("Error: " + errorThrown + "(" + jqXHR.status + ")" + jqXHR.responseText);
- }
- });
- }
-
- function reinit() {
- var that = this;
- input_fields.l_div.html("<span>Reinitialize Database </span><img src='" + settings.loading_img + "'/>");
- $.ajax({
- type:"POST",
- url: settings.host + "system/database/reinit",
- success: function() {
- that.input_fields.l_div.html("");
- alert("Successfully reloaded!")
- },
- error: function(jqXHR, statusText, errorThrown) {
- that.input_fields.l_div.html("");
- alert("Error: " + errorThrown + "(" + jqXHR.status + ")" + jqXHR.responseText);
- }
- });
- }
- saveDatabase();
- }
- }
-
- /**
- * main method
- */
- return this.each(function() {
- // merge options
- if ( options ) {
- $.extend( settings, options );
- }
- //build skeleton
-
- //get Values
- functions.getValues();
- var top="";
- if(settings.toplink)top='<a href="#" target="_top" style="position:absolute;right:5px;font-size:12px;top:7px;text-decoration:none;">top</a>';
- //build basic view elements
- var title = $("<h2 style='position:relative;margin-bottom:10px'><a style='text-decoration:none' name='"+settings.anker_name+"'>"+settings.title+"</a><span style='margin-left:10px;display:none;' class='tiny_text,lmf_configurator_loader'><img src='"+settings.loading_img+"' alt='loading...'></span>"+top+"</h2>");
- table = $("<table style='margin:0px auto;background-color:#eeeeee;padding:20px;border:1px solid gray;-webkit-border-radius: 3px;border-radius: 3px;'></table>");
- var buttons = $("<div style='width:100%;text-align:center;padding-top:10px;margin-bottom:30px;'></div>");
- var b1 = $("<button>Reload</button>").click(function(){if(confirm("Discard all changes?"))functions.getValues()});
- var b3 = $("<button style='margin-left:10px;'>Test Configuration</button>").click(function(){functions.ping()});
- buttons.append(b1);
- buttons.append(b3);
-
- //append elements
- $(this).html("");
- $(this).append(title);
- $(this).append(table);
- $(this).append(buttons);
- });
- };
-})( jQuery );
-
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/47855a4b/platform/marmotta-backend-native/pom.xml
----------------------------------------------------------------------
diff --git a/platform/marmotta-backend-native/pom.xml b/platform/marmotta-backend-native/pom.xml
deleted file mode 100644
index 735c3ff..0000000
--- a/platform/marmotta-backend-native/pom.xml
+++ /dev/null
@@ -1,170 +0,0 @@
-<?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-native</artifactId>
-
- <name>Apache Marmotta Platform: Sesame Native Backend</name>
- <description>
- This module provides an Apache Marmotta backend using a Sesame Native Store. This is a suitable backend in
- case no database is available or no advanced features like rule-based reasoning or versioning are required.
- </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-transactions</artifactId>
- </dependency>
- <dependency>
- <groupId>org.openrdf.sesame</groupId>
- <artifactId>sesame-sail-nativerdf</artifactId>
- </dependency>
- </dependencies>
-
-
-</project>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/47855a4b/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
deleted file mode 100644
index 5aea749..0000000
--- a/platform/marmotta-backend-native/src/main/java/org/apache/marmotta/platform/backend/sesame/NativeStoreProvider.java
+++ /dev/null
@@ -1,94 +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.backend.sesame;
-
-import org.apache.marmotta.platform.core.api.config.ConfigurationService;
-import org.apache.marmotta.platform.core.api.triplestore.StoreProvider;
-import org.openrdf.repository.sail.SailRepository;
-import org.openrdf.sail.NotifyingSail;
-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;
-
-/**
- * A store implementation using a Sesame NativeStore as backend for Marmotta. The triples are stored in the
- * Marmotta home directory in the subdirectory "triples".
- *
- * @author Sebastian Schaffert (sschaffert@apache.org)
- */
-@ApplicationScoped
-public class NativeStoreProvider implements StoreProvider {
-
- @Inject
- private Logger log;
-
- @Inject
- private ConfigurationService configurationService;
-
-
-
- /**
- * Create the store provided by this SailProvider
- *
- * @return a new instance of the store
- */
- @Override
- public NotifyingSail createStore() {
- log.info("Initializing Backend: Native Store");
-
- File dataDir = new File(configurationService.getHome() + File.separator + "triples");
- return new NativeStore(dataDir);
- }
-
- /**
- * 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 "Native 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/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
deleted file mode 100644
index 461858e..0000000
--- a/platform/marmotta-backend-native/src/main/resources/META-INF/beans.xml
+++ /dev/null
@@ -1,28 +0,0 @@
-<?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/marmotta-backend-native/src/main/resources/kiwi-module.properties
----------------------------------------------------------------------
diff --git a/platform/marmotta-backend-native/src/main/resources/kiwi-module.properties b/platform/marmotta-backend-native/src/main/resources/kiwi-module.properties
deleted file mode 100644
index 5dc4a7b..0000000
--- a/platform/marmotta-backend-native/src/main/resources/kiwi-module.properties
+++ /dev/null
@@ -1,41 +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.
-#
-
-name=Storage Backend: Native
-
-container=Generic
-container.weight = 10
-
-subtitle = Configure Native Backend
-weight = 10
-
-icon_small = /admin/img/config_small.png
-
-#do not change!!!
-baseurl=/storage-native
-
-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=
-
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/47855a4b/platform/marmotta-core/src/test/java/org/apache/marmotta/platform/core/test/base/TestStoreProvider.java
----------------------------------------------------------------------
diff --git a/platform/marmotta-core/src/test/java/org/apache/marmotta/platform/core/test/base/TestStoreProvider.java b/platform/marmotta-core/src/test/java/org/apache/marmotta/platform/core/test/base/TestStoreProvider.java
index 24eb658..c12684b 100644
--- a/platform/marmotta-core/src/test/java/org/apache/marmotta/platform/core/test/base/TestStoreProvider.java
+++ b/platform/marmotta-core/src/test/java/org/apache/marmotta/platform/core/test/base/TestStoreProvider.java
@@ -25,7 +25,6 @@ import org.openrdf.sail.memory.MemoryStore;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import javax.annotation.PostConstruct;
import javax.enterprise.context.ApplicationScoped;
import javax.enterprise.inject.Alternative;
@@ -40,10 +39,6 @@ public class TestStoreProvider implements StoreProvider {
private static Logger log = LoggerFactory.getLogger(TestStoreProvider.class);
- @PostConstruct
- public void initialise() {
- log.warn("using in-memory triple store - no persistence");
- }
/**
* Create the repository using the sail given as argument. This method is needed because some backends
@@ -54,6 +49,7 @@ public class TestStoreProvider implements StoreProvider {
*/
@Override
public SailRepository createRepository(Sail sail) {
+ log.warn("using in-memory triple store - no persistence");
return new SailRepository(sail);
}
@@ -74,7 +70,7 @@ public class TestStoreProvider implements StoreProvider {
*/
@Override
public String getName() {
- return "Dummy Store";
+ return "Test Store";
}
/**
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/47855a4b/platform/marmotta-ldcache-common/pom.xml
----------------------------------------------------------------------
diff --git a/platform/marmotta-ldcache-common/pom.xml b/platform/marmotta-ldcache-common/pom.xml
deleted file mode 100644
index 788b2fc..0000000
--- a/platform/marmotta-ldcache-common/pom.xml
+++ /dev/null
@@ -1,198 +0,0 @@
-<?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)</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/47855a4b/platform/marmotta-ldcache-common/src/main/java/org/apache/marmotta/platform/ldcache/api/endpoint/LinkedDataEndpointService.java
----------------------------------------------------------------------
diff --git a/platform/marmotta-ldcache-common/src/main/java/org/apache/marmotta/platform/ldcache/api/endpoint/LinkedDataEndpointService.java b/platform/marmotta-ldcache-common/src/main/java/org/apache/marmotta/platform/ldcache/api/endpoint/LinkedDataEndpointService.java
deleted file mode 100644
index b6bd8cd..0000000
--- a/platform/marmotta-ldcache-common/src/main/java/org/apache/marmotta/platform/ldcache/api/endpoint/LinkedDataEndpointService.java
+++ /dev/null
@@ -1,87 +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.ldcache.api.endpoint;
-
-import org.apache.marmotta.ldclient.api.endpoint.Endpoint;
-import org.openrdf.model.URI;
-
-import java.util.List;
-
-/**
- * A service for managing Linked Data endpoints.
- * <p/>
- * User: sschaffe
- */
-public interface LinkedDataEndpointService {
-
- /**
- * Add a new endpoint to the system. The endpoint will be persisted in the database.
- *
- * @param endpoint
- */
- public void addEndpoint(Endpoint endpoint);
-
- /**`
- * Update the endpoint passed as argument in the database.
- *
- * @param endpoint
- */
- public void updateEndpoint(Endpoint endpoint);
-
- /**
- * List all endpoints registered in the system.
- *
- * @return a list of endpoints in the order they were added to the database.
- */
- public List<Endpoint> listEndpoints();
-
- /**
- * Remove the endpoint given as argument. The endpoint will be deleted in the database.
- *
- * @param endpoint
- */
- public void removeEndpoint(Endpoint endpoint);
-
- /**
- * Return the endpoint with the given ID.
- *
- * @param id ID of the endpoint to return.
- * @return
- */
- public Endpoint getEndpoint(String id);
-
-
-
- /**
- * Retrieve the endpoint matching the KiWiUriResource passed as argument. The endpoint is determined by
- * matching the endpoint's URI prefix with the resource URI. If no matching endpoint exists, returns null.
- * The LinkedDataClientService can then decide (based on configuration) whether to try with a standard
- * LinkedDataRequest or ignore the request.
- *
- * @param resource the KiWiUriResource to check.
- */
- public Endpoint getEndpoint(URI resource);
-
- /**
- * Test whether an endpoint definition for the given url pattern already exists.
- *
- * @param urlPattern
- * @return
- */
- public boolean hasEndpoint(String urlPattern);
-}
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/47855a4b/platform/marmotta-ldcache-common/src/main/java/org/apache/marmotta/platform/ldcache/api/ldcache/LDCacheSailProvider.java
----------------------------------------------------------------------
diff --git a/platform/marmotta-ldcache-common/src/main/java/org/apache/marmotta/platform/ldcache/api/ldcache/LDCacheSailProvider.java b/platform/marmotta-ldcache-common/src/main/java/org/apache/marmotta/platform/ldcache/api/ldcache/LDCacheSailProvider.java
deleted file mode 100644
index 2cc597d..0000000
--- a/platform/marmotta-ldcache-common/src/main/java/org/apache/marmotta/platform/ldcache/api/ldcache/LDCacheSailProvider.java
+++ /dev/null
@@ -1,191 +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.ldcache.api.ldcache;
-
-import org.apache.marmotta.ldcache.services.LDCache;
-import org.apache.marmotta.ldclient.api.endpoint.Endpoint;
-import org.apache.marmotta.ldclient.api.ldclient.LDClientService;
-import org.apache.marmotta.ldclient.model.ClientConfiguration;
-import org.apache.marmotta.platform.core.api.config.ConfigurationService;
-import org.apache.marmotta.platform.core.api.http.HttpClientService;
-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.apache.marmotta.platform.ldcache.api.endpoint.LinkedDataEndpointService;
-import org.apache.marmotta.platform.ldcache.model.filter.LDCacheIgnoreFilter;
-import org.openrdf.model.URI;
-import org.openrdf.repository.RepositoryException;
-import org.slf4j.Logger;
-
-import javax.annotation.PostConstruct;
-import javax.enterprise.event.Observes;
-import javax.enterprise.inject.Instance;
-import javax.inject.Inject;
-import java.util.HashSet;
-import java.util.Set;
-
-/**
- * A sail provider service that allows wrapping a transparent Linked Data caching component around the
- * main SAIL. This is the generic superclass for all LDCache backends.
- *
- * <p/>
- * Author: Sebastian Schaffert (sschaffert@apache.org)
- */
-public abstract class LDCacheSailProvider implements NotifyingSailProvider {
-
-
- public static final String LDCACHE_ENABLED = "ldcache.enabled";
-
- @Inject
- protected ConfigurationService configurationService;
-
- @Inject
- protected Instance<LDCacheIgnoreFilter> ignoreFilters;
-
- protected ClientConfiguration ldclientConfig;
-
- @Inject
- private Logger log;
-
- @Inject
- private LinkedDataEndpointService endpointService;
-
- @Inject
- private SesameService sesameService;
-
- @Inject
- private HttpClientService httpClientService;
-
- private Set<Endpoint> volatileEndpoints;
-
- /**
- * Return true in case the URI resource passed as argument is cached.
- * @param resource
- * @return
- */
- public boolean isCached(URI resource) throws RepositoryException {
- return getLDCache().isCached(resource.stringValue());
- }
-
- /**
- * Clear the currently configured Linked Data Sail.
- */
- public abstract void clearSail();
-
- /**
- * Return true if this sail provider is enabled in the configuration.
- *
- * @return
- */
- @Override
- public boolean isEnabled() {
- return configurationService.getBooleanConfiguration(LDCACHE_ENABLED,true);
- }
-
- public void configurationChanged(@Observes ConfigurationChangedEvent e) {
- if(e.containsChangedKey(LDCACHE_ENABLED)) {
- sesameService.restart();
-
- if(!isEnabled()) {
- clearSail();
- }
- }
- }
-
- @PostConstruct
- public void initialize() {
- volatileEndpoints = new HashSet<Endpoint>();
- ldclientConfig = new ClientConfiguration();
- updateConfig();
- }
-
- public void updateEndpoints() {
- HashSet<Endpoint> endpoints = new HashSet<Endpoint>();
- endpoints.addAll(endpointService.listEndpoints());
- endpoints.addAll(volatileEndpoints);
-
- ldclientConfig.setEndpoints(endpoints);
-
- if(getLDCache() != null) {
- getLDCache().reload();
- }
- }
-
- public void updateConfig() {
- ldclientConfig.setDefaultExpiry(configurationService.getLongConfiguration("ldcache.expiry", 86400L));
- ldclientConfig.setMinimumExpiry(configurationService.getLongConfiguration("ldcache.minexpiry", 3600L));
- ldclientConfig.setSocketTimeout(configurationService.getIntConfiguration("ldcache.so_timeout", 60000));
- ldclientConfig.setConnectionTimeout(configurationService.getIntConfiguration("ldcache.connection_timeout", 10000));
- ldclientConfig.setMaxParallelRequests(configurationService.getIntConfiguration("ldcache.max_parallel_requests",10));
-
- HashSet<Endpoint> endpoints = new HashSet<Endpoint>();
- endpoints.addAll(endpointService.listEndpoints());
- endpoints.addAll(volatileEndpoints);
- ldclientConfig.setEndpoints(endpoints);
-
- ldclientConfig.setHttpClient(httpClientService.getHttpClient());
-
- if(getLDCache() != null) {
- getLDCache().reload();
- }
- }
-
- /**
- * Return the Linked Data Client used by the caching system (e.g. for debugging).
- * @return
- */
- public abstract LDClientService getLDClient();
-
- /**
- * Return the caching backend used by the caching system (e.g. for debugging)
- * @return
- */
- public abstract LDCache getLDCache();
-
- /**
- * Add a volatile (in-memory) endpoint to the LDClient configuration. Can be used by other services for auto-registering
- * LDClient endpoints for special endpoints.
- *
- * @param endpoint
- */
- public void addVolatileEndpoint(Endpoint endpoint) {
- if(!volatileEndpoints.contains(endpoint)) {
- volatileEndpoints.add(endpoint);
- updateEndpoints();
- }
- }
-
- /**
- * Remove a volatile (in-memory) endpoint from the LDClient configuration.
- * @param endpoint
- */
- public void removeVolatileEndpoint(Endpoint endpoint) {
- if(volatileEndpoints.contains(endpoint)) {
- volatileEndpoints.remove(endpoint);
- updateEndpoints();
- }
- }
-
- /**
- * Return all configured volatile endpoints.
- * @return
- */
- public Set<Endpoint> getVolatileEndpoints() {
- return new HashSet<Endpoint>(volatileEndpoints);
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/47855a4b/platform/marmotta-ldcache-common/src/main/java/org/apache/marmotta/platform/ldcache/model/filter/LDCacheIgnoreFilter.java
----------------------------------------------------------------------
diff --git a/platform/marmotta-ldcache-common/src/main/java/org/apache/marmotta/platform/ldcache/model/filter/LDCacheIgnoreFilter.java b/platform/marmotta-ldcache-common/src/main/java/org/apache/marmotta/platform/ldcache/model/filter/LDCacheIgnoreFilter.java
deleted file mode 100644
index 9e3614f..0000000
--- a/platform/marmotta-ldcache-common/src/main/java/org/apache/marmotta/platform/ldcache/model/filter/LDCacheIgnoreFilter.java
+++ /dev/null
@@ -1,32 +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.ldcache.model.filter;
-
-import org.apache.marmotta.commons.sesame.filter.resource.ResourceFilter;
-
-/**
- * This filter can be used to define as CDI services additional filters that allow to ignore resources when
- * caching. The advantage of this approach over "blacklisting" is that filters defined in this way do not even
- * create a cache entry, they ignore the resource early on.
- *
- * The filter should return true in case the resource should be ignored.
- *
- * @author Sebastian Schaffert (sschaffert@apache.org)
- */
-public interface LDCacheIgnoreFilter extends ResourceFilter {
-}
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/47855a4b/platform/marmotta-ldcache-common/src/main/java/org/apache/marmotta/platform/ldcache/model/filter/MarmottaNotCachedFilter.java
----------------------------------------------------------------------
diff --git a/platform/marmotta-ldcache-common/src/main/java/org/apache/marmotta/platform/ldcache/model/filter/MarmottaNotCachedFilter.java b/platform/marmotta-ldcache-common/src/main/java/org/apache/marmotta/platform/ldcache/model/filter/MarmottaNotCachedFilter.java
deleted file mode 100644
index 5c40815..0000000
--- a/platform/marmotta-ldcache-common/src/main/java/org/apache/marmotta/platform/ldcache/model/filter/MarmottaNotCachedFilter.java
+++ /dev/null
@@ -1,85 +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.ldcache.model.filter;
-
-import org.apache.marmotta.commons.sesame.filter.resource.ResourceFilter;
-import org.apache.marmotta.platform.core.model.filter.MarmottaLocalFilter;
-import org.apache.marmotta.platform.core.util.CDIContext;
-import org.apache.marmotta.platform.ldcache.api.ldcache.LDCacheSailProvider;
-import org.openrdf.model.BNode;
-import org.openrdf.model.Resource;
-import org.openrdf.model.URI;
-import org.openrdf.repository.RepositoryException;
-
-/**
- * Accept only resources that are considered "not cached", i.e. do not have an entry in the caching table.
- * <p/>
- * Author: Sebastian Schaffert
- */
-public class MarmottaNotCachedFilter implements ResourceFilter {
-
- private LDCacheSailProvider cacheSailProvider;
- private MarmottaLocalFilter marmottaLocalFilter;
-
- public MarmottaNotCachedFilter() {
- cacheSailProvider = CDIContext.getInstance(LDCacheSailProvider.class);
- marmottaLocalFilter = CDIContext.getInstance(MarmottaLocalFilter.class);
- }
-
-
- private static MarmottaNotCachedFilter instance = null;
-
- public static MarmottaNotCachedFilter getInstance() {
- if(instance == null) {
- instance = new MarmottaNotCachedFilter();
- }
- return instance;
- }
-
-
- /**
- * Return false in case the filter does not accept the resource passed as argument, true otherwise.
- *
- *
- * @param resource
- * @return
- */
- @Override
- public boolean accept(Resource resource) {
- if(resource instanceof BNode) {
- return true;
- }
- if(!cacheSailProvider.isEnabled()) {
- return true;
- }
-
- if(marmottaLocalFilter.accept(resource)) {
- return true;
- }
-
- URI uri = (URI)resource;
-
- try {
- return !cacheSailProvider.getLDCache().isCached(uri.stringValue());
- } catch (RepositoryException e) {
- return false;
- }
-
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/47855a4b/platform/marmotta-ldcache-common/src/main/java/org/apache/marmotta/platform/ldcache/services/endpoint/LinkedDataEndpointServiceImpl.java
----------------------------------------------------------------------
diff --git a/platform/marmotta-ldcache-common/src/main/java/org/apache/marmotta/platform/ldcache/services/endpoint/LinkedDataEndpointServiceImpl.java b/platform/marmotta-ldcache-common/src/main/java/org/apache/marmotta/platform/ldcache/services/endpoint/LinkedDataEndpointServiceImpl.java
deleted file mode 100644
index 2a0dac4..0000000
--- a/platform/marmotta-ldcache-common/src/main/java/org/apache/marmotta/platform/ldcache/services/endpoint/LinkedDataEndpointServiceImpl.java
+++ /dev/null
@@ -1,207 +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.ldcache.services.endpoint;
-
-import com.google.common.base.Joiner;
-import org.apache.marmotta.commons.http.ContentType;
-import org.apache.marmotta.commons.http.MarmottaHttpUtils;
-import org.apache.marmotta.ldclient.api.endpoint.Endpoint;
-import org.apache.marmotta.platform.core.api.config.ConfigurationService;
-import org.apache.marmotta.platform.ldcache.api.endpoint.LinkedDataEndpointService;
-import org.openrdf.model.URI;
-import org.slf4j.Logger;
-
-import javax.annotation.PostConstruct;
-import javax.enterprise.context.ApplicationScoped;
-import javax.inject.Inject;
-import java.util.*;
-
-/**
- * Add file description here!
- * <p/>
- * User: sschaffe
- */
-@ApplicationScoped
-public class LinkedDataEndpointServiceImpl implements LinkedDataEndpointService {
-
- @Inject
- private Logger log;
-
-
- @Inject
- private ConfigurationService configurationService;
-
-
- private static Endpoint[] blacklist = new Endpoint[] {
- new Endpoint("HolyGoat", "NONE","^http://www\\.holygoat\\.co\\.uk","","",86400l),
- new Endpoint("KiWi Project","NONE","^http://www\\.kiwi-project\\.eu/","","",86400l)
- };
-
- @PostConstruct
- public void initialize() {
- log.trace("LDEndpointService starting up...");
- }
-
-
- /**
- * Add a new endpoint to the system. The endpoint will be persisted in the database.
- *
- * @param endpoint
- */
- @Override
- public void addEndpoint(Endpoint endpoint) {
- storeEndpoint(endpoint);
- }
-
- /**
- * `
- * Update the endpoint passed as argument in the database.
- *
- * @param endpoint
- */
- @Override
- public void updateEndpoint(Endpoint endpoint) {
- storeEndpoint(endpoint);
- }
-
- /**
- * List all endpoints registered in the system.
- *
- * @return a list of endpoints in the order they were added to the database.
- */
- @Override
- public List<Endpoint> listEndpoints() {
- List<Endpoint> result = new ArrayList<Endpoint>();
- for(String label : listEndpointLabels()) {
- result.add(getEndpointByLabel(label));
- }
- for(Endpoint e : blacklist) {
- if(!result.contains(e)) {
- result.add(e);
- }
- }
- return result;
- }
-
- /**
- * Remove the endpoint given as argument. The endpoint will be deleted in the database.
- *
- * @param endpoint
- */
- @Override
- public void removeEndpoint(Endpoint endpoint) {
- String label = endpoint.getName().replaceAll("[^A-Za-z0-9 ]", "").toLowerCase();
-
- List<String> keys = configurationService.listConfigurationKeys("ldcache.endpoint."+label);
- for(String key : keys) {
- configurationService.removeConfiguration(key);
- }
- }
-
- /**
- * Return the endpoint with the given ID.
- *
- * @param id ID of the endpoint to return.
- * @return
- */
- @Override
- public Endpoint getEndpoint(String id) {
- for(Endpoint endpoint : listEndpoints()) {
- if(endpoint.getName().replaceAll("[^A-Za-z0-9 ]", "").toLowerCase().equals(id)) return endpoint;
- }
- return null;
- }
-
- /**
- * Retrieve the endpoint matching the KiWiUriResource passed as argument. The endpoint is determined by
- * matching the endpoint's URI prefix with the resource URI. If no matching endpoint exists, returns null.
- * The LinkedDataClientService can then decide (based on configuration) whether to try with a standard
- * LinkedDataRequest or ignore the request.
- *
- * @param resource the KiWiUriResource to check.
- */
- @Override
- public Endpoint getEndpoint(URI resource) {
- for(Endpoint endpoint : listEndpoints()) {
- if (endpoint.handles(resource.stringValue())) return endpoint;
- }
-
- return null;
- }
-
- /**
- * Test whether an endpoint definition for the given url pattern already exists.
- *
- * @param urlPattern
- * @return
- */
- @Override
- public boolean hasEndpoint(String urlPattern) {
- for(Endpoint endpoint : listEndpoints()) {
- if(endpoint.getUriPattern() != null && endpoint.getUriPattern().equals(urlPattern)) return true;
- }
- return false;
- }
-
-
- private void storeEndpoint(Endpoint endpoint) {
-
- String label = endpoint.getName().replaceAll("[^A-Za-z0-9 ]", "").toLowerCase();
- configurationService.setConfiguration("ldcache.endpoint."+label+".name", endpoint.getName());
- configurationService.setIntConfiguration("ldcache.endpoint." + label + ".prio", endpoint.getPriority());
- configurationService.setConfiguration("ldcache.endpoint." + label + ".provider", endpoint.getType());
- configurationService.setConfiguration("ldcache.endpoint." + label + ".pattern", endpoint.getUriPattern());
- configurationService.setConfiguration("ldcache.endpoint." + label + ".service", endpoint.getEndpointUrl());
- configurationService.setLongConfiguration("ldcache.endpoint." + label + ".expiry", endpoint.getDefaultExpiry());
- configurationService.setBooleanConfiguration("ldcache.endpoint." + label + ".active", endpoint.isActive());
- configurationService.setConfiguration(
- "ldcache.endpoint." + label + ".contenttype",
- Joiner.on(",").join(endpoint.getContentTypes())
- );
- }
-
-
- private Endpoint getEndpointByLabel(String label) {
- Endpoint endpoint = new Endpoint();
-
- endpoint.setName(configurationService.getStringConfiguration("ldcache.endpoint."+label+".name"));
- endpoint.setPriority(configurationService.getIntConfiguration("ldcache.endpoint." + label + ".prio"));
- endpoint.setType(configurationService.getStringConfiguration("ldcache.endpoint." + label + ".provider"));
- endpoint.setUriPattern(configurationService.getStringConfiguration("ldcache.endpoint." + label + ".pattern"));
- endpoint.setEndpointUrl(configurationService.getStringConfiguration("ldcache.endpoint." + label + ".service"));
- endpoint.setDefaultExpiry(configurationService.getLongConfiguration("ldcache.endpoint." + label + ".expiry"));
- endpoint.setActive(configurationService.getBooleanConfiguration("ldcache.endpoint." + label + ".active"));
- endpoint.setContentTypes(new HashSet<ContentType>(
- MarmottaHttpUtils.parseAcceptHeader(
- configurationService.getStringConfiguration("ldcache.endpoint." + label + ".contenttype",""))
- ));
-
- return endpoint;
- }
-
-
- private Collection<String> listEndpointLabels() {
- Set<String> labels = new HashSet<String>();
- for(String key : configurationService.listConfigurationKeys("ldcache.endpoint")) {
- String[] components = key.split("\\.");
- labels.add(components[2]);
- }
- return labels;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/47855a4b/platform/marmotta-ldcache-common/src/main/java/org/apache/marmotta/platform/ldcache/webservices/LinkedDataCachingWebService.java
----------------------------------------------------------------------
diff --git a/platform/marmotta-ldcache-common/src/main/java/org/apache/marmotta/platform/ldcache/webservices/LinkedDataCachingWebService.java b/platform/marmotta-ldcache-common/src/main/java/org/apache/marmotta/platform/ldcache/webservices/LinkedDataCachingWebService.java
deleted file mode 100644
index 0230f9c..0000000
--- a/platform/marmotta-ldcache-common/src/main/java/org/apache/marmotta/platform/ldcache/webservices/LinkedDataCachingWebService.java
+++ /dev/null
@@ -1,314 +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.ldcache.webservices;
-
-import org.apache.marmotta.commons.sesame.model.Namespaces;
-import org.apache.marmotta.ldclient.api.endpoint.Endpoint;
-import org.apache.marmotta.ldclient.api.provider.DataProvider;
-import org.apache.marmotta.ldclient.model.ClientResponse;
-import org.apache.marmotta.ldclient.provider.rdf.LinkedDataProvider;
-import org.apache.marmotta.platform.core.api.triplestore.SesameService;
-import org.apache.marmotta.platform.ldcache.api.endpoint.LinkedDataEndpointService;
-import org.apache.marmotta.platform.ldcache.api.ldcache.LDCacheSailProvider;
-import org.openrdf.model.URI;
-import org.openrdf.repository.RepositoryConnection;
-import org.openrdf.rio.RDFHandler;
-import org.openrdf.rio.rdfxml.util.RDFXMLPrettyWriter;
-import org.slf4j.Logger;
-
-import javax.enterprise.context.ApplicationScoped;
-import javax.inject.Inject;
-import javax.ws.rs.*;
-import javax.ws.rs.core.Response;
-import javax.ws.rs.core.Response.Status;
-import java.io.ByteArrayOutputStream;
-import java.util.*;
-import java.util.regex.Pattern;
-import java.util.regex.PatternSyntaxException;
-
-/**
- * Add file description here!
- * <p/>
- * User: sschaffe
- */
-@ApplicationScoped
-@Path("/cache")
-public class LinkedDataCachingWebService {
-
- @Inject
- private Logger log;
-
- @Inject
- private LinkedDataEndpointService endpointService;
-
- @Inject
- private SesameService sesameService;
-
- @Inject
- private LDCacheSailProvider cacheSailProvider;
-
-
- @GET
- @Path("/live")
- public Response retrieveLive(@QueryParam("uri") String uri) {
- if(cacheSailProvider.isEnabled()) {
- try {
- ClientResponse response = cacheSailProvider.getLDClient().retrieveResource(uri);
-
- RepositoryConnection con = response.getTriples().getConnection();
- con.begin();
-
- ByteArrayOutputStream out = new ByteArrayOutputStream();
- RDFHandler handler = new RDFXMLPrettyWriter(out);
- con.export(handler);
-
- con.commit();
- con.close();
-
-
- return Response.ok().entity( new String(out.toByteArray(), "utf-8")).build();
- } catch (Exception e) {
- log.error("exception while retrieving resource",e);
- return Response.status(500).entity(e.getMessage()).build();
- }
- } else {
- return Response.status(Status.SERVICE_UNAVAILABLE).entity("caching is disabled").build();
- }
- }
-
- @GET
- @Path("/cached")
- public Response retrieveCached(@QueryParam("uri") String uri) {
- if(cacheSailProvider.isEnabled()) {
- URI resource = sesameService.getValueFactory().createURI(uri);
-
-
- try {
- cacheSailProvider.getLDCache().refreshResource(resource, false);
-
- return Response.ok().build();
- } catch (Exception e) {
- log.error("exception while retrieving resource",e);
- return Response.status(500).entity(e.getMessage()).build();
- }
- } else {
- return Response.status(Status.SERVICE_UNAVAILABLE).entity("caching is disabled").build();
- }
-
- }
-
- @GET
- @Path("/refresh")
- public Response refreshCached(@QueryParam("uri") String uri) {
-
- if(cacheSailProvider.isEnabled()) {
- URI resource = sesameService.getValueFactory().createURI(uri);
-
-
- try {
- cacheSailProvider.getLDCache().refreshResource(resource, true);
-
- return Response.ok().build();
- } catch (Exception e) {
- log.error("exception while retrieving resource",e);
- return Response.status(500).entity(e.getMessage()).build();
- }
- } else {
- return Response.status(Status.SERVICE_UNAVAILABLE).entity("caching is disabled").build();
- }
-
- }
-
- @POST
- @Path("/expire")
- public Response expireCache(@QueryParam("uri") String uri) {
-
- if(cacheSailProvider.isEnabled()) {
- if (uri != null) {
- URI resource = sesameService.getValueFactory().createURI(uri);
- cacheSailProvider.getLDCache().expire(resource);
- } else {
- cacheSailProvider.getLDCache().expireAll();
- }
-
- return Response.ok().build();
- } else {
- return Response.status(Status.SERVICE_UNAVAILABLE).entity("caching is disabled").build();
- }
- }
-
- @POST
- @Path("/endpoint")
- public Response registerEndpoint(@QueryParam("name") String name,
- @QueryParam("prefix") String prefix,
- @QueryParam("endpoint") String endpointUrl,
- @QueryParam("kind") String type,
- @QueryParam("mimetype") String mimetype,
- @QueryParam("expiry") long expiry) {
-
- if(cacheSailProvider.isEnabled()) {
- if (type == null || !getProviderNames().contains(type.toLowerCase())) {
- type = LinkedDataProvider.PROVIDER_NAME;
- }
-
- // Check for valid Regex
- if (prefix != null) {
- try {
- if (prefix.startsWith(Endpoint.REGEX_INDICATOR)) {
- Pattern.compile(prefix.substring(Endpoint.REGEX_INDICATOR.length()));
- } else {
- Pattern.compile(prefix);
- }
- } catch (PatternSyntaxException pse) {
- return Response.status(Status.BAD_REQUEST).entity("Invalid Regex in prefix detected").build();
- }
- }
- if (endpointUrl != null) {
- endpointUrl = endpointUrl.replace('<', '{').replace('>', '}');
- } else {
- endpointUrl = "";
- }
- if (mimetype == null) {
- mimetype ="";
- }
- Endpoint endpoint = new Endpoint(name, type, prefix, endpointUrl, mimetype, expiry);
- endpointService.addEndpoint(endpoint);
-
- cacheSailProvider.updateEndpoints();
-
-
- return Response.ok().build();
- } else {
- return Response.status(Status.SERVICE_UNAVAILABLE).entity("caching is disabled").build();
- }
-
- }
-
- @GET
- @Path("/endpoint/list")
- @Produces("application/json")
- public Response listEndpoints() {
-
- List<Map<String, Object>> result = new LinkedList<Map<String, Object>>();
- for(Endpoint endpoint : endpointService.listEndpoints()) {
- result.add(buildEndpointJSON(endpoint, false));
- }
- for(Endpoint endpoint : cacheSailProvider.getVolatileEndpoints()) {
- result.add(buildEndpointJSON(endpoint, true));
- }
-
- return Response.ok().entity(result).build();
- }
-
- @GET
- @Path("/provider/list")
- @Produces(Namespaces.MIME_TYPE_JSON)
- public Response listProviders() {
- if(cacheSailProvider.isEnabled()) {
- return Response.ok(getProviderNames()).build();
- } else {
- return Response.status(Status.SERVICE_UNAVAILABLE).entity("caching is disabled").build();
- }
- }
-
-
- @GET
- @Path("/endpoint/{id}")
- @Produces("application/json")
- public Response retrieveEndpoint(@PathParam("id") String id) {
-
- Endpoint endpoint = endpointService.getEndpoint(id);
- if (endpoint == null) return notFound(id);
-
-
- return Response.ok().entity(buildEndpointJSON(endpoint, false)).build();
- }
-
- @DELETE
- @Path("/endpoint/{id}")
- public Response removeEndpoint(@PathParam("id") String id) {
-
- Endpoint endpoint = endpointService.getEndpoint(id);
- if (endpoint == null) return notFound(id);
-
- endpointService.removeEndpoint(endpoint);
-
- cacheSailProvider.updateEndpoints();
-
- return Response.ok().build();
- }
-
- @POST
- @Path("/endpoint/{id}/enable")
- public Response enableEndpoint(@PathParam("id") String id, @QueryParam("enable") @DefaultValue("true") boolean enable) {
- Endpoint endpoint = endpointService.getEndpoint(id);
- if (endpoint == null) return notFound(id);
-
- endpoint.setActive(enable);
- endpointService.updateEndpoint(endpoint);
-
- cacheSailProvider.updateEndpoints();
-
- return Response.ok().build();
- }
-
- private Response notFound(String id) {
- return Response.status(Status.NOT_FOUND).entity("No endpoint with id " + id + " found!").build();
- }
-
- @POST
- @Path("/endpoint/{id}/disable")
- public Response disableEndpoint(@PathParam("id") String id) {
- return enableEndpoint(id, false);
- }
-
- @GET
- @Path("/info")
- @Produces("application/json")
- public Response getInformation() {
- Map<String,String> result = new HashMap<>();
- result.put("backend", cacheSailProvider.getName());
- return Response.ok(result).build();
- }
-
- private Map<String, Object> buildEndpointJSON(Endpoint endpoint, boolean isVolatile) {
- HashMap<String, Object> resultMap = new HashMap<String, Object>();
- resultMap.put("id",endpoint.getName().replaceAll("[^A-Za-z0-9 ]", "").toLowerCase());
- resultMap.put("name",endpoint.getName());
- resultMap.put("endpoint",endpoint.getEndpointUrl());
- resultMap.put("expiry", endpoint.getDefaultExpiry());
- resultMap.put("prefix",endpoint.getUriPattern());
- resultMap.put("kind",endpoint.getType().toString());
- resultMap.put("mimetype",endpoint.getContentTypes());
- resultMap.put("active", endpoint.isActive());
- resultMap.put("volatile", isVolatile);
-
- return resultMap;
- }
-
-
- private Set<String> getProviderNames() {
- Set<String> result = new HashSet<String>();
-
- for(DataProvider provider : cacheSailProvider.getLDClient().getDataProviders()) {
- result.add(provider.getName().toLowerCase());
- }
-
- return result;
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/47855a4b/platform/marmotta-ldcache-common/src/main/resources/META-INF/beans.xml
----------------------------------------------------------------------
diff --git a/platform/marmotta-ldcache-common/src/main/resources/META-INF/beans.xml b/platform/marmotta-ldcache-common/src/main/resources/META-INF/beans.xml
deleted file mode 100644
index 461858e..0000000
--- a/platform/marmotta-ldcache-common/src/main/resources/META-INF/beans.xml
+++ /dev/null
@@ -1,28 +0,0 @@
-<?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/marmotta-ldcache-common/src/main/resources/config-defaults.properties
----------------------------------------------------------------------
diff --git a/platform/marmotta-ldcache-common/src/main/resources/config-defaults.properties b/platform/marmotta-ldcache-common/src/main/resources/config-defaults.properties
deleted file mode 100644
index 750de20..0000000
--- a/platform/marmotta-ldcache-common/src/main/resources/config-defaults.properties
+++ /dev/null
@@ -1,49 +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.
-#
-
-###############################################################################
-# LMF LD caching configuration
-###############################################################################
-
-# enable/disable automatic caching of remote resources from the Linked Data Cloud; enabling leads to many
-# HTTP requests when querying and should be considered with care
-ldcache.enabled = true
-
-# default expiry time in seconds if not otherwise given (default: 1 day)
-ldcache.expiry = 86400
-
-# minimum expiry time before which a resource is refreshed from the linked data cloud (use to avoid too short expiry times returned by servers)
-ldcache.minexpiry = 3600
-
-# how long to wait in ms when no data is sent over a connection
-ldcache.so_timeout = 60000
-
-# how long to wait in ms until a connection is established
-ldcache.connection_timeout = 10000
-
-# how many http retrievals to run at most in parallel
-ldcache.max_parallel_requests = 10
-
-# Sample for a cache entry
-ldcache.sample.dbpedia.name = DBPedia Sparql
-ldcache.sample.dbpedia.kind = SPARQL
-ldcache.sample.dbpedia.prefix = http://dbpedia\\.org.*
-ldcache.sample.dbpedia.endpoint = http://dbpedia.org/sparql
-ldcache.sample.dbpedia.mimetype =
-ldcache.sample.dbpedia.expiry = 86400
-
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/47855a4b/platform/marmotta-ldcache-common/src/main/resources/config-descriptions.properties
----------------------------------------------------------------------
diff --git a/platform/marmotta-ldcache-common/src/main/resources/config-descriptions.properties b/platform/marmotta-ldcache-common/src/main/resources/config-descriptions.properties
deleted file mode 100644
index 7d6b4b4..0000000
--- a/platform/marmotta-ldcache-common/src/main/resources/config-descriptions.properties
+++ /dev/null
@@ -1,41 +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.
-#
-
-###############################################################################
-# LMF LD caching configuration
-###############################################################################
-
-ldcache.enabled.description = enable/disable automatic caching of remote resources from the Linked Data Cloud; \
- enabling leads to many HTTP requests when querying and should be considered with care
-ldcache.enabled.type = java.lang.Boolean
-
-ldcache.expiry.description = default expiry time in seconds if not otherwise given (default: 1 day)
-ldcache.expiry.type = java.lang.Integer(3600|0)
-
-ldcache.minexpiry.description = minimum expiry time before which a resource is refreshed from the linked data cloud \
- (use to avoid too short expiry times returned by servers)
-ldcache.minexpiry.type = java.lang.Integer(60|0)
-
-ldcache.so_timeout.description = how long to wait in ms when no data is sent over a connection
-ldcache.so_timeout.type = java.lang.Integer(1000|1000)
-
-ldcache.connection_timeout.description = how long to wait in ms until a connection is established
-ldcache.connection_timeout.type = java.lang.Integer(1000|1000)
-
-ldcache.max_parallel_requests.description = how many http retrievals to run at most in parallel
-ldcache.max_parallel_requests.type = java.lang.Integer(1|1|100)
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/47855a4b/platform/marmotta-ldcache-common/src/main/resources/kiwi-module.properties
----------------------------------------------------------------------
diff --git a/platform/marmotta-ldcache-common/src/main/resources/kiwi-module.properties b/platform/marmotta-ldcache-common/src/main/resources/kiwi-module.properties
deleted file mode 100644
index 3f3dd4e..0000000
--- a/platform/marmotta-ldcache-common/src/main/resources/kiwi-module.properties
+++ /dev/null
@@ -1,35 +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.
-#
-
-name=Linked Data Caching
-subtitle = Endpoints and Caches
-
-icon_small = /admin/img/ld-caching.png
-
-baseurl=/cache
-
-webservices=org.apache.marmotta.platform.ldcache.webservices.LinkedDataCachingWebService
-
-adminpage.0.title=About
-adminpage.0.link=/admin/about.html
-
-adminpage.1.title=Configuration
-adminpage.1.link=/admin/configuration.html
-
-
-
[05/30] git commit: Merge remote-tracking branch 'origin/develop'
into develop
Posted by ja...@apache.org.
Merge remote-tracking branch 'origin/develop' into develop
Project: http://git-wip-us.apache.org/repos/asf/incubator-marmotta/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-marmotta/commit/87563954
Tree: http://git-wip-us.apache.org/repos/asf/incubator-marmotta/tree/87563954
Diff: http://git-wip-us.apache.org/repos/asf/incubator-marmotta/diff/87563954
Branch: refs/heads/MARMOTTA-345
Commit: 875639547cce9bd20fce60bd04e3cf19eac2a3ee
Parents: 8d6dd72 1610290
Author: Sebastian Schaffert <ss...@apache.org>
Authored: Mon Oct 21 11:14:22 2013 +0200
Committer: Sebastian Schaffert <ss...@apache.org>
Committed: Mon Oct 21 11:14:22 2013 +0200
----------------------------------------------------------------------
.../commons/sesame/model/StatementCommons.java | 4 +-
libraries/kiwi/kiwi-loader/pom.xml | 64 +++++++++++++++-----
parent/pom.xml | 5 ++
3 files changed, 56 insertions(+), 17 deletions(-)
----------------------------------------------------------------------
[07/30] git commit: remove KiWi dependencies from marmotta-ldpath
Posted by ja...@apache.org.
remove KiWi dependencies from marmotta-ldpath
Project: http://git-wip-us.apache.org/repos/asf/incubator-marmotta/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-marmotta/commit/8ac0891d
Tree: http://git-wip-us.apache.org/repos/asf/incubator-marmotta/tree/8ac0891d
Diff: http://git-wip-us.apache.org/repos/asf/incubator-marmotta/diff/8ac0891d
Branch: refs/heads/MARMOTTA-345
Commit: 8ac0891deda2841ceae49dbb1f7b393dc28a9e78
Parents: 8fdc149
Author: Sebastian Schaffert <ss...@apache.org>
Authored: Mon Oct 21 12:10:38 2013 +0200
Committer: Sebastian Schaffert <ss...@apache.org>
Committed: Mon Oct 21 12:10:38 2013 +0200
----------------------------------------------------------------------
.../ldpath/model/functions/ContentFunction.java | 12 +++++-----
.../ldpath/webservices/LDPathWebService.java | 23 +++++++++-----------
2 files changed, 15 insertions(+), 20 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/8ac0891d/platform/marmotta-ldpath/src/main/java/org/apache/marmotta/platform/ldpath/model/functions/ContentFunction.java
----------------------------------------------------------------------
diff --git a/platform/marmotta-ldpath/src/main/java/org/apache/marmotta/platform/ldpath/model/functions/ContentFunction.java b/platform/marmotta-ldpath/src/main/java/org/apache/marmotta/platform/ldpath/model/functions/ContentFunction.java
index 4c42e28..2dd5eb8 100644
--- a/platform/marmotta-ldpath/src/main/java/org/apache/marmotta/platform/ldpath/model/functions/ContentFunction.java
+++ b/platform/marmotta-ldpath/src/main/java/org/apache/marmotta/platform/ldpath/model/functions/ContentFunction.java
@@ -17,13 +17,12 @@
*/
package org.apache.marmotta.platform.ldpath.model.functions;
-import org.apache.marmotta.platform.ldpath.api.AutoRegisteredLDPathFunction;
-import org.apache.marmotta.platform.core.api.content.ContentService;
-import org.apache.marmotta.kiwi.model.rdf.KiWiResource;
-import org.apache.marmotta.kiwi.model.rdf.KiWiStringLiteral;
import org.apache.marmotta.ldpath.api.backend.RDFBackend;
+import org.apache.marmotta.platform.core.api.content.ContentService;
+import org.apache.marmotta.platform.ldpath.api.AutoRegisteredLDPathFunction;
import org.openrdf.model.Resource;
import org.openrdf.model.Value;
+import org.openrdf.model.impl.LiteralImpl;
import org.slf4j.Logger;
import javax.annotation.PostConstruct;
@@ -77,7 +76,7 @@ public class ContentFunction extends AutoRegisteredLDPathFunction {
for(Collection<? extends Value> nodes : args) {
for(Value n : nodes) {
- if(n instanceof KiWiResource) {
+ if(n instanceof Resource) {
Resource r = (Resource)n;
String type = contentService.getContentType(r);
@@ -87,7 +86,7 @@ public class ContentFunction extends AutoRegisteredLDPathFunction {
if(type.matches(allowedType)) {
byte[] data = contentService.getContentData(r,type);
String content = new String(data);
- result.add(new KiWiStringLiteral(content));
+ result.add(new LiteralImpl(content));
break;
}
}
@@ -101,7 +100,6 @@ public class ContentFunction extends AutoRegisteredLDPathFunction {
/**
* Return the representation of the NodeFunction or NodeSelector in the RDF Path Language
*
- * @param backend
* @return
*/
@Override
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/8ac0891d/platform/marmotta-ldpath/src/main/java/org/apache/marmotta/platform/ldpath/webservices/LDPathWebService.java
----------------------------------------------------------------------
diff --git a/platform/marmotta-ldpath/src/main/java/org/apache/marmotta/platform/ldpath/webservices/LDPathWebService.java b/platform/marmotta-ldpath/src/main/java/org/apache/marmotta/platform/ldpath/webservices/LDPathWebService.java
index 9736afa..b86be40 100644
--- a/platform/marmotta-ldpath/src/main/java/org/apache/marmotta/platform/ldpath/webservices/LDPathWebService.java
+++ b/platform/marmotta-ldpath/src/main/java/org/apache/marmotta/platform/ldpath/webservices/LDPathWebService.java
@@ -17,23 +17,18 @@
*/
package org.apache.marmotta.platform.ldpath.webservices;
-import static org.apache.marmotta.commons.sesame.repository.ResultUtils.iterable;
-import static org.apache.marmotta.commons.sesame.repository.ExceptionUtils.handleRepositoryException;
-
import org.apache.commons.io.IOUtils;
-import org.apache.marmotta.platform.ldpath.api.LDPathService;
import org.apache.marmotta.commons.sesame.repository.ResourceUtils;
import org.apache.marmotta.commons.util.JSONUtils;
-
-import org.apache.marmotta.platform.core.api.triplestore.SesameService;
-import org.apache.marmotta.kiwi.model.rdf.KiWiNode;
-import org.apache.marmotta.kiwi.model.rdf.KiWiStringLiteral;
import org.apache.marmotta.ldpath.api.functions.SelectorFunction;
import org.apache.marmotta.ldpath.backend.sesame.SesameConnectionBackend;
import org.apache.marmotta.ldpath.exception.LDPathParseException;
+import org.apache.marmotta.platform.core.api.triplestore.SesameService;
+import org.apache.marmotta.platform.ldpath.api.LDPathService;
import org.openrdf.model.Namespace;
import org.openrdf.model.URI;
import org.openrdf.model.Value;
+import org.openrdf.model.impl.LiteralImpl;
import org.openrdf.repository.RepositoryConnection;
import org.openrdf.repository.RepositoryException;
import org.slf4j.Logger;
@@ -45,11 +40,13 @@ import javax.ws.rs.*;
import javax.ws.rs.core.Context;
import javax.ws.rs.core.Response;
import javax.ws.rs.core.Response.Status;
-
import java.io.IOException;
import java.text.Collator;
import java.util.*;
+import static org.apache.marmotta.commons.sesame.repository.ExceptionUtils.handleRepositoryException;
+import static org.apache.marmotta.commons.sesame.repository.ResultUtils.iterable;
+
/**
* Execute LDPath queries against the LMF backend. Depending on the LMF configuration, this might trigger retrieval
* of external Linked Data resources before returning results.
@@ -170,11 +167,11 @@ public class LDPathWebService {
for(Map.Entry<String,Collection<?>> row : ldPathService.programQuery(resource,program).entrySet()) {
List<Map<String,String>> rowList = new ArrayList<Map<String, String>>();
for(Object o : row.getValue()) {
- if(o instanceof KiWiNode) {
+ if(o instanceof Value) {
rowList.add(JSONUtils.serializeNodeAsJson((Value) o));
} else {
// we convert always to a literal
- rowList.add(JSONUtils.serializeNodeAsJson(new KiWiStringLiteral(o.toString())));
+ rowList.add(JSONUtils.serializeNodeAsJson(new LiteralImpl(o.toString())));
}
}
result.put(row.getKey(),rowList);
@@ -333,11 +330,11 @@ public class LDPathWebService {
for(Map.Entry<String,Collection<?>> row : ldPathService.programQuery(resource,program).entrySet()) {
List<Map<String,String>> rowList = new ArrayList<Map<String, String>>();
for(Object o : row.getValue()) {
- if(o instanceof KiWiNode) {
+ if(o instanceof Value) {
rowList.add(JSONUtils.serializeNodeAsJson((Value) o));
} else {
// we convert always to a literal
- rowList.add(JSONUtils.serializeNodeAsJson(new KiWiStringLiteral(o.toString())));
+ rowList.add(JSONUtils.serializeNodeAsJson(new LiteralImpl(o.toString())));
}
}
result.put(row.getKey(),rowList);
[30/30] git commit: MARMOTTA-345: allow setting the import format in
the confing file.
Posted by ja...@apache.org.
MARMOTTA-345: allow setting the import format in the confing file.
Project: http://git-wip-us.apache.org/repos/asf/incubator-marmotta/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-marmotta/commit/e4df7bdb
Tree: http://git-wip-us.apache.org/repos/asf/incubator-marmotta/tree/e4df7bdb
Diff: http://git-wip-us.apache.org/repos/asf/incubator-marmotta/diff/e4df7bdb
Branch: refs/heads/MARMOTTA-345
Commit: e4df7bdb5a6f14158d1a446e9daa334eb0b79c22
Parents: 9cc67b2
Author: Jakob Frank <ja...@apache.org>
Authored: Thu Oct 24 16:30:48 2013 +0200
Committer: Jakob Frank <ja...@apache.org>
Committed: Thu Oct 24 16:30:48 2013 +0200
----------------------------------------------------------------------
.../importer/ImportWatchServiceImpl.java | 77 ++++++++++++++------
1 file changed, 54 insertions(+), 23 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/e4df7bdb/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/services/importer/ImportWatchServiceImpl.java
----------------------------------------------------------------------
diff --git a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/services/importer/ImportWatchServiceImpl.java b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/services/importer/ImportWatchServiceImpl.java
index 1791800..66e793f 100644
--- a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/services/importer/ImportWatchServiceImpl.java
+++ b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/services/importer/ImportWatchServiceImpl.java
@@ -213,11 +213,32 @@ public class ImportWatchServiceImpl implements ImportWatchService {
String format = null;
final String fileName = file.toFile().getName();
- //mimetype detection
- RDFFormat rdfFormat = Rio.getParserFormatForFileName(fileName.replaceFirst("\\.(gz|bz2)$",""));
- if (rdfFormat != null && importService.getAcceptTypes().contains(rdfFormat.getDefaultMIMEType())) {
- format = rdfFormat.getDefaultMIMEType();
- } else {
+ final Path config = file.getParent().resolve(configurationService.getStringConfiguration(CONFIG_KEY_CONF_FILE, "config"));
+ if (Files.isReadable(config)) {
+ Properties prop = loadConfigFile(file);
+ final String fmt = prop.getProperty("format");
+ if (fmt != null) {
+ RDFFormat rdfFormat = Rio.getParserFormatForMIMEType(fmt);
+ if (rdfFormat != null) {
+ format = rdfFormat.getDefaultMIMEType();
+ log.debug("Using format {} from config file {}", format, config);
+ } else {
+ log.debug("Unknown format {} in config file {}, ignoring", fmt, config);
+ }
+ } else {
+ log.trace("No format defined in {}", config);
+ }
+ }
+
+ if (format == null) {
+ //mimetype detection
+ RDFFormat rdfFormat = Rio.getParserFormatForFileName(fileName.replaceFirst("\\.(gz|bz2)$",""));
+ if (rdfFormat != null) {
+ format = rdfFormat.getDefaultMIMEType();
+ }
+ }
+
+ if (format == null || !importService.getAcceptTypes().contains(format)) {
throw new MarmottaImportException("Suitable RDF parser not found");
}
@@ -250,6 +271,23 @@ public class ImportWatchServiceImpl implements ImportWatchService {
}
}
+ private Properties loadConfigFile(Path importFile) {
+ // Check for a configFile
+ final Path config = importFile.getParent().resolve(configurationService.getStringConfiguration(CONFIG_KEY_CONF_FILE, "config"));
+ if (Files.isReadable(config)) {
+ try {
+ Properties prop = new Properties();
+ final FileInputStream inStream = new FileInputStream(config.toFile());
+ prop.load(inStream);
+ inStream.close();
+ return prop;
+ } catch (IOException e) {
+ log.warn("could not read dirConfigFile {}: {}", config, e.getMessage());
+ }
+ }
+ return null;
+ }
+
/**
* Get the target context.
* The algorithm is as follows:
@@ -269,25 +307,18 @@ public class ImportWatchServiceImpl implements ImportWatchService {
// Check for a configFile
final Path config = file.getParent().resolve(configurationService.getStringConfiguration(CONFIG_KEY_CONF_FILE, "config"));
if (Files.isReadable(config)) {
- try {
- Properties prop = new Properties();
- final FileInputStream inStream = new FileInputStream(config.toFile());
- prop.load(inStream);
- inStream.close();
- final String _c = prop.getProperty("context");
- if (_c != null) {
- try {
- URI context = contextService.createContext(_c);
- log.debug("using context {} from config file {}", context, config);
- return context;
- } catch (URISyntaxException e) {
- log.warn("invalid context {} in config file {}, ignoring", _c, config);
- }
- } else {
- log.trace("no context defined in config file {}", config);
+ Properties prop = loadConfigFile(file);
+ final String _c = prop.getProperty("context");
+ if (_c != null) {
+ try {
+ URI context = contextService.createContext(_c);
+ log.debug("using context {} from config file {}", context, config);
+ return context;
+ } catch (URISyntaxException e) {
+ log.warn("invalid context {} in config file {}, ignoring", _c, config);
}
- } catch (IOException e) {
- log.warn("could not read dirConfigFile {}: {}", config, e.getMessage());
+ } else {
+ log.trace("no context defined in config file {}", config);
}
}
[11/30] git commit: cleanups and dependency fixes
Posted by ja...@apache.org.
cleanups and dependency fixes
Project: http://git-wip-us.apache.org/repos/asf/incubator-marmotta/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-marmotta/commit/b5b336bc
Tree: http://git-wip-us.apache.org/repos/asf/incubator-marmotta/tree/b5b336bc
Diff: http://git-wip-us.apache.org/repos/asf/incubator-marmotta/diff/b5b336bc
Branch: refs/heads/MARMOTTA-345
Commit: b5b336bc2eea1d00662fe8593923e14a144e49b3
Parents: 8e31453
Author: Sebastian Schaffert <ss...@apache.org>
Authored: Mon Oct 21 12:38:37 2013 +0200
Committer: Sebastian Schaffert <ss...@apache.org>
Committed: Mon Oct 21 12:38:37 2013 +0200
----------------------------------------------------------------------
client/marmotta-client-java/pom.xml | 5 +++
.../kiwi/persistence/KiWiPersistence.java | 4 +-
.../platform/core/util/JerseyUtils.java | 45 --------------------
.../marmotta/platform/core/util/KiWiIO.java | 35 +--------------
.../platform/core/util/WebServiceUtil.java | 16 +++++++
.../triplestore/ContextWebService.java | 42 ++++++------------
.../webservices/triplestore/LdpWebService.java | 33 ++++++--------
7 files changed, 51 insertions(+), 129 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/b5b336bc/client/marmotta-client-java/pom.xml
----------------------------------------------------------------------
diff --git a/client/marmotta-client-java/pom.xml b/client/marmotta-client-java/pom.xml
index fb27410..1181dea 100644
--- a/client/marmotta-client-java/pom.xml
+++ b/client/marmotta-client-java/pom.xml
@@ -227,6 +227,11 @@
<scope>test</scope>
</dependency>
+ <dependency>
+ <groupId>org.openrdf.sesame</groupId>
+ <artifactId>sesame-sail-memory</artifactId>
+ <scope>test</scope>
+ </dependency>
</dependencies>
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/b5b336bc/libraries/kiwi/kiwi-triplestore/src/main/java/org/apache/marmotta/kiwi/persistence/KiWiPersistence.java
----------------------------------------------------------------------
diff --git a/libraries/kiwi/kiwi-triplestore/src/main/java/org/apache/marmotta/kiwi/persistence/KiWiPersistence.java b/libraries/kiwi/kiwi-triplestore/src/main/java/org/apache/marmotta/kiwi/persistence/KiWiPersistence.java
index c8ad107..f447fdb 100644
--- a/libraries/kiwi/kiwi-triplestore/src/main/java/org/apache/marmotta/kiwi/persistence/KiWiPersistence.java
+++ b/libraries/kiwi/kiwi-triplestore/src/main/java/org/apache/marmotta/kiwi/persistence/KiWiPersistence.java
@@ -198,11 +198,11 @@ public class KiWiPersistence {
break;
case UUID_RANDOM:
idGenerator = new UUIDRandomIDGenerator();
- log.info("database key generation strategy: secure random UUIDs (fast, almost no conflicts with distribution");
+ log.info("database key generation strategy: secure random UUIDs (fast, almost no conflicts with distribution)");
break;
case SNOWFLAKE:
idGenerator = new SnowflakeIDGenerator();
- log.info("database key generation strategy: Twitter Snowflake (very fast, almost no conflicts with distribution");
+ log.info("database key generation strategy: Twitter Snowflake (very fast, almost no conflicts with distribution)");
break;
default:
idGenerator = new DatabaseSequenceIDGenerator();
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/b5b336bc/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/util/JerseyUtils.java
----------------------------------------------------------------------
diff --git a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/util/JerseyUtils.java b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/util/JerseyUtils.java
deleted file mode 100644
index f6dc6dc..0000000
--- a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/util/JerseyUtils.java
+++ /dev/null
@@ -1,45 +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.core.util;
-
-import javax.ws.rs.Path;
-
-/**
- * Utilities for working with Jersey
- *
- * @author Sergio Fernández
- *
- */
-public class JerseyUtils {
-
- /**
- * Get the resource's path
- *
- * @param resource target resource
- * @return path
- */
- public static String getResourcePath(Object resource) {
- try {
- return (String) ReflectionUtils.getAnnotationValue(resource, Path.class, "value");
- } catch (Exception e) {
- e.printStackTrace();
- return null;
- }
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/b5b336bc/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/util/KiWiIO.java
----------------------------------------------------------------------
diff --git a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/util/KiWiIO.java b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/util/KiWiIO.java
index 24c8d66..7ba8a2e 100644
--- a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/util/KiWiIO.java
+++ b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/util/KiWiIO.java
@@ -17,17 +17,10 @@
*/
package org.apache.marmotta.platform.core.util;
+import com.google.common.base.Preconditions;
+
import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
import java.io.IOException;
-import java.io.InputStream;
-import java.math.BigInteger;
-import java.security.DigestInputStream;
-import java.security.MessageDigest;
-import java.security.NoSuchAlgorithmException;
-
-import com.google.common.base.Preconditions;
/**
* Add file description here!
@@ -89,28 +82,4 @@ public class KiWiIO {
}
}
- public static String md5sum(File file) throws FileNotFoundException, IOException {
- FileInputStream fis = new FileInputStream(file);
- return md5sum(fis);
- }
-
- public static String md5sum(InputStream input) throws IOException {
- try {
- MessageDigest md;
- md = MessageDigest.getInstance("MD5");
- DigestInputStream dis = new DigestInputStream(input, md);
- try {
- byte[] buff = new byte[1024];
- // just read to get the Digest filled...
- while (dis.read(buff) > 0)
- ;
- return new BigInteger(1, md.digest()).toString(16);
- } finally {
- dis.close();
- }
- } catch (NoSuchAlgorithmException e) {
- // this should not happen
- return null;
- }
- }
}
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/b5b336bc/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/util/WebServiceUtil.java
----------------------------------------------------------------------
diff --git a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/util/WebServiceUtil.java b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/util/WebServiceUtil.java
index f39a4b0..490bef4 100644
--- a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/util/WebServiceUtil.java
+++ b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/util/WebServiceUtil.java
@@ -20,6 +20,7 @@ package org.apache.marmotta.platform.core.util;
import org.apache.commons.lang3.exception.ExceptionUtils;
import org.codehaus.jackson.map.ObjectMapper;
+import javax.ws.rs.Path;
import java.io.IOException;
import java.io.OutputStream;
import java.util.HashMap;
@@ -77,4 +78,19 @@ public class WebServiceUtil {
mapper.writeValue(out,result);
}
+
+ /**
+ * Get the resource's path
+ *
+ * @param resource target resource
+ * @return path
+ */
+ public static String getResourcePath(Object resource) {
+ try {
+ return (String) ReflectionUtils.getAnnotationValue(resource, Path.class, "value");
+ } catch (Exception e) {
+ e.printStackTrace();
+ return null;
+ }
+ }
}
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/b5b336bc/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/webservices/triplestore/ContextWebService.java
----------------------------------------------------------------------
diff --git a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/webservices/triplestore/ContextWebService.java b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/webservices/triplestore/ContextWebService.java
index b61651f..18605e9 100644
--- a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/webservices/triplestore/ContextWebService.java
+++ b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/webservices/triplestore/ContextWebService.java
@@ -17,40 +17,26 @@
*/
package org.apache.marmotta.platform.core.webservices.triplestore;
-import java.io.IOException;
-import java.io.UnsupportedEncodingException;
-import java.net.URI;
-import java.net.URISyntaxException;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.marmotta.commons.http.ContentType;
+import org.apache.marmotta.commons.http.MarmottaHttpUtils;
+import org.apache.marmotta.platform.core.api.config.ConfigurationService;
+import org.apache.marmotta.platform.core.api.exporter.ExportService;
+import org.apache.marmotta.platform.core.api.triplestore.ContextService;
+import org.apache.marmotta.platform.core.util.WebServiceUtil;
import javax.enterprise.context.ApplicationScoped;
import javax.inject.Inject;
import javax.servlet.http.HttpServletRequest;
-import javax.ws.rs.DELETE;
-import javax.ws.rs.GET;
-import javax.ws.rs.HeaderParam;
-import javax.ws.rs.PUT;
-import javax.ws.rs.Path;
-import javax.ws.rs.PathParam;
-import javax.ws.rs.Produces;
-import javax.ws.rs.QueryParam;
+import javax.ws.rs.*;
import javax.ws.rs.core.Context;
import javax.ws.rs.core.Response;
import javax.ws.rs.core.Response.Status;
-
-import org.apache.commons.lang3.StringUtils;
-import org.apache.marmotta.commons.http.ContentType;
-import org.apache.marmotta.commons.http.MarmottaHttpUtils;
-import org.apache.marmotta.platform.core.api.config.ConfigurationService;
-import org.apache.marmotta.platform.core.api.exporter.ExportService;
-import org.apache.marmotta.platform.core.api.triplestore.ContextService;
-import org.apache.marmotta.platform.core.util.JerseyUtils;
+import java.io.IOException;
+import java.io.UnsupportedEncodingException;
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.util.*;
/**
* Context Web Service
@@ -188,7 +174,7 @@ public class ContextWebService {
private String buildBaseUri() {
String root = configurationService.getBaseUri();
- return root.substring(0, root.length() - 1) + JerseyUtils.getResourcePath(this) + "/";
+ return root.substring(0, root.length() - 1) + WebServiceUtil.getResourcePath(this) + "/";
}
private String buildUri(String uuid) {
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/b5b336bc/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/webservices/triplestore/LdpWebService.java
----------------------------------------------------------------------
diff --git a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/webservices/triplestore/LdpWebService.java b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/webservices/triplestore/LdpWebService.java
index f9abcf8..d489512 100644
--- a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/webservices/triplestore/LdpWebService.java
+++ b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/webservices/triplestore/LdpWebService.java
@@ -17,32 +17,23 @@
*/
package org.apache.marmotta.platform.core.webservices.triplestore;
-import static javax.ws.rs.core.Response.status;
-
-import java.io.UnsupportedEncodingException;
-import java.net.URISyntaxException;
-import java.util.ArrayList;
-import java.util.List;
+import org.apache.marmotta.platform.core.api.config.ConfigurationService;
+import org.apache.marmotta.platform.core.api.triplestore.LdpService;
+import org.apache.marmotta.platform.core.util.WebServiceUtil;
+import org.openrdf.model.URI;
+import org.openrdf.repository.RepositoryException;
import javax.enterprise.context.ApplicationScoped;
import javax.inject.Inject;
-import javax.ws.rs.DELETE;
-import javax.ws.rs.GET;
-import javax.ws.rs.HeaderParam;
-import javax.ws.rs.POST;
-import javax.ws.rs.Path;
-import javax.ws.rs.PathParam;
-import javax.ws.rs.Produces;
-import javax.ws.rs.QueryParam;
+import javax.ws.rs.*;
import javax.ws.rs.core.Response;
import javax.ws.rs.core.Response.Status;
+import java.io.UnsupportedEncodingException;
+import java.net.URISyntaxException;
+import java.util.ArrayList;
+import java.util.List;
-import org.apache.marmotta.platform.core.api.config.ConfigurationService;
-import org.apache.marmotta.platform.core.api.triplestore.LdpService;
-import org.apache.marmotta.platform.core.util.JerseyUtils;
-
-import org.openrdf.model.URI;
-import org.openrdf.repository.RepositoryException;
+import static javax.ws.rs.core.Response.status;
/**
* LDP Web Service (isolated for the moment for experimenting with
@@ -143,7 +134,7 @@ public class LdpWebService {
private String buildBaseUri() {
String root = configurationService.getBaseUri();
- return root.substring(0, root.length() - 1) + JerseyUtils.getResourcePath(this) + "/";
+ return root.substring(0, root.length() - 1) + WebServiceUtil.getResourcePath(this) + "/";
}
private String buildUri(String uuid) {
[29/30] git commit: MARMOTTA-296: local file import can now handle
.gz and .bz2 compressed files
Posted by ja...@apache.org.
MARMOTTA-296: local file import can now handle .gz and .bz2 compressed files
Project: http://git-wip-us.apache.org/repos/asf/incubator-marmotta/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-marmotta/commit/9cc67b2c
Tree: http://git-wip-us.apache.org/repos/asf/incubator-marmotta/tree/9cc67b2c
Diff: http://git-wip-us.apache.org/repos/asf/incubator-marmotta/diff/9cc67b2c
Branch: refs/heads/MARMOTTA-345
Commit: 9cc67b2c8482923605f1c3c51738b5d51c78d812
Parents: 1336607
Author: Jakob Frank <ja...@apache.org>
Authored: Thu Oct 24 16:10:21 2013 +0200
Committer: Jakob Frank <ja...@apache.org>
Committed: Thu Oct 24 16:10:21 2013 +0200
----------------------------------------------------------------------
platform/marmotta-core/pom.xml | 5 +
.../importer/ImportWatchServiceImpl.java | 381 ++++++++++---------
2 files changed, 206 insertions(+), 180 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/9cc67b2c/platform/marmotta-core/pom.xml
----------------------------------------------------------------------
diff --git a/platform/marmotta-core/pom.xml b/platform/marmotta-core/pom.xml
index d435294..a2c4124 100644
--- a/platform/marmotta-core/pom.xml
+++ b/platform/marmotta-core/pom.xml
@@ -258,6 +258,11 @@
<artifactId>commons-net</artifactId>
</dependency>
<dependency>
+ <groupId>org.apache.commons</groupId>
+ <artifactId>commons-compress</artifactId>
+ <version>1.5</version>
+ </dependency>
+ <dependency>
<groupId>commons-codec</groupId>
<artifactId>commons-codec</artifactId>
</dependency>
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/9cc67b2c/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/services/importer/ImportWatchServiceImpl.java
----------------------------------------------------------------------
diff --git a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/services/importer/ImportWatchServiceImpl.java b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/services/importer/ImportWatchServiceImpl.java
index d8bb130..1791800 100644
--- a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/services/importer/ImportWatchServiceImpl.java
+++ b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/services/importer/ImportWatchServiceImpl.java
@@ -21,6 +21,7 @@ import java.io.BufferedInputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
+import java.io.InputStream;
import java.io.UnsupportedEncodingException;
import java.net.URISyntaxException;
import java.net.URLDecoder;
@@ -38,11 +39,13 @@ import java.util.Properties;
import java.util.concurrent.ScheduledFuture;
import java.util.concurrent.ScheduledThreadPoolExecutor;
import java.util.concurrent.TimeUnit;
+import java.util.zip.GZIPInputStream;
import javax.enterprise.context.ApplicationScoped;
import javax.enterprise.event.Observes;
import javax.inject.Inject;
+import org.apache.commons.compress.compressors.bzip2.BZip2CompressorInputStream;
import org.apache.commons.lang3.StringUtils;
import org.apache.marmotta.commons.nio.watch.SimpleTreeWatcher;
import org.apache.marmotta.platform.core.api.config.ConfigurationService;
@@ -74,7 +77,7 @@ import com.ibm.icu.text.CharsetMatch;
@ApplicationScoped
public class ImportWatchServiceImpl implements ImportWatchService {
- private static final String CONFIG_PREFIX = "file-import.";
+ private static final String CONFIG_PREFIX = "file-import.";
private static final String CONFIG_KEY_LOCK_FILE = CONFIG_PREFIX + "lockFile";
private static final String CONFIG_KEY_CONF_FILE = CONFIG_PREFIX + "dirConfigFile";
private static final String CONFIG_KEY_IMPORT_DELAY = CONFIG_PREFIX + "importDelay";
@@ -83,56 +86,56 @@ public class ImportWatchServiceImpl implements ImportWatchService {
private static final String TASK_GROUP = "Import Watch";
- private static final String TASK_DETAIL_PATH = "path";
- private static final String TASK_DETAIL_QUEUE = "import queue";
-
- @Inject
- private Logger log;
+ private static final String TASK_DETAIL_PATH = "path";
+ private static final String TASK_DETAIL_QUEUE = "import queue";
- @Inject
- private TaskManagerService taskManagerService;
+ @Inject
+ private Logger log;
- @Inject
- private ConfigurationService configurationService;
+ @Inject
+ private TaskManagerService taskManagerService;
- @Inject
- private ImportService importService;
+ @Inject
+ private ConfigurationService configurationService;
- @Inject
- private ContextService contextService;
+ @Inject
+ private ImportService importService;
+
+ @Inject
+ private ContextService contextService;
+
+ @Inject
+ private UserService userService;
- @Inject
- private UserService userService;
-
private ImportWatcher importWatcher = null;
/**
* Initialize and start the watcher service.
*/
- @Override
- public void startup() {
- if (importWatcher == null && configurationService.getBooleanConfiguration(CONFIG_KEY_SERVICE_ENABLED, true)) {
- importWatcher = new ImportWatcher(getImportRoot());
- importWatcher.setDeleteAfterImport(configurationService.getBooleanConfiguration(CONFIG_KEY_DELETE_AFTER_IMPORT, true));
+ @Override
+ public void startup() {
+ if (importWatcher == null && configurationService.getBooleanConfiguration(CONFIG_KEY_SERVICE_ENABLED, true)) {
+ importWatcher = new ImportWatcher(getImportRoot());
+ importWatcher.setDeleteAfterImport(configurationService.getBooleanConfiguration(CONFIG_KEY_DELETE_AFTER_IMPORT, true));
importWatcher.setImportDelay(configurationService.getIntConfiguration(CONFIG_KEY_IMPORT_DELAY, 2500));
- importWatcher.setDirConfigFileName(configurationService.getStringConfiguration(CONFIG_KEY_CONF_FILE, "config"));
- importWatcher.setLockFile(configurationService.getStringConfiguration(CONFIG_KEY_LOCK_FILE, "lock"));
- new Thread(importWatcher).start();
- }
- }
-
- /**
- * The import root. all files put into this directory (and any subdir) will be imported.
- * Directories containing a file called "lock" (configurable, see {@link #CONFIG_KEY_LOCK_FILE}) are ignored.
- */
- @Override
+ importWatcher.setDirConfigFileName(configurationService.getStringConfiguration(CONFIG_KEY_CONF_FILE, "config"));
+ importWatcher.setLockFile(configurationService.getStringConfiguration(CONFIG_KEY_LOCK_FILE, "lock"));
+ new Thread(importWatcher).start();
+ }
+ }
+
+ /**
+ * The import root. all files put into this directory (and any subdir) will be imported.
+ * Directories containing a file called "lock" (configurable, see {@link #CONFIG_KEY_LOCK_FILE}) are ignored.
+ */
+ @Override
public Path getImportRoot() {
return Paths.get(configurationService.getHome(), ConfigurationService.DIR_IMPORT).toAbsolutePath();
}
-
- /**
- * Shutdown the directory.
- */
+
+ /**
+ * Shutdown the directory.
+ */
@Override
public void shutdown() {
if (importWatcher != null) {
@@ -144,7 +147,7 @@ public class ImportWatchServiceImpl implements ImportWatchService {
importWatcher = null;
}
}
-
+
protected void onConfigurationChangedEvent(@Observes ConfigurationChangedEvent event) {
if (event.containsChangedKeyWithPrefix(CONFIG_PREFIX)) {
if (event.containsChangedKey(CONFIG_KEY_SERVICE_ENABLED)) {
@@ -159,163 +162,181 @@ public class ImportWatchServiceImpl implements ImportWatchService {
}
}
- protected void onSystemStartupEvent(@Observes SystemStartupEvent event) {
- shutdown();
- startup();
- }
-
- /**
- * Import the given file.
- * @see #importFile(Path)
- */
- @Override
- public boolean importFile(File file) throws MarmottaImportException {
- return importFile(file.toPath());
- }
-
- /**
- * Import the given file.
- * TODO
- */
- @Override
- public boolean importFile(Path file) throws MarmottaImportException {
- try {
- URI context;
+ protected void onSystemStartupEvent(@Observes SystemStartupEvent event) {
+ shutdown();
+ startup();
+ }
+
+ /**
+ * Import the given file.
+ * @see #importFile(Path)
+ */
+ @Override
+ public boolean importFile(File file) throws MarmottaImportException {
+ return importFile(file.toPath());
+ }
+
+ /**
+ * Import the given file.
+ * The format of the input file is detected based on the filename, as is an optional compression of the file (known formats: GZip and BZip2)
+ * @param file the file to import
+ * @throws MarmottaImportException if the import failed due to various reasons.
+ */
+ @Override
+ public boolean importFile(Path file) throws MarmottaImportException {
+ try {
+ URI context;
try {
context = getTargetContext(file);
} catch (URISyntaxException e) {
log.warn("Could not build context for file {}: {}", file, e.getMessage());
context = null;
}
- String format = detectFormat(file);
- FileInputStream is = new FileInputStream(file.toFile());
- URI user = userService.getAdminUser();
- importService.importData(is, format, user, context);
- return true;
- } catch (IOException e) {
- throw new MarmottaImportException("Could not read input file " + file.toFile().getAbsolutePath(), e);
- }
- }
-
- /**
- * Detect the import format of the given file (mime-type)
- * @param file the file to check
- * @return the mime-type
- * @throws MarmottaImportException
- */
- private String detectFormat(Path file) throws MarmottaImportException {
- String format = null;
- final String fileName = file.toFile().getName();
-
- //mimetype detection
- RDFFormat rdfFormat = Rio.getParserFormatForFileName(fileName);
- if (rdfFormat != null && importService.getAcceptTypes().contains(rdfFormat.getDefaultMIMEType())) {
- format = rdfFormat.getDefaultMIMEType();
- } else {
- throw new MarmottaImportException("Suitable RDF parser not found");
- }
-
- // encoding detection
- // FIXME: is this required?
- try (BufferedInputStream bis = new BufferedInputStream(new FileInputStream(file.toFile()))) {
- CharsetDetector cd = new CharsetDetector();
- cd.setText(bis);
- CharsetMatch cm = cd.detect();
- if (cm != null) {
- format += "; charset=" + cm.getName();
- }
- } catch (IOException e) {
- log.error("Error detecting charset for '{}': {}", fileName, e.getMessage());
- }
-
- return format;
- }
-
- /**
- * Get the target context.
- * The algorithm is as follows:
- * <ol>
- * <li>check for a file "conf" (configurable, see {@link #CONFIG_KEY_CONF_FILE}) which specifies
- * the target content using {@link Properties} syntax (key {@code context}), then use is; or
- * <li>check if the sub-directory is a url-encoded URI, then use it; or
- * <li>construct the context by using {@link ConfigurationService#getBaseContext()} and the relative sub-dirs and use it; or
- * <li>use the default context as a general fallback.
- * </ol>
- *
- * @param file the file
- * @return the context URI
- * @throws URISyntaxException
- */
- private URI getTargetContext(Path file) throws URISyntaxException {
- // Check for a configFile
- final Path config = file.getParent().resolve(configurationService.getStringConfiguration(CONFIG_KEY_CONF_FILE, "config"));
- if (Files.isReadable(config)) {
- try {
- Properties prop = new Properties();
- prop.load(new FileInputStream(config.toFile()));
- final String _c = prop.getProperty("context");
- if (_c != null) {
- try {
- URI context = contextService.createContext(_c);
- log.debug("using context {} from config file {}", context, config);
- return context;
- } catch (URISyntaxException e) {
- log.warn("invalid context {} in config file {}, ignoring", _c, config);
- }
- } else {
- log.trace("no context defined in config file {}", config);
- }
- } catch (IOException e) {
- log.warn("could not read dirConfigFile {}: {}", config, e.getMessage());
- }
- }
-
- // Check for url-encoded directory
- Path subDir = file.getParent().relativize(getImportRoot());
- if (StringUtils.isBlank(subDir.toString())) {
- log.trace("using default context for file {}", file);
- return contextService.getDefaultContext();
- } else if (StringUtils.startsWith(subDir.toString(), "http%3A%2F%2F")){
- log.debug("using url-encoded context {} for import of {}", subDir, file);
- try {
- return contextService.createContext(URLDecoder.decode(subDir.toString(), "UTF-8"));
- } catch (UnsupportedEncodingException e) {
- log.error("Error url-decoding context name '{}', so using the default one: {}", subDir, e.getMessage());
- return contextService.getDefaultContext();
- }
- } else {
- final String _c = String.format("%s/%s", configurationService.getBaseContext().replaceFirst("/$", ""), subDir);
- final URI context = contextService.createContext(_c);
- log.debug("using context {} based on relative subdir {} for file {}", context, subDir, file);
+ String format = detectFormat(file);
+ InputStream is = openStream(file);
+ URI user = userService.getAdminUser();
+ importService.importData(is, format, user, context);
+ is.close();
+ return true;
+ } catch (IOException e) {
+ throw new MarmottaImportException("Could not read input file " + file.toFile().getAbsolutePath(), e);
+ }
+ }
+
+ /**
+ * Detect the import format of the given file (mime-type)
+ * @param file the file to check
+ * @return the mime-type
+ * @throws MarmottaImportException
+ */
+ private String detectFormat(Path file) throws MarmottaImportException {
+ String format = null;
+ final String fileName = file.toFile().getName();
+
+ //mimetype detection
+ RDFFormat rdfFormat = Rio.getParserFormatForFileName(fileName.replaceFirst("\\.(gz|bz2)$",""));
+ if (rdfFormat != null && importService.getAcceptTypes().contains(rdfFormat.getDefaultMIMEType())) {
+ format = rdfFormat.getDefaultMIMEType();
+ } else {
+ throw new MarmottaImportException("Suitable RDF parser not found");
+ }
+
+ // encoding detection
+ // FIXME: is this required?
+ try (BufferedInputStream bis = new BufferedInputStream(openStream(file))) {
+ CharsetDetector cd = new CharsetDetector();
+ cd.setText(bis);
+ CharsetMatch cm = cd.detect();
+ if (cm != null) {
+ format += "; charset=" + cm.getName();
+ }
+ bis.close();
+ } catch (IOException e) {
+ log.error("Error detecting charset for '{}': {}", fileName, e.getMessage());
+ }
+
+ return format;
+ }
+
+ private InputStream openStream(Path file) throws IOException {
+ final String fName = file.getFileName().toString();
+ final FileInputStream fis = new FileInputStream(file.toFile());
+ if (fName.endsWith(".gz")) {
+ return new GZIPInputStream(fis);
+ } else if (fName.endsWith(".bz2")) {
+ return new BZip2CompressorInputStream(fis);
+ } else {
+ return fis;
+ }
+ }
+
+ /**
+ * Get the target context.
+ * The algorithm is as follows:
+ * <ol>
+ * <li>check for a file "conf" (configurable, see {@link #CONFIG_KEY_CONF_FILE}) which specifies
+ * the target content using {@link Properties} syntax (key {@code context}), then use is; or
+ * <li>check if the sub-directory is a url-encoded URI, then use it; or
+ * <li>construct the context by using {@link ConfigurationService#getBaseContext()} and the relative sub-dirs and use it; or
+ * <li>use the default context as a general fallback.
+ * </ol>
+ *
+ * @param file the file
+ * @return the context URI
+ * @throws URISyntaxException
+ */
+ private URI getTargetContext(Path file) throws URISyntaxException {
+ // Check for a configFile
+ final Path config = file.getParent().resolve(configurationService.getStringConfiguration(CONFIG_KEY_CONF_FILE, "config"));
+ if (Files.isReadable(config)) {
+ try {
+ Properties prop = new Properties();
+ final FileInputStream inStream = new FileInputStream(config.toFile());
+ prop.load(inStream);
+ inStream.close();
+ final String _c = prop.getProperty("context");
+ if (_c != null) {
+ try {
+ URI context = contextService.createContext(_c);
+ log.debug("using context {} from config file {}", context, config);
+ return context;
+ } catch (URISyntaxException e) {
+ log.warn("invalid context {} in config file {}, ignoring", _c, config);
+ }
+ } else {
+ log.trace("no context defined in config file {}", config);
+ }
+ } catch (IOException e) {
+ log.warn("could not read dirConfigFile {}: {}", config, e.getMessage());
+ }
+ }
+
+ // Check for url-encoded directory
+ Path subDir = file.getParent().relativize(getImportRoot());
+ if (StringUtils.isBlank(subDir.toString())) {
+ log.trace("using default context for file {}", file);
+ return contextService.getDefaultContext();
+ } else if (StringUtils.startsWith(subDir.toString(), "http%3A%2F%2F")){
+ log.debug("using url-encoded context {} for import of {}", subDir, file);
+ try {
+ return contextService.createContext(URLDecoder.decode(subDir.toString(), "UTF-8"));
+ } catch (UnsupportedEncodingException e) {
+ log.error("Error url-decoding context name '{}', so using the default one: {}", subDir, e.getMessage());
+ return contextService.getDefaultContext();
+ }
+ } else {
+ final String _c = String.format("%s/%s", configurationService.getBaseContext().replaceFirst("/$", ""), subDir);
+ final URI context = contextService.createContext(_c);
+ log.debug("using context {} based on relative subdir {} for file {}", context, subDir, file);
return context;
- }
- }
-
- private class ImportWatcher extends SimpleTreeWatcher {
+ }
+ }
+
+ private class ImportWatcher extends SimpleTreeWatcher {
private String dirConfigFileName = null;
private boolean deleteAfterImport = false;
private int importDelay = 2500;
private String lockFile = null;
-
+
private final ScheduledThreadPoolExecutor executor;
private final Map<Path, ScheduledFuture<?>> fileSchedules;
-
+
private final Task task;
public ImportWatcher(Path target) {
super(target, true);
-
+
executor = new ScheduledThreadPoolExecutor(1);
executor.setMaximumPoolSize(1);
fileSchedules = new HashMap<>();
-
+
task = taskManagerService.createTask("Import Watch", TASK_GROUP);
task.updateMessage("off");
task.updateDetailMessage(TASK_DETAIL_PATH, target.toAbsolutePath().toString());
}
-
+
public void setLockFile(String lockFile) {
this.lockFile = lockFile;
}
@@ -327,7 +348,7 @@ public class ImportWatchServiceImpl implements ImportWatchService {
public void setDeleteAfterImport(boolean deleteAfterImport) {
this.deleteAfterImport = deleteAfterImport;
}
-
+
/**
* Wait for some time before actually starting the import.
* @param importDelay the delay in milliseconds.
@@ -342,7 +363,7 @@ public class ImportWatchServiceImpl implements ImportWatchService {
scheduleDirectoryRecursive(root);
super.run();
}
-
+
@Override
public void shutdown() throws IOException {
try {
@@ -353,7 +374,7 @@ public class ImportWatchServiceImpl implements ImportWatchService {
task.endTask();
}
}
-
+
@Override
public void onChildDeleted(final Path parent, Path child) {
// if the lockfile is deleted, import the full directory
@@ -368,7 +389,7 @@ public class ImportWatchServiceImpl implements ImportWatchService {
}
}
}
-
+
private void scheduleDirectory(Path dir) {
if (!isLocked(dir)) {
try {
@@ -385,7 +406,7 @@ public class ImportWatchServiceImpl implements ImportWatchService {
}
}
}
-
+
private boolean isLocked(Path dir) {
if (lockFile == null) {
return false;
@@ -397,7 +418,7 @@ public class ImportWatchServiceImpl implements ImportWatchService {
private void scheduleFile(final Path file) {
// if the dir is locked, do not schedule
if (isLocked(file.getParent())) return;
-
+
// do not schedule a config file
if (dirConfigFileName != null && file.endsWith(dirConfigFileName)) return;
@@ -426,7 +447,7 @@ public class ImportWatchServiceImpl implements ImportWatchService {
}
}
}, importDelay, TimeUnit.MILLISECONDS));
-
+
// cancel any previously scheduled import for this file.
if (prevSchedule != null) {
prevSchedule.cancel(true);
@@ -443,12 +464,12 @@ public class ImportWatchServiceImpl implements ImportWatchService {
public void onFileCreated(Path createdFile) {
scheduleFile(createdFile);
}
-
+
@Override
public void onFileModified(Path modifiedFile) {
scheduleFile(modifiedFile);
}
-
+
@Override
public void onDirectoryCreated(Path createdDir) {
scheduleDirectoryRecursive(createdDir);
@@ -468,7 +489,7 @@ public class ImportWatchServiceImpl implements ImportWatchService {
log.warn("Could not schedule directory {} for import: {}", directory, e.getMessage());
}
}
-
- }
+
+ }
}
[10/30] git commit: delete deprecated KnowledgeSpaceWebService (was
not really used anyways)
Posted by ja...@apache.org.
delete deprecated KnowledgeSpaceWebService (was not really used anyways)
Project: http://git-wip-us.apache.org/repos/asf/incubator-marmotta/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-marmotta/commit/8e31453e
Tree: http://git-wip-us.apache.org/repos/asf/incubator-marmotta/tree/8e31453e
Diff: http://git-wip-us.apache.org/repos/asf/incubator-marmotta/diff/8e31453e
Branch: refs/heads/MARMOTTA-345
Commit: 8e31453e8ecd079d4136d8c3870d3f2ad2ebf287
Parents: 01dea18
Author: Sebastian Schaffert <ss...@apache.org>
Authored: Mon Oct 21 12:24:14 2013 +0200
Committer: Sebastian Schaffert <ss...@apache.org>
Committed: Mon Oct 21 12:24:14 2013 +0200
----------------------------------------------------------------------
.../triplestore/KnowledgeSpaceWebService.java | 122 -------------------
.../src/main/resources/kiwi-module.properties | 1 -
2 files changed, 123 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/8e31453e/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/webservices/triplestore/KnowledgeSpaceWebService.java
----------------------------------------------------------------------
diff --git a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/webservices/triplestore/KnowledgeSpaceWebService.java b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/webservices/triplestore/KnowledgeSpaceWebService.java
deleted file mode 100644
index 99952b6..0000000
--- a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/webservices/triplestore/KnowledgeSpaceWebService.java
+++ /dev/null
@@ -1,122 +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.core.webservices.triplestore;
-
-import java.io.UnsupportedEncodingException;
-import java.net.URI;
-import java.net.URISyntaxException;
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.enterprise.context.ApplicationScoped;
-import javax.inject.Inject;
-import javax.ws.rs.DELETE;
-import javax.ws.rs.GET;
-import javax.ws.rs.HeaderParam;
-import javax.ws.rs.Path;
-import javax.ws.rs.PathParam;
-import javax.ws.rs.Produces;
-import javax.ws.rs.core.Response;
-import javax.ws.rs.core.Response.Status;
-
-import org.apache.marmotta.platform.core.api.config.ConfigurationService;
-import org.apache.marmotta.platform.core.api.triplestore.ContextService;
-import org.apache.marmotta.platform.core.util.JerseyUtils;
-
-/**
- * Knowledge space related services
- *
- * @author Sergio Fernández
- *
- */
-@ApplicationScoped
-@Path("/" + ConfigurationService.KNOWLEDGESPACE_PATH)
-@Deprecated
-public class KnowledgeSpaceWebService {
-
- @Inject
- private ConfigurationService configurationService;
-
- @Inject
- private ContextService contextService;
- private static final String UUID_PATTERN = "{uuid:[^#?]+}";
-
- /**
- * Get all knowledge spaces
- *
- * @return a list of URIs representing the current knowledge spaces
- */
- @GET
- @Produces("application/json")
- public Response listSpaces() {
- try {
- List<org.openrdf.model.URI> l = contextService.listContexts();
- ArrayList<String> res = new ArrayList<String>();
- for(org.openrdf.model.URI r : l) {
- String uri = r.stringValue();
- if (uri.startsWith(buildBaseUri())) {
- res.add(uri);
- }
- }
- return Response.ok().entity(res).build();
- } catch(Exception e) {
- return Response.serverError().entity(e.getMessage()).build();
- }
- }
-
- /**
- * Returns the content stored on this context URI
- *
- * @param types, accepted formats
- * @param uuid, a unique context identifier
- * @return redirects to the export service
- */
- @GET
- @Path(UUID_PATTERN)
- public Response getContent(@HeaderParam("Accept") String types, @PathParam("uuid") String uuid) throws UnsupportedEncodingException, URISyntaxException {
- String context = buildUri(uuid);
- URI uri = new URI(configurationService.getBaseUri() + "export/download?context=" + context);
- return Response.seeOther(uri).header("Accept", types).build();
- }
-
- /**
- * Deletes a knowledge space from the system
- *
- * @param types formats accepted
- * @param uuid knowledge space uuid
- * @return status code
- * @throws UnsupportedEncodingException
- * @throws URISyntaxException
- */
- @DELETE
- @Path(UUID_PATTERN)
- public Response cleanContent(String types, @PathParam("uuid") String uuid) throws UnsupportedEncodingException, URISyntaxException {
- final boolean deleted = contextService.removeContext(buildUri(uuid));
- return deleted ? Response.ok().build() : Response.status(Status.NOT_FOUND).build();
- }
-
- private String buildBaseUri() {
- String root = configurationService.getBaseUri();
- return root.substring(0, root.length() - 1) + JerseyUtils.getResourcePath(this) + "/";
- }
-
- private String buildUri(String uuid) {
- return buildBaseUri() + uuid;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/8e31453e/platform/marmotta-core/src/main/resources/kiwi-module.properties
----------------------------------------------------------------------
diff --git a/platform/marmotta-core/src/main/resources/kiwi-module.properties b/platform/marmotta-core/src/main/resources/kiwi-module.properties
index cace6ef..aeecd4d 100644
--- a/platform/marmotta-core/src/main/resources/kiwi-module.properties
+++ b/platform/marmotta-core/src/main/resources/kiwi-module.properties
@@ -70,6 +70,5 @@ webservices=org.apache.marmotta.platform.core.webservices.config.ConfigurationWe
org.apache.marmotta.platform.core.webservices.resource.InspectionWebService,\
org.apache.marmotta.platform.core.webservices.triplestore.LdpWebService,\
org.apache.marmotta.platform.core.webservices.triplestore.ContextWebService,\
- org.apache.marmotta.platform.core.webservices.triplestore.KnowledgeSpaceWebService,\
org.apache.marmotta.platform.core.webservices.prefix.PrefixWebService
\ No newline at end of file
[23/30] git commit: added script to check jrebel config
Posted by ja...@apache.org.
added script to check jrebel config
Project: http://git-wip-us.apache.org/repos/asf/incubator-marmotta/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-marmotta/commit/dd234c13
Tree: http://git-wip-us.apache.org/repos/asf/incubator-marmotta/tree/dd234c13
Diff: http://git-wip-us.apache.org/repos/asf/incubator-marmotta/diff/dd234c13
Branch: refs/heads/MARMOTTA-345
Commit: dd234c1389281abcae0b67124e6ce01ae5876642
Parents: 56fb581
Author: Jakob Frank <ja...@apache.org>
Authored: Wed Oct 23 16:01:11 2013 +0200
Committer: Jakob Frank <ja...@apache.org>
Committed: Wed Oct 23 16:01:11 2013 +0200
----------------------------------------------------------------------
build/check-rebel.root.sh | 11 +++++++++++
1 file changed, 11 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/dd234c13/build/check-rebel.root.sh
----------------------------------------------------------------------
diff --git a/build/check-rebel.root.sh b/build/check-rebel.root.sh
new file mode 100755
index 0000000..9d430e4
--- /dev/null
+++ b/build/check-rebel.root.sh
@@ -0,0 +1,11 @@
+#!/bin/bash
+
+ME="$(readlink -f "$0")"
+ROOT="$(readlink -f "$(dirname "$ME")/..")"
+
+find "$ROOT" -name pom.xml -not -path '*/target/*' | while read pom; do
+ rel="$(xpath -q -e '//plugin/configuration/relativePath/text()' "$pom")"
+ [ -z "$rel" ] && continue;
+ abs="$(readlink -f "$(dirname "$pom")/$rel")"
+ [ "$ROOT" = "$abs" ] || echo "Invalid relativePath for jrebel in $pom: $rel resolves to $abs (should be $ROOT)"
+done
[21/30] git commit: Removed leftovers from unused module marmotta-ssl
Posted by ja...@apache.org.
Removed leftovers from unused module marmotta-ssl
Project: http://git-wip-us.apache.org/repos/asf/incubator-marmotta/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-marmotta/commit/fd8673b6
Tree: http://git-wip-us.apache.org/repos/asf/incubator-marmotta/tree/fd8673b6
Diff: http://git-wip-us.apache.org/repos/asf/incubator-marmotta/diff/fd8673b6
Branch: refs/heads/MARMOTTA-345
Commit: fd8673b633c4c5489f8b451a37278ae4a57ea579
Parents: 98ca7ae
Author: Jakob Frank <ja...@apache.org>
Authored: Wed Oct 23 15:14:06 2013 +0200
Committer: Jakob Frank <ja...@apache.org>
Committed: Wed Oct 23 15:14:06 2013 +0200
----------------------------------------------------------------------
.../src/main/resources/META-INF/beans.xml | 28 ----------------
.../src/main/resources/kiwi-module.properties | 34 --------------------
2 files changed, 62 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/fd8673b6/platform/marmotta-ssl/src/main/resources/META-INF/beans.xml
----------------------------------------------------------------------
diff --git a/platform/marmotta-ssl/src/main/resources/META-INF/beans.xml b/platform/marmotta-ssl/src/main/resources/META-INF/beans.xml
deleted file mode 100644
index 461858e..0000000
--- a/platform/marmotta-ssl/src/main/resources/META-INF/beans.xml
+++ /dev/null
@@ -1,28 +0,0 @@
-<?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/fd8673b6/platform/marmotta-ssl/src/main/resources/kiwi-module.properties
----------------------------------------------------------------------
diff --git a/platform/marmotta-ssl/src/main/resources/kiwi-module.properties b/platform/marmotta-ssl/src/main/resources/kiwi-module.properties
deleted file mode 100644
index fd990f3..0000000
--- a/platform/marmotta-ssl/src/main/resources/kiwi-module.properties
+++ /dev/null
@@ -1,34 +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.
-#
-
-name=SSL
-
-subtitle = Secure Sockets Layer
-
-baseurl=/ssl
-
-webservices=
-
-icon_small = /admin/img/clock_small.png
-icon_big = /admin/img/clock_big.png
-
-
-entities=
-
-adminpages=\
-# /admin/about.html,/admin/configuration.html
\ No newline at end of file
[08/30] git commit: implement a dummy triple store provider so the
tests for marmotta platform are working again
Posted by ja...@apache.org.
implement a dummy triple store provider so the tests for marmotta platform are working again
Project: http://git-wip-us.apache.org/repos/asf/incubator-marmotta/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-marmotta/commit/45078ac3
Tree: http://git-wip-us.apache.org/repos/asf/incubator-marmotta/tree/45078ac3
Diff: http://git-wip-us.apache.org/repos/asf/incubator-marmotta/diff/45078ac3
Branch: refs/heads/MARMOTTA-345
Commit: 45078ac32ce58729d710b18d58ee3d1d8e93ab69
Parents: 8ac0891
Author: Sebastian Schaffert <ss...@apache.org>
Authored: Mon Oct 21 12:17:33 2013 +0200
Committer: Sebastian Schaffert <ss...@apache.org>
Committed: Mon Oct 21 12:17:33 2013 +0200
----------------------------------------------------------------------
.../core/test/base/TestStoreProvider.java | 82 +++++++++++++++++++-
.../src/test/resources/META-INF/beans.xml | 4 +
2 files changed, 85 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/45078ac3/platform/marmotta-core/src/test/java/org/apache/marmotta/platform/core/test/base/TestStoreProvider.java
----------------------------------------------------------------------
diff --git a/platform/marmotta-core/src/test/java/org/apache/marmotta/platform/core/test/base/TestStoreProvider.java b/platform/marmotta-core/src/test/java/org/apache/marmotta/platform/core/test/base/TestStoreProvider.java
index 984a3cb..24eb658 100644
--- a/platform/marmotta-core/src/test/java/org/apache/marmotta/platform/core/test/base/TestStoreProvider.java
+++ b/platform/marmotta-core/src/test/java/org/apache/marmotta/platform/core/test/base/TestStoreProvider.java
@@ -1,9 +1,89 @@
+/*
+ * 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.test.base;
+import org.apache.marmotta.platform.core.api.triplestore.StoreProvider;
+import org.openrdf.repository.sail.SailRepository;
+import org.openrdf.sail.NotifyingSail;
+import org.openrdf.sail.Sail;
+import org.openrdf.sail.memory.MemoryStore;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import javax.annotation.PostConstruct;
+import javax.enterprise.context.ApplicationScoped;
+import javax.enterprise.inject.Alternative;
+
/**
* A triple store provider for tests. Uses a Sesame in-memory store for holding triples.
*
* @author Sebastian Schaffert (sschaffert@apache.org)
*/
-public class TestStoreProvider {
+@Alternative
+@ApplicationScoped
+public class TestStoreProvider implements StoreProvider {
+
+ private static Logger log = LoggerFactory.getLogger(TestStoreProvider.class);
+
+ @PostConstruct
+ public void initialise() {
+ log.warn("using in-memory triple store - no persistence");
+ }
+
+ /**
+ * 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);
+ }
+
+ /**
+ * Create the store provided by this SailProvider
+ *
+ * @return a new instance of the store
+ */
+ @Override
+ public NotifyingSail createStore() {
+ return new MemoryStore();
+ }
+
+ /**
+ * Return the name of the provider. Used e.g. for displaying status information or logging.
+ *
+ * @return
+ */
+ @Override
+ public String getName() {
+ return "Dummy 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/45078ac3/platform/marmotta-core/src/test/resources/META-INF/beans.xml
----------------------------------------------------------------------
diff --git a/platform/marmotta-core/src/test/resources/META-INF/beans.xml b/platform/marmotta-core/src/test/resources/META-INF/beans.xml
index 6504987..06df4fa 100644
--- a/platform/marmotta-core/src/test/resources/META-INF/beans.xml
+++ b/platform/marmotta-core/src/test/resources/META-INF/beans.xml
@@ -23,4 +23,8 @@
http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/beans_1_0.xsd">
+ <alternatives>
+ <class>org.apache.marmotta.platform.core.test.base.TestStoreProvider</class>
+ </alternatives>
+
</beans>
[28/30] git commit: Merge remote-tracking branch 'origin/develop'
into MARMOTTA-345
Posted by ja...@apache.org.
Merge remote-tracking branch 'origin/develop' into MARMOTTA-345
Project: http://git-wip-us.apache.org/repos/asf/incubator-marmotta/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-marmotta/commit/13366070
Tree: http://git-wip-us.apache.org/repos/asf/incubator-marmotta/tree/13366070
Diff: http://git-wip-us.apache.org/repos/asf/incubator-marmotta/diff/13366070
Branch: refs/heads/MARMOTTA-345
Commit: 133660709efe0b01445c8f9e90a19ef1d131c8a0
Parents: ff85aef 362ecbe
Author: Jakob Frank <ja...@apache.org>
Authored: Thu Oct 24 14:03:24 2013 +0200
Committer: Jakob Frank <ja...@apache.org>
Committed: Thu Oct 24 14:03:24 2013 +0200
----------------------------------------------------------------------
build/check-rebel.root.sh | 11 +
client/marmotta-client-java/pom.xml | 5 +
commons/marmotta-commons/pom.xml | 1 -
.../commons/sesame/model/StatementCommons.java | 1 +
.../sesame/repository/ResourceUtils.java | 120 ++++++-
.../commons/sesame/rio/vcard/Denis_Hennessy.vcf | 0
.../commons/sesame/rio/vcard/Tony_Small.vcf | 0
.../webjars/snorql/src/main/resources/LICENSE | 0
extras/webjars/snorql/src/main/resources/README | 0
.../webjars/snorql/src/main/resources/link.png | Bin
.../snorql/src/main/resources/namespaces.js | 0
.../snorql/src/main/resources/prototype.js | 0
.../snorql/src/main/resources/rdf_flyer.24.gif | Bin
.../src/main/resources/scriptaculous/builder.js | 0
.../main/resources/scriptaculous/controls.js | 0
.../main/resources/scriptaculous/dragdrop.js | 0
.../src/main/resources/scriptaculous/effects.js | 0
.../resources/scriptaculous/scriptaculous.js | 0
.../src/main/resources/scriptaculous/slider.js | 0
.../src/main/resources/scriptaculous/sound.js | 0
.../main/resources/scriptaculous/unittest.js | 0
.../webjars/snorql/src/main/resources/snorql.js | 0
.../webjars/snorql/src/main/resources/sparql.js | 0
.../webjars/snorql/src/main/resources/style.css | 0
.../snorql/src/main/resources/xml-to-html.xsl | 0
.../apache/marmotta/splash/systray/systray.png | Bin
launchers/marmotta-webapp/pom.xml | 2 +-
.../kiwi/sparql/test/ContextAwareTest.java | 40 +++
.../kiwi/persistence/KiWiPersistence.java | 4 +-
.../backends/marmotta-backend-bigdata/pom.xml | 192 ++++++++++
.../bigdata/BigDataSesame27Repository.java | 151 ++++++++
.../backend/bigdata/BigDataSesame27Sail.java | 293 +++++++++++++++
.../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 | 327 +++++++++++++++++
.../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 ---
platform/marmotta-core/pom.xml | 38 +-
.../platform/core/api/user/UserToken.java | 84 -----
.../platform/core/rio/RDFHtmlWriterImpl.java | 6 +-
.../config/ConfigurationServiceImpl.java | 1 +
.../content/FileSystemContentReader.java | 33 +-
.../content/FileSystemContentWriter.java | 18 +-
.../services/content/HTTPContentReader.java | 36 +-
.../core/services/sesame/KiWiSesameUtil.java | 63 ----
.../sesame/ResourceSubjectMetadata.java | 6 +-
.../platform/core/util/JerseyUtils.java | 45 ---
.../marmotta/platform/core/util/KiWiIO.java | 35 +-
.../platform/core/util/WebServiceUtil.java | 16 +
.../resource/InspectionWebService.java | 44 +--
.../webservices/resource/MetaWebService.java | 3 +-
.../resource/ResourceWebService.java | 3 +-
.../triplestore/ContextWebService.java | 42 +--
.../triplestore/KnowledgeSpaceWebService.java | 122 -------
.../webservices/triplestore/LdpWebService.java | 33 +-
.../src/main/resources/kiwi-module.properties | 1 -
.../main/resources/web/public/img/icon/link.png | Bin
.../core/test/base/TestStoreProvider.java | 85 +++++
.../src/test/resources/META-INF/beans.xml | 4 +
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 --
.../ldpath/model/functions/ContentFunction.java | 12 +-
.../ldpath/webservices/LDPathWebService.java | 23 +-
.../resources/web/admin/img/ld_path_small.png | Bin
.../resources/web/admin/img/reasoner_small.png | Bin
platform/marmotta-sparql/pom.xml | 7 +-
.../resources/web/admin/img/sparql_small.png | Bin
.../src/main/resources/web/admin/link.png | Bin
.../src/main/resources/web/admin/snorql.html | 0
.../src/main/resources/META-INF/beans.xml | 28 --
.../src/main/resources/kiwi-module.properties | 34 --
.../resources/web/admin/img/clock_small.png | Bin
platform/pom.xml | 10 +-
163 files changed, 5929 insertions(+), 5670 deletions(-)
----------------------------------------------------------------------
[19/30] git commit: reorganize platform modules to give more overview
over different backends
Posted by ja...@apache.org.
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/MARMOTTA-345
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>
+
[09/30] git commit: dependency bug fix
Posted by ja...@apache.org.
dependency bug fix
Project: http://git-wip-us.apache.org/repos/asf/incubator-marmotta/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-marmotta/commit/01dea18f
Tree: http://git-wip-us.apache.org/repos/asf/incubator-marmotta/tree/01dea18f
Diff: http://git-wip-us.apache.org/repos/asf/incubator-marmotta/diff/01dea18f
Branch: refs/heads/MARMOTTA-345
Commit: 01dea18f0c952bec70a49720736973a2c962cd2d
Parents: 45078ac
Author: Sebastian Schaffert <ss...@apache.org>
Authored: Mon Oct 21 12:19:35 2013 +0200
Committer: Sebastian Schaffert <ss...@apache.org>
Committed: Mon Oct 21 12:19:35 2013 +0200
----------------------------------------------------------------------
platform/marmotta-sparql/pom.xml | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/01dea18f/platform/marmotta-sparql/pom.xml
----------------------------------------------------------------------
diff --git a/platform/marmotta-sparql/pom.xml b/platform/marmotta-sparql/pom.xml
index 37189dd..aa0c931 100644
--- a/platform/marmotta-sparql/pom.xml
+++ b/platform/marmotta-sparql/pom.xml
@@ -300,7 +300,12 @@
<groupId>com.googlecode.jatl</groupId>
<artifactId>jatl</artifactId>
<scope>test</scope>
- </dependency>
+ </dependency>
+ <dependency>
+ <groupId>org.openrdf.sesame</groupId>
+ <artifactId>sesame-sail-memory</artifactId>
+ <scope>test</scope>
+ </dependency>
</dependencies>
[14/30] reorganize platform modules to give more overview over
different backends
Posted by ja...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/47855a4b/platform/marmotta-ldcache-common/src/main/resources/web/admin/about.html
----------------------------------------------------------------------
diff --git a/platform/marmotta-ldcache-common/src/main/resources/web/admin/about.html b/platform/marmotta-ldcache-common/src/main/resources/web/admin/about.html
deleted file mode 100644
index 39f4955..0000000
--- a/platform/marmotta-ldcache-common/src/main/resources/web/admin/about.html
+++ /dev/null
@@ -1,271 +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.
-
--->
-<html>
-<head>
-<!--###BEGIN_HEAD###-->
- <title>Linked Data Caching</title>
- <script type="text/javascript" src="../../webjars/jquery/1.8.2/jquery.min.js"></script>
- <script type="text/javascript">
- jQuery(document).ready(function(){
- jQuery.getJSON(_SERVER_URL + "/cache/info", function(data) {
- $("#title").html(data.backend);
- });
- });
- </script>
-
- <!--###END_HEAD###-->
-</head>
-<body>
- <!--###BEGIN_CONTENT###-->
- <h1>
- <a id="Introduction"></a><span id="title">Introduction</span><a class="section_anchor"
- href="#Introduction"></a>
- </h1>
- <p>
- Apache Marmotta can optionally be extended with a Linked
- Data Caching Module that transparently retrieves resources from the
- Linked Data Cloud when they are needed (e.g. when querying a relation
- to a remote resource) and caches them transparently. Linked Data
- Caching is integrated at the triple store level and thus available to
- all services accessing the triple store, including the SPARQL endpoint.
- </p>
- <h1>
- <a id="Functionality"></a>Functionality<a class="section_anchor"
- href="#Functionality"></a>
- </h1>
- <h2>
- <a id="Transparent_Linked_Data_Access"></a>Transparent Linked Data
- Access<a class="section_anchor" href="#Transparent_Linked_Data_Access"></a>
- </h2>
- <p>The Linked Data Caching module is a powerful component for
- integrating with other Linked Data servers, either on the public
- Linked Data Cloud or from local severs deployed in an intranet. It
- provides transparent access to resources on Linked Data-aware servers.
- When enabled, it is triggered when the triples of a non-local resource
- are requested from the triple store. A typical case where this can
- happen is when a local resource links to a resource in the Linked Data
- Cloud using a triple and a query to the system requests information
- about this external resource.</p>
- <p>For example, the FOAF description of a user in the Marmotta might
- contain a reference to the FOAF file of a user at some external
- location:</p>
- <pre class="prettyprint">
- <span class="kwd">local</span><span class="pun">:</span><span
- class="pln">peter foaf</span><span class="pun">:</span><span
- class="pln">knows </span><span class="pun"><</span><span
- class="pln">http</span><span class="pun">:</span><span class="com">//example.com/john.rdf></span>
- </pre>
- <p>A query could then ask for all the names of persons that peter
- knows, e.g. in SPARQL:</p>
- <pre class="prettyprint">
- <span class="pln">SELECT </span><span class="pun">?</span><span
- class="pln">name WHERE </span><span class="pun">{</span><span
- class="pln"> </span><span class="kwd">local</span><span class="pun">:</span><span
- class="pln">peter foaf</span><span class="pun">:</span><span
- class="pln">knows </span><span class="pun">?</span><span class="pln">p </span><span
- class="pun">.</span><span class="pln"> </span><span class="pun">?</span><span
- class="pln">p foaf</span><span class="pun">:</span><span class="pln">name </span><span
- class="pun">?</span><span class="pln">name </span><span class="pun">}</span>
- </pre>
- <p>
- When evaluating the query, the Linked Data Caching module would then
- transparently retrieve the resource <em>http://example.com/john.rdf</em>
- and try to answer the query using the triples contained therein.
- </p>
- <h2>
- <a id="Local_Caching"></a>Local Caching<a class="section_anchor"
- href="#Local_Caching"></a>
- </h2>
- <p>When the triple data of a remote resource are retrieved, they
- are cached locally in the Linked Media Framework's triple store in a
- special named graph called "cache", together with provenance and cache
- expiry information. The cache graph is special in the sense that
- resources in this graph are by default not considered for direct
- indexing in the semantic search (i.e. a foaf:Person retrieved from the
- Linked Data Cloud will not be returned by the Semantic Search
- component), and triples and resources in this graph are not included
- in versioning.</p>
- <p>A query to a resource is answered from the local cache as long
- as the entry is not expired, i.e. subsequent queries to a resource
- will be significantly faster than the first query as long as they are
- carried out within a certain time frame. The expiry date of a resource
- in the cache is determined in two ways:</p>
- <ul>
- <li>if the Linked Data server providing the original resource
- sends an "Expires" header, the value of the header defines the expiry
- date of the local cache entry</li>
- <li>otherwise, if there is an endpoint configuration for the URI
- prefix of the resource, the expiry time of the endpoint is used</li>
- <li>otherwise, the default expiry time configured in the
- configuration variable ldcache.expiry is used</li>
- </ul>
- <p></p>
- <h2>
- <a id="Modes_of_Operation"></a>Modes of Operation<a
- class="section_anchor" href="#Modes_of_Operation"></a>
- </h2>
- <p>Since the Linked Data Cloud is distributed over the Web and some
- services might not provide the reliability or availability necessary,
- or some servers are not yet Linked Data aware, the Linked Data Caching
- Module offers different modes of operation for accessing resources:</p>
- <ul>
- <li><strong>Linked Data</strong> (direct Linked Data access):
- makes use of the HTTP content negotiation to directly retrieve a
- Linked Data resource from the Web as defined in the Linked Data
- Principles. This is the default behaviour if nothing else has been
- configured</li>
- <li><strong>Cache</strong> (access to a resource or entity cache
- endpoint): retrieves the triples of a resource from a defined server
- by accessing a cache endpoint. This is e.g. useful if there is a
- local cache of a public server (e.g. to improve reliability or
- performance) or if there is a "traditional" RDF server that does not
- offer Linked Data access</li>
- <li><strong>SPARQL</strong> (access to a resource via a SPARQL
- endpoint): retrieves the triples of a resource from a defined SPARQL
- endpoint by issuing a query for all triples with the resource as
- subject. This is e.g. useful for traditional RDF servers that are
- extended by a SPARQL endpoint using e.g. Joseki or other tools.</li>
- <li><strong>NONE</strong> (block access to the resource): does
- not try to retrieve the external resource. Useful for blocking access
- for known "bad" Linked Data servers. For example, many Linked Data
- sources contain references to Wikipedia, which does not offer its
- data as Linked Data directly.</li>
- </ul>
- <p></p>
- <p>The different modes of operation can be configured as described
- below. In addition to the RDF/XML format, the Linked Data Caching
- Module also supports additional RDF serialisation formats that can be
- configured for certain Linked Data servers.</p>
- <h1>
- <a id="Configuration"></a>Configuration<a class="section_anchor"
- href="#Configuration"></a>
- </h1>
- <p>The Linked Data Caching Module can be configured using Marmotta
- configuration mechanism. The following section describes the
- configuration options used.</p>
- <h2>
- <a id="Configuration_Options"></a>Configuration Options<a
- class="section_anchor" href="#Configuration_Options"></a>
- </h2>
- <p>The following options affect the general behaviour of the Linked
- Data Caching Module:</p>
- <ul>
- <li>ldcache.enabled (true/false): if set to true, transparent
- Linked Data Caching is enabled; if set to false, remote resources
- will never be retrieved</li>
- <li>ldcache.fallback (true/false): try to retrieve a resource
- using ordinary Linked Data call if no endpoint is specified; when set
- to false, this option will not retrieve any remote resources except
- those defined with endpoints; can be used to provide transparent
- caching only to some specific Linked Data servers</li>
- <li>ldcache.expiry (seconds): defines the default expiry time for
- a resource in the cache if the server does not provide an "Expires"
- header and the endpoint definition does not have an expiry time
- (default: 1 day)</li>
- <li>ldcache.fetchall (true/false): if set to true, even a query
- for all resources will include the resources that are cached locally;
- the default is set to false because this might lead to unexpected
- behaviour and crawling of the whole Linked Data Cloud if not used
- with care</li>
- </ul>
- <h2>
- <a id="Endpoint_Configuration"></a>Endpoint Configuration<a
- class="section_anchor" href="#Endpoint_Configuration"></a>
- </h2>
- <p>The Linked Data Caching Module allows to define URI prefix to
- endpoint mappings. These can be used to either redirect Linked Data
- queries to cache or SPARQL endpoints for improving performance or
- accessing non-Linked Data resources, or for setting different
- parameters for certain server. An endpoint definition consists of the
- following parameters:</p>
- <ul>
- <li><strong>name</strong> (string): the public name of the
- endpoint, used for displaying</li>
- <li><strong>prefix</strong> (uri): the prefix of URIs that are
- redirected to the endpoint; if a resource requested from the cache
- has this prefix, it is handled by this endpoint</li>
- <li><strong>kind</strong> (SPARQL/LINKEDDATA/CACHE/NONE): the
- operation mode of the endpoint (see above)</li>
- <li><strong>endpoint</strong> (uri with parameters): the URI
- under which the endpoint can be accessed. Depending on the mode,
- certain parameters will be replaced by actual values in the URI:
- <ul>
- <li>CACHE: the parameter {uri} will be replaced by the actual
- URI of the requested resource, e.g. <span class="tt">http://api.sindice.com/v2/cache?url={uri}</span>
- </li>
- <li>SPARQL: the parameter {query} will be replaced by the SPARQL
- query, the parameter {contenttype} will be replaced by the MIME type
- to be requested from the server, e.g. <span class="tt">http://sparql.sindice.com/sparql?default-graph-uri=&query={query}&format={contenttype}</span>
- </li>
- </ul>
- </li>
- <li><strong>mimetype</strong> the MIME type to request/expect
- from the endpoint; depends on the mode of operation:
- <ul>
- <li>CACHE/LINKEDDATA: any RDF serialization supported by the
- Marmotta, e.g. application/rdf+xml, text/rdf+n3, ...</li>
- <li>SPARQL: any SPARQL result format, e.g.
- application/sparql-results+xml</li>
- </ul>
- </li>
- <li><strong>expiry</strong> (seconds): the default expiry time
- for this endpoint if not provided by the server itself</li>
- </ul>
- <h2>
- <a id="Webservice"></a>Webservice<a class="section_anchor"
- href="#Webservice"></a>
- </h2>
- <p>
- Endpoints are configured using the Linked Data Caching Webservice
- available under
- <span class="tt"><APPDIR>/cache/endpoint</span>
- ; the Webservice provides the following operations for managing
- endpoints:
- </p>
- <ul>
- <li><span class="tt">POST
- <APPDIR>/cache/endpoint?name=...&prefix=...&endpoint=...&kind=...&mimetype=...&expiry=...</span>
- will create a new endpoint with the given parameters</li>
- <li><span class="tt">GET <APPDIR>/cache/endpoint/list</span> will return a
- list of configured endpoints in JSON</li>
- <li><span class="tt">GET <APPDIR>/cache/endpoint/{id}</span> will return
- the endpoint configuration for the endpoint with the given internal
- ID</li>
- <li><span class="tt">DELETE <APPDIR>/cache/endpoint/{id}</span> will
- delete the endpoint configuration for the endpoint with the given
- internal ID</li>
- </ul>
- <p></p>
- <p>In addition to managing endpoints, the webservice also offers
- two methods for retrieving resources:</p>
- <ul>
- <li><span class="tt">GET <APPDIR>/cache/live?uri=...</span> directly
- retrieves a resource from the endpoints or Linked Data Cloud without
- caching it locally; used for testing endpoints</li>
- <li><span class="tt">GET <APPDIR>/cache/cached?uri=...</span> refreshes
- the resource with the given URI and returns nothing; the resource can
- then be retrieved using the normal resource access webservices</li>
- </ul>
- <p></p>
- <p>For your convenience, the Marmotta administration interface offers a
- simple UI for adding, listing and removing endpoint definitions.</p>
- <!--###END_CONTENT###-->
-</body>
-</html>
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/47855a4b/platform/marmotta-ldcache-common/src/main/resources/web/admin/configuration.html
----------------------------------------------------------------------
diff --git a/platform/marmotta-ldcache-common/src/main/resources/web/admin/configuration.html b/platform/marmotta-ldcache-common/src/main/resources/web/admin/configuration.html
deleted file mode 100644
index 9a53ed3..0000000
--- a/platform/marmotta-ldcache-common/src/main/resources/web/admin/configuration.html
+++ /dev/null
@@ -1,83 +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.
-
--->
-<html>
-<head>
-<!--###BEGIN_HEAD###-->
- <title>Core Module Configuration</title>
- <script type="text/javascript" src="../../webjars/jquery/1.8.2/jquery.min.js"></script>
- <script type="text/javascript" src="../../core/public/js/widgets/property_config.js"></script>
- <script type="text/javascript" src="widgets/lmf_ldcache.js"></script>
- <script type="text/javascript" src="../../core/public/js/widgets/configurator/configurator.js"></script>
- <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 : "lmf_configurator",
- blacklist:['ldcache.endpoint.','ldcache.sample.'],
- prefix : 'ldcache'
- }
- var configurator = new Configurator(options);
- $('#lmf_ldcache').lmf_ldcache({host:_SERVER_URL});
- });
- </script>
- <style type="text/css">
-
- .endpoint_status.on {
- background-color: darkGreen;
- }
- .endpoint_status {
- background-color: red;
- border-radius: 10px 10px 10px 10px;
- display: inline-block;
- float: right;
- height: 20px;
- width: 20px;
- }
-
- </style>
-<!--###END_HEAD###-->
-</head>
-<body>
-<div id="main">
-<div id="contents">
-<!--###BEGIN_CONTENT###-->
-<h1>Linked Data Cache Configuration</h1>
- <p>
- Here you can configure the Marmotta Linked Data Cache mechanism.
- </p>
- <p>
- The configuration contains:
- </p>
- <ul>
- <li><a href="#lmf_configurator">Generic Parameter Configuration</a></li>
- <li><a href="#lmf_ldcache">LD-Cache Configuration</a></li>
- </ul>
- <div id="lmf_configurator">
- <h4>Loading configurator</h4>
- </div>
- <div id="lmf_ldcache">
- <h4>Loading cache config</h4>
- </div>
-<!--###END_CONTENT###-->
-</div>
-</div>
-</body>
-</html>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/47855a4b/platform/marmotta-ldcache-common/src/main/resources/web/admin/img/ld-caching.png
----------------------------------------------------------------------
diff --git a/platform/marmotta-ldcache-common/src/main/resources/web/admin/img/ld-caching.png b/platform/marmotta-ldcache-common/src/main/resources/web/admin/img/ld-caching.png
deleted file mode 100755
index b358706..0000000
Binary files a/platform/marmotta-ldcache-common/src/main/resources/web/admin/img/ld-caching.png and /dev/null differ
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/47855a4b/platform/marmotta-ldcache-common/src/main/resources/web/admin/widgets/lmf_ldcache.js
----------------------------------------------------------------------
diff --git a/platform/marmotta-ldcache-common/src/main/resources/web/admin/widgets/lmf_ldcache.js b/platform/marmotta-ldcache-common/src/main/resources/web/admin/widgets/lmf_ldcache.js
deleted file mode 100644
index ee32b22..0000000
--- a/platform/marmotta-ldcache-common/src/main/resources/web/admin/widgets/lmf_ldcache.js
+++ /dev/null
@@ -1,360 +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.
- */
-/**
- * Created by . User: Thomas Kurz Date: 18.02.11 Time: 18:46 To change this
- * template use File | Settings | File Templates.
- */
-(function($) {
-
- var contentBox;
-
- var programs;
- var buttonset;
-
- var loadS;
-
- // new program
- var name;
- var kind;
- var prefix;
- var endpoint;
- var mime;
- var expiry;
-
- var samples;
- var samp;
-
- var loader;
-
- $.fn.lmf_ldcache = function(options) {
- var settings = {
- host : 'http://localhost:8080/LMF/'
- }
-
- function addProgram() {
-
- if (name.val() == '') {
- alert("name may not be empty!");
- return;
- }
- if (prefix.val() == '') {
- alert("prefix may not be empty!");
- return;
- }
- /*if (endpoint.val() == '') {
- alert("endpoint may not be empty!");
- return;
- }
- if (mime.val() == '') {
- alert("mimetype may not be empty!");
- return;
- }*/
- if (expiry.val() == '') {
- alert("expiry may not be empty!");
- return;
- }
- var url = settings.host + "cache/endpoint?name=" + encodeURIComponent(name.val()) + '&prefix='
- + encodeURIComponent(prefix.val()) + '&endpoint=' + encodeURIComponent(endpoint.val()) + '&mimetype='
- + encodeURIComponent(mime.val()) + '&kind=' + encodeURIComponent(kind.val()) + '&expiry='
- + encodeURIComponent(expiry.val());
- loader.html("<span>Save Values</span>");
- // upload
- $.ajax({
- type : "POST",
- url : url,
- contentType : "text/plain",
- success : function() {
- loader.html("");
- $.getJSON(settings.host + "cache/endpoint/list", function(data) {
- writePrograms(data);
- });
- alert("success");
- },
- error : function(jXHR) {
- loader.html("");
- alert("Error: " + jXHR.responseText);
- }
- });
- }
-
- function removeProgram(b) {
- var url = settings.host + "cache/endpoint/" + b.attr('data-id');
- $.ajax({
- type : "DELETE",
- url : url,
- success : function() {
- $.getJSON(settings.host + "cache/endpoint/list", function(data) {
- writePrograms(data);
- });
- alert("success");
- },
- error : function(jXHR, textStatus) {
- alert("Error: " + jXHR.responseText);
- }
- });
- }
- function activateProgram(b, active) {
- var enable = active || (b.attr('data-active') !== "true"),
- url = settings.host + "cache/endpoint/" + b.attr('data-id') + "/enable?enable=" + enable;
-
- $.ajax({
- type : "POST",
- url : url,
- success : function() {
- $.getJSON(settings.host + "cache/endpoint/list", function(data) {
- writePrograms(data);
- });
- },
- error : function(jXHR, textStatus) {
- alert("Error: " + jXHR.responseText);
- }
- });
- }
-
- function writeSample(data) {
- // contains method
- var contains = function(array, obj) {
- var i = array.length;
- while (i--) {
- if (array[i] == obj) {
- return true;
- }
- }
- return false;
- }
- var sorted = [];
- for (property in data) {
- property = property.substring(15);
- property = property.substring(0, property.indexOf('.'));
- if (!contains(sorted, property)) {
- sorted.push(property);
- }
- }
- sorted.sort();
- samples = data;
- samp = $('<select/>').change(function() {
- loadSample(this);
- });
- var d = $("<div></div>");
- loadS.append(d);
- d.append('<br>Load Sample: ');
- d.append(samp);
- samp.append('<option>---select---</option>');
- for (property in sorted) {
- samp.append('<option>' + sorted[property] + '</option>');
- }
- }
-
- function loadSample() {
- if (samp.val() != '---select---') {
- var x = samp.val();
- name.val(samples['ldcache.sample.' + x + '.name'].value);
- kind.val(samples['ldcache.sample.' + x + '.kind'].value);
- prefix.val(samples['ldcache.sample.' + x + '.prefix'].value);
- endpoint.val(samples['ldcache.sample.' + x + '.endpoint'].value);
- mime.val(samples['ldcache.sample.' + x + '.mimetype'].value);
- expiry.val(samples['ldcache.sample.' + x + '.expiry'].value);
- } else {
- var x = samp.val();
- name.val('');
- kind.val('');
- prefix.val('');
- endpoint.val('');
- mime.val('');
- expiry.val('');
- }
- }
-
- function writePrograms(ps) {
- if (ps.length == 0) {
- programs.text("no endpoints defined");
- return;
- }
- var table = $("<table class='simple_table'/>");
- var tr = $("<tr class='title' valign='top' style='font-weight:bold;color: white;background-color:gray;'/>");
- tr.append($("<td/>").html(" "));
- tr.append($("<td/>").text("Name"));
- tr.append($("<td/>").text("Kind"));
- tr.append($("<td/>").text("Prefix"));
- tr.append($("<td/>").text("Endpoint"));
- tr.append($("<td/>").text("Mimetype"));
- tr.append($("<td/>").text("Expiry"));
- tr.append($("<td/>").text("Actions"));
- table.append(tr);
-
- function buildIcon(enabled) {
- var icon = $("<span>", {'class': "endpoint_status"});
- if (enabled) icon.addClass("on");
- return icon;
- }
-
- function ctToString(obj) {
- var ret = "";
- for(var i = 0; i < obj.length; i++) {
- ret += obj[i].mime;
- if(i != obj.length-1) ret += ",";
- }
- return ret;
- }
-
- for ( var i = 0; i < ps.length; i++) {
- if(!ps[i].volatile) {
- var delBtn = $("<button/>").text("delete");
- delBtn.attr('data-id', ps[i].id);
- delBtn.click(function() {
- removeProgram($(this));
- });
- var modBtn = $("<button>", {text: (ps[i].active?"deactivate":"activate"), 'data-id': ps[i].id, 'data-active':ps[i].active})
- modBtn.click(function() {
- activateProgram($(this));
- });
- }
- var col = "";
- if (i % 2) {
- col = "even";
- } else {
- col = "odd";
- }
- var tr = $("<tr class='" + col + "'/>");
- $("<td/>").append(buildIcon(ps[i].active)).appendTo(tr);
- $("<td/>").text(ps[i].name || '').appendTo(tr);
- $("<td/>").text(ps[i].kind || '').appendTo(tr);
- $("<td/>").text(ps[i].prefix || '').appendTo(tr);
- $("<td/>").text(ps[i].endpoint || '').appendTo(tr);
- $("<td/>").text(ps[i].mimetype != undefined ? ctToString(ps[i].mimetype) : '').appendTo(tr);
- $("<td/>").text(ps[i].expiry || '').appendTo(tr);
- if(!ps[i].volatile) {
- $("<td/>").append(modBtn).append(delBtn).appendTo(tr);
- } else {
- $("<td>autoregistered</td>").appendTo(tr);
- }
- table.append(tr);
- }
- programs.empty().append(table);
- }
-
- function writeContent() {
- // set Buttons
- var button = $("<button/>", {
- disabled : true
- }).text("Upload");
-
- programs = $("<div/>").text('loading');
- var newprogram = $("<table/>");
- buttonset = $("<div/>");
- button.click(function() {
- addProgram();
- });
-
- loader = $("<div/>");
- buttonset.append(button);
- buttonset.append(loader);
-
- loadS = $("<div style='float: right;margin-top: -60px;'></div>");
-
- contentBox.html("<h2 style='margin-bottom: 10px;'>LD-Cache Endpoints</h2>");
- contentBox.append(programs);
- contentBox.append("<h4 style='margin-bottom: 10px;margin-top: 25px'>Add LD-Cache Endpoint</h4>");
- contentBox.append(loadS);
- contentBox.append(newprogram);
- contentBox.append(buttonset);
-
- $.getJSON(settings.host + "config/list?prefix=ldcache.sample", function(data) {
- writeSample(data);
- });
- $.getJSON(settings.host + "cache/endpoint/list", function(data) {
- writePrograms(data);
- });
-
- // add new program stuff
- name = $("<input style='width: 100%;' type='text' size='100'>");
- kind = $("<select>");
- $.getJSON(settings.host + "cache/provider/list", function(data) {
- kind.empty();
- for ( var d in data) {
- $("<option/>", {
- value : data[d],
- text : data[d]
- }).appendTo(kind);
- }
- $("<option/>", {
- value : "NONE",
- text : "NONE (Blacklist)"
- }).appendTo(kind);
- }).complete(function() {
- button.removeAttr("disabled");
- });
- prefix = $("<input style='width: 100%;' type='text' size='100'>");
- endpoint = $("<input style='width: 100%;' type='text' size='100'>");
- mime = $("<input style='width: 100%;' type='text' size='100'>");
- expiry = $("<input style='width: 100%;' type='text' size='100'>");
-
- newprogram.append("<tr class='title'><td>Name</td><td>Value</td></tr>")
-
- var tr1 = $("<tr></tr>");
- tr1.append("<td>Name</td>");
- var td1 = $("<td></td>").append(name);
- tr1.append(td1);
- newprogram.append(tr1);
-
- var tr2 = $("<tr></tr>");
- tr2.append("<td>Kind / Provider</td>");
- var td2 = $("<td></td>").append(kind);
- tr2.append(td2);
- newprogram.append(tr2);
-
- var tr3 = $("<tr></tr>");
- tr3.append("<td>Prefix</td>");
- var td3 = $("<td></td>").append(prefix);
- tr3.append(td3);
- newprogram.append(tr3);
-
- var tr4 = $("<tr></tr>");
- tr4.append("<td>Enpoint</td>");
- var td4 = $("<td></td>").append(endpoint);
- tr4.append(td4);
- newprogram.append(tr4);
-
- var tr5 = $("<tr></tr>");
- tr5.append("<td>Mimetype</td>");
- var td5 = $("<td></td>").append(mime);
- tr5.append(td5);
- newprogram.append(tr5);
-
- var tr6 = $("<tr></tr>");
- tr6.append("<td>Expiry Time</td>");
- var td6 = $("<td></td>").append(expiry);
- tr6.append(td6);
- newprogram.append(tr6);
- }
-
- return this.each(function() {
- // merge options
- if (options) {
- $.extend(settings, options);
- }
- contentBox = $(this);
- // build skeleton
-
- writeContent();
-
- // $.getJSON(settings.host+"import/types",
- // function(data){write(data);});
- });
- };
-})(jQuery);
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/47855a4b/platform/marmotta-ldcache-file/pom.xml
----------------------------------------------------------------------
diff --git a/platform/marmotta-ldcache-file/pom.xml b/platform/marmotta-ldcache-file/pom.xml
deleted file mode 100644
index 92de994..0000000
--- a/platform/marmotta-ldcache-file/pom.xml
+++ /dev/null
@@ -1,174 +0,0 @@
-<?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-file</artifactId>
- <packaging>jar</packaging>
-
- <name>Apache Marmotta Platform: Linked Data Caching (File Backend)</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.
- </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>marmotta-ldcache-common</artifactId>
- <version>${project.parent.version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.marmotta</groupId>
- <artifactId>ldcache-sail-generic</artifactId>
- </dependency>
- <dependency>
- <groupId>org.apache.marmotta</groupId>
- <artifactId>ldcache-backend-file</artifactId>
- <version>${project.version}</version>
- </dependency>
-
-
- </dependencies>
-</project>
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/47855a4b/platform/marmotta-ldcache-file/src/main/java/org/apache/marmotta/platform/ldcache/services/kiwi/FileLDCacheSailProvider.java
----------------------------------------------------------------------
diff --git a/platform/marmotta-ldcache-file/src/main/java/org/apache/marmotta/platform/ldcache/services/kiwi/FileLDCacheSailProvider.java b/platform/marmotta-ldcache-file/src/main/java/org/apache/marmotta/platform/ldcache/services/kiwi/FileLDCacheSailProvider.java
deleted file mode 100644
index 394a4a2..0000000
--- a/platform/marmotta-ldcache-file/src/main/java/org/apache/marmotta/platform/ldcache/services/kiwi/FileLDCacheSailProvider.java
+++ /dev/null
@@ -1,131 +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.ldcache.services.kiwi;
-
-import com.google.common.collect.Lists;
-import org.apache.marmotta.commons.sesame.filter.NotFilter;
-import org.apache.marmotta.commons.sesame.filter.OneOfFilter;
-import org.apache.marmotta.commons.sesame.filter.SesameFilter;
-import org.apache.marmotta.ldcache.backend.file.LDCachingFileBackend;
-import org.apache.marmotta.ldcache.sail.GenericLinkedDataSail;
-import org.apache.marmotta.ldcache.services.LDCache;
-import org.apache.marmotta.ldclient.api.ldclient.LDClientService;
-import org.apache.marmotta.platform.core.model.filter.MarmottaLocalFilter;
-import org.apache.marmotta.platform.ldcache.api.ldcache.LDCacheSailProvider;
-import org.openrdf.model.Resource;
-import org.openrdf.repository.RepositoryException;
-import org.openrdf.sail.NotifyingSail;
-import org.openrdf.sail.helpers.NotifyingSailWrapper;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import javax.enterprise.context.ApplicationScoped;
-import java.io.File;
-import java.util.HashSet;
-import java.util.Set;
-
-/**
- * A sail provider service that allows wrapping a transparent Linked Data caching component around the
- * main SAIL. This service builds on any triple stores and represents cache entries in a file structure
- * inside the Marmotta home directory
- *
- * <p/>
- * Author: Sebastian Schaffert (sschaffert@apache.org)
- */
-@ApplicationScoped
-public class FileLDCacheSailProvider extends LDCacheSailProvider {
-
- private static Logger log = LoggerFactory.getLogger(FileLDCacheSailProvider.class);
-
- private LDCachingFileBackend backend;
-
- private GenericLinkedDataSail sail;
-
- private File directory;
-
- /**
- * Return the name of the provider. Used e.g. for displaying status information or logging.
- *
- * @return
- */
- @Override
- public String getName() {
- return "Linked Data Caching (File Backend)";
- }
-
-
- /**
- * Create the sail wrapper provided by this SailProvider
- *
- * @param parent the parent sail to wrap by the provider
- * @return the wrapped sail
- */
- @Override
- public NotifyingSailWrapper createSail(NotifyingSail parent) {
- Set<SesameFilter<Resource>> filters = new HashSet<SesameFilter<Resource>>();
- filters.add(MarmottaLocalFilter.getInstance());
- filters.addAll(Lists.newArrayList(ignoreFilters));
-
- SesameFilter<Resource> cacheFilters = new OneOfFilter<Resource>(filters);
-
- String cache_context = configurationService.getCacheContext();
-
- directory = new File(configurationService.getHome() + File.separator + "ldcache");
-
- try {
- backend = new LDCachingFileBackend(directory);
- sail = new GenericLinkedDataSail(parent, backend, new NotFilter<Resource>(cacheFilters), ldclientConfig);
- return sail;
- } catch (RepositoryException e) {
- log.error("could not initialize LDCache file backend",e);
- return null;
- }
- }
-
-
- /**
- * Return the Linked Data Client used by the caching system (e.g. for debugging).
- * @return
- */
- public LDClientService getLDClient() {
- if(sail != null) {
- return sail.getLDCache().getLDClient();
- } else {
- return null;
- }
- }
-
- /**
- * Return the caching backend used by the caching system (e.g. for debugging)
- * @return
- */
- public LDCache getLDCache() {
- if(sail != null) {
- return sail.getLDCache();
- } else {
- return null;
- }
- }
-
- /**
- * Clear the currently configured Linked Data Sail.
- */
- @Override
- public void clearSail() {
- sail = null;
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/47855a4b/platform/marmotta-ldcache-file/src/main/resources/META-INF/beans.xml
----------------------------------------------------------------------
diff --git a/platform/marmotta-ldcache-file/src/main/resources/META-INF/beans.xml b/platform/marmotta-ldcache-file/src/main/resources/META-INF/beans.xml
deleted file mode 100644
index 461858e..0000000
--- a/platform/marmotta-ldcache-file/src/main/resources/META-INF/beans.xml
+++ /dev/null
@@ -1,28 +0,0 @@
-<?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/marmotta-ldcache-kiwi/pom.xml
----------------------------------------------------------------------
diff --git a/platform/marmotta-ldcache-kiwi/pom.xml b/platform/marmotta-ldcache-kiwi/pom.xml
deleted file mode 100644
index 4633171..0000000
--- a/platform/marmotta-ldcache-kiwi/pom.xml
+++ /dev/null
@@ -1,174 +0,0 @@
-<?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-kiwi</artifactId>
- <packaging>jar</packaging>
-
- <name>Apache Marmotta Platform: Linked Data Caching (KiWi Backend)</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.
- </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>marmotta-ldcache-common</artifactId>
- <version>${project.parent.version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.marmotta</groupId>
- <artifactId>marmotta-backend-kiwi</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.marmotta</groupId>
- <artifactId>ldcache-sail-kiwi</artifactId>
- </dependency>
-
-
- </dependencies>
-</project>
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/47855a4b/platform/marmotta-ldcache-kiwi/src/main/java/org/apache/marmotta/platform/ldcache/services/kiwi/KiWiLDCacheSailProvider.java
----------------------------------------------------------------------
diff --git a/platform/marmotta-ldcache-kiwi/src/main/java/org/apache/marmotta/platform/ldcache/services/kiwi/KiWiLDCacheSailProvider.java b/platform/marmotta-ldcache-kiwi/src/main/java/org/apache/marmotta/platform/ldcache/services/kiwi/KiWiLDCacheSailProvider.java
deleted file mode 100644
index e97737d..0000000
--- a/platform/marmotta-ldcache-kiwi/src/main/java/org/apache/marmotta/platform/ldcache/services/kiwi/KiWiLDCacheSailProvider.java
+++ /dev/null
@@ -1,113 +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.ldcache.services.kiwi;
-
-import com.google.common.collect.Lists;
-import org.apache.marmotta.commons.sesame.filter.NotFilter;
-import org.apache.marmotta.commons.sesame.filter.OneOfFilter;
-import org.apache.marmotta.commons.sesame.filter.SesameFilter;
-import org.apache.marmotta.ldcache.sail.KiWiLinkedDataSail;
-import org.apache.marmotta.ldcache.services.LDCache;
-import org.apache.marmotta.ldclient.api.ldclient.LDClientService;
-import org.apache.marmotta.platform.core.model.filter.MarmottaLocalFilter;
-import org.apache.marmotta.platform.ldcache.api.ldcache.LDCacheSailProvider;
-import org.openrdf.model.Resource;
-import org.openrdf.sail.NotifyingSail;
-import org.openrdf.sail.helpers.NotifyingSailWrapper;
-
-import javax.enterprise.context.ApplicationScoped;
-import java.util.HashSet;
-import java.util.Set;
-
-/**
- * A sail provider service that allows wrapping a transparent Linked Data caching component around the
- * main SAIL. This service builds on the KiWi triple store and represents cache entries in a separate table
- * of the database.
- *
- * <p/>
- * Author: Sebastian Schaffert (sschaffert@apache.org)
- */
-@ApplicationScoped
-public class KiWiLDCacheSailProvider extends LDCacheSailProvider {
-
-
- private KiWiLinkedDataSail sail;
-
- /**
- * Return the name of the provider. Used e.g. for displaying status information or logging.
- *
- * @return
- */
- @Override
- public String getName() {
- return "Linked Data Caching (KiWi Backend)";
- }
-
-
- /**
- * Create the sail wrapper provided by this SailProvider
- *
- * @param parent the parent sail to wrap by the provider
- * @return the wrapped sail
- */
- @Override
- public NotifyingSailWrapper createSail(NotifyingSail parent) {
- Set<SesameFilter<Resource>> filters = new HashSet<SesameFilter<Resource>>();
- filters.add(MarmottaLocalFilter.getInstance());
- filters.addAll(Lists.newArrayList(ignoreFilters));
-
- SesameFilter<Resource> cacheFilters = new OneOfFilter<Resource>(filters);
-
- String cache_context = configurationService.getCacheContext();
- sail = new KiWiLinkedDataSail(parent, new NotFilter<Resource>(cacheFilters), cache_context, ldclientConfig);
- return sail;
- }
-
-
- /**
- * Return the Linked Data Client used by the caching system (e.g. for debugging).
- * @return
- */
- public LDClientService getLDClient() {
- if(sail != null) {
- return sail.getLDCache().getLDClient();
- } else {
- return null;
- }
- }
-
- /**
- * Return the caching backend used by the caching system (e.g. for debugging)
- * @return
- */
- public LDCache getLDCache() {
- if(sail != null) {
- return sail.getLDCache();
- } else {
- return null;
- }
- }
-
- /**
- * Clear the currently configured Linked Data Sail.
- */
- @Override
- public void clearSail() {
- sail = null;
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/47855a4b/platform/marmotta-ldcache-kiwi/src/main/resources/META-INF/beans.xml
----------------------------------------------------------------------
diff --git a/platform/marmotta-ldcache-kiwi/src/main/resources/META-INF/beans.xml b/platform/marmotta-ldcache-kiwi/src/main/resources/META-INF/beans.xml
deleted file mode 100644
index 461858e..0000000
--- a/platform/marmotta-ldcache-kiwi/src/main/resources/META-INF/beans.xml
+++ /dev/null
@@ -1,28 +0,0 @@
-<?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/pom.xml
----------------------------------------------------------------------
diff --git a/platform/pom.xml b/platform/pom.xml
index e68243c..4561bc5 100644
--- a/platform/pom.xml
+++ b/platform/pom.xml
@@ -55,8 +55,8 @@
<module>marmotta-core</module>
<!-- alternative backend implementations, only include exactly one in your classpath -->
- <module>marmotta-backend-kiwi</module>
- <module>marmotta-backend-native</module>
+ <module>backends</module>
+ <module>ldcache</module>
<!-- generic modules -->
<module>marmotta-ldpath</module>
@@ -64,28 +64,14 @@
<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>
<module>marmotta-versioning-kiwi</module>
- <!-- Native/BigData specific modules -->
- <module>marmotta-ldcache-file</module>
</modules>
- <profiles>
- <!-- non-free backends and modules -->
- <profile>
- <id>non-free</id>
- <modules>
- <module>marmotta-backend-bigdata</module>
- </modules>
- </profile>
- </profiles>
-
</project>
[03/30] git commit: fixed some warnings
Posted by ja...@apache.org.
fixed some warnings
Project: http://git-wip-us.apache.org/repos/asf/incubator-marmotta/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-marmotta/commit/4d9a115b
Tree: http://git-wip-us.apache.org/repos/asf/incubator-marmotta/tree/4d9a115b
Diff: http://git-wip-us.apache.org/repos/asf/incubator-marmotta/diff/4d9a115b
Branch: refs/heads/MARMOTTA-345
Commit: 4d9a115ba020cb87ef73eefafdc580d8a63d22a0
Parents: 6fd4e02
Author: Jakob Frank <ja...@apache.org>
Authored: Thu Oct 17 17:25:51 2013 +0200
Committer: Jakob Frank <ja...@apache.org>
Committed: Thu Oct 17 17:25:51 2013 +0200
----------------------------------------------------------------------
.../apache/marmotta/commons/sesame/model/StatementCommons.java | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/4d9a115b/commons/marmotta-commons/src/main/java/org/apache/marmotta/commons/sesame/model/StatementCommons.java
----------------------------------------------------------------------
diff --git a/commons/marmotta-commons/src/main/java/org/apache/marmotta/commons/sesame/model/StatementCommons.java b/commons/marmotta-commons/src/main/java/org/apache/marmotta/commons/sesame/model/StatementCommons.java
index c04e7be..0d9f2b0 100644
--- a/commons/marmotta-commons/src/main/java/org/apache/marmotta/commons/sesame/model/StatementCommons.java
+++ b/commons/marmotta-commons/src/main/java/org/apache/marmotta/commons/sesame/model/StatementCommons.java
@@ -22,8 +22,6 @@ import com.google.common.base.Objects;
import javolution.util.FastMap;
import javolution.util.FastSet;
import javolution.util.function.Equality;
-import org.apache.marmotta.commons.collections.EquivalenceHashMap;
-import org.apache.marmotta.commons.collections.EquivalenceHashSet;
import org.openrdf.model.Statement;
import java.util.Map;
@@ -161,6 +159,8 @@ public class StatementCommons {
private static <E> Equality<E> equivalenceEquality(final Equivalence<E> equivalence) {
return new Equality<E>() {
+ private static final long serialVersionUID = 1L;
+
@Override
public int hashCodeOf(E object) {
return equivalence.hash(object);
[20/30] git commit: fixed jrebel config in marmotta-webapp
Posted by ja...@apache.org.
fixed jrebel config in marmotta-webapp
Project: http://git-wip-us.apache.org/repos/asf/incubator-marmotta/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-marmotta/commit/98ca7aed
Tree: http://git-wip-us.apache.org/repos/asf/incubator-marmotta/tree/98ca7aed
Diff: http://git-wip-us.apache.org/repos/asf/incubator-marmotta/diff/98ca7aed
Branch: refs/heads/MARMOTTA-345
Commit: 98ca7aedf89ff809c49a3a4918f68f3b2693ade7
Parents: 47855a4
Author: Jakob Frank <ja...@apache.org>
Authored: Wed Oct 23 14:32:46 2013 +0200
Committer: Jakob Frank <ja...@apache.org>
Committed: Wed Oct 23 14:32:46 2013 +0200
----------------------------------------------------------------------
launchers/marmotta-webapp/pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/98ca7aed/launchers/marmotta-webapp/pom.xml
----------------------------------------------------------------------
diff --git a/launchers/marmotta-webapp/pom.xml b/launchers/marmotta-webapp/pom.xml
index 26964d8..881660c 100644
--- a/launchers/marmotta-webapp/pom.xml
+++ b/launchers/marmotta-webapp/pom.xml
@@ -60,7 +60,7 @@
<groupId>org.zeroturnaround</groupId>
<artifactId>jrebel-maven-plugin</artifactId>
<configuration>
- <relativePath>../</relativePath>
+ <relativePath>../../</relativePath>
<rootPath>${rebel.root}</rootPath>
</configuration>
</plugin>
[06/30] git commit: remove KiWi dependencies from marmotta-core
Posted by ja...@apache.org.
remove KiWi dependencies from marmotta-core
Project: http://git-wip-us.apache.org/repos/asf/incubator-marmotta/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-marmotta/commit/8fdc1498
Tree: http://git-wip-us.apache.org/repos/asf/incubator-marmotta/tree/8fdc1498
Diff: http://git-wip-us.apache.org/repos/asf/incubator-marmotta/diff/8fdc1498
Branch: refs/heads/MARMOTTA-345
Commit: 8fdc14987815c153c40a18794e81862ea64c3bc3
Parents: 8756395
Author: Sebastian Schaffert <ss...@apache.org>
Authored: Mon Oct 21 12:06:02 2013 +0200
Committer: Sebastian Schaffert <ss...@apache.org>
Committed: Mon Oct 21 12:06:02 2013 +0200
----------------------------------------------------------------------
.../commons/sesame/model/StatementCommons.java | 1 +
.../sesame/repository/ResourceUtils.java | 120 ++++++++++++++++++-
platform/marmotta-core/pom.xml | 38 +++---
.../platform/core/api/user/UserToken.java | 10 +-
.../platform/core/rio/RDFHtmlWriterImpl.java | 6 +-
.../content/FileSystemContentReader.java | 33 ++---
.../content/FileSystemContentWriter.java | 18 +--
.../services/content/HTTPContentReader.java | 36 +++---
.../core/services/sesame/KiWiSesameUtil.java | 63 ----------
.../sesame/ResourceSubjectMetadata.java | 6 +-
.../resource/InspectionWebService.java | 44 ++-----
.../webservices/resource/MetaWebService.java | 3 +-
.../resource/ResourceWebService.java | 3 +-
.../core/test/base/TestStoreProvider.java | 9 ++
14 files changed, 202 insertions(+), 188 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/8fdc1498/commons/marmotta-commons/src/main/java/org/apache/marmotta/commons/sesame/model/StatementCommons.java
----------------------------------------------------------------------
diff --git a/commons/marmotta-commons/src/main/java/org/apache/marmotta/commons/sesame/model/StatementCommons.java b/commons/marmotta-commons/src/main/java/org/apache/marmotta/commons/sesame/model/StatementCommons.java
index 0d9f2b0..194732c 100644
--- a/commons/marmotta-commons/src/main/java/org/apache/marmotta/commons/sesame/model/StatementCommons.java
+++ b/commons/marmotta-commons/src/main/java/org/apache/marmotta/commons/sesame/model/StatementCommons.java
@@ -187,4 +187,5 @@ public class StatementCommons {
}
};
}
+
}
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/8fdc1498/commons/marmotta-commons/src/main/java/org/apache/marmotta/commons/sesame/repository/ResourceUtils.java
----------------------------------------------------------------------
diff --git a/commons/marmotta-commons/src/main/java/org/apache/marmotta/commons/sesame/repository/ResourceUtils.java b/commons/marmotta-commons/src/main/java/org/apache/marmotta/commons/sesame/repository/ResourceUtils.java
index 1484df2..3f79ea4 100644
--- a/commons/marmotta-commons/src/main/java/org/apache/marmotta/commons/sesame/repository/ResourceUtils.java
+++ b/commons/marmotta-commons/src/main/java/org/apache/marmotta/commons/sesame/repository/ResourceUtils.java
@@ -21,7 +21,6 @@ import com.google.common.base.Function;
import com.google.common.base.Predicate;
import com.google.common.collect.Iterables;
import com.google.common.collect.Iterators;
-
import org.apache.marmotta.commons.sesame.model.Namespaces;
import org.openrdf.model.*;
import org.openrdf.repository.RepositoryConnection;
@@ -33,6 +32,8 @@ import org.openrdf.sail.helpers.SailConnectionWrapper;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
import java.util.*;
/**
@@ -1368,4 +1369,121 @@ public class ResourceUtils {
}
}
+
+ /**
+ * Return the creation date of the resource if this information is available. Otherwise returns null. At the
+ * moment only supports KiWi resources (through reflection)
+ *
+ * @param resource
+ * @return
+ * @throws RepositoryConnection
+ */
+ public static Date getCreated(RepositoryConnection conn, Resource resource) {
+ try {
+ Method m = resource.getClass().getMethod("getCreated", new Class[0]);
+ return (Date)m.invoke(resource);
+ } catch (NoSuchMethodException | InvocationTargetException | IllegalAccessException | ClassCastException e) {
+ return null;
+ }
+ }
+
+ /**
+ * Get the last modification of the set of triples passed as argument.
+ *
+ * @return date
+ * @throws org.openrdf.repository.RepositoryException
+ */
+ public static Date getLastModified(RepositoryConnection conn, Resource resource) throws RepositoryException {
+ Date last_modified = new Date(0);
+ RepositoryResult<Statement> triples = conn.getStatements(resource, null, null, false);
+ try {
+ while (triples.hasNext()) {
+ Statement triple = triples.next();
+
+ try {
+ Method m = triple.getClass().getMethod("getCreated", new Class[0]);
+ Date created = (Date)m.invoke(triple);
+ if (created.getTime() > last_modified.getTime()) {
+ last_modified = created;
+ }
+ } catch (NoSuchMethodException | InvocationTargetException | IllegalAccessException | ClassCastException e) {
+ // do nothing
+ }
+ }
+ } finally {
+ triples.close();
+ }
+ return last_modified;
+ }
+
+
+ /**
+ * Return true in case the statement passed as argument is an inferred statement. Since this method does not
+ * have access to the repository it can only use properties of the statement to figure out if it is inferred.
+ * @param stmt
+ * @return
+ * @throws RepositoryConnection
+ */
+ public static boolean isInferred(Statement stmt) {
+ try {
+ Method m = stmt.getClass().getMethod("isInferred", new Class[0]);
+ return (Boolean)m.invoke(stmt);
+ } catch (NoSuchMethodException | InvocationTargetException | IllegalAccessException | ClassCastException e) {
+ return false;
+ }
+
+ }
+
+
+ /**
+ * Return true in case the statement passed as argument is an inferred statement. Depending on the concrete
+ * implementation of the statement uses different approaches to figure out if it is inferred or not.
+ * @param conn
+ * @param stmt
+ * @return
+ * @throws RepositoryConnection
+ */
+ public static boolean isInferred(RepositoryConnection conn, Statement stmt) throws RepositoryException {
+ try {
+ Method m = stmt.getClass().getMethod("isInferred", new Class[0]);
+ return (Boolean)m.invoke(stmt);
+ } catch (NoSuchMethodException | InvocationTargetException | IllegalAccessException | ClassCastException e) {
+ boolean is_base = conn.hasStatement(stmt,false);
+ boolean exists = conn.hasStatement(stmt,true);
+
+ return !is_base && exists;
+ }
+
+ }
+
+
+ /**
+ * Return true in case the statement passed as argument is a deleted statement. Depending on the concrete
+ * implementation of the statement uses different approaches to figure out if it is deleted or not.
+ * @param conn
+ * @param stmt
+ * @return
+ * @throws RepositoryConnection
+ */
+ public static boolean isDeleted(RepositoryConnection conn, Statement stmt) throws RepositoryException {
+ try {
+ Method m = stmt.getClass().getMethod("isDeleted", new Class[0]);
+ return (Boolean)m.invoke(stmt);
+ } catch (NoSuchMethodException | InvocationTargetException | IllegalAccessException | ClassCastException e) {
+ boolean exists = conn.hasStatement(stmt,true);
+
+ return !exists;
+ }
+
+ }
+
+ public static long getId(Statement stmt) {
+ try {
+ Method m = stmt.getClass().getMethod("getId", new Class[0]);
+ return (Long)m.invoke(stmt);
+ } catch (NoSuchMethodException | InvocationTargetException | IllegalAccessException | ClassCastException e) {
+ return 0L;
+ }
+
+ }
}
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/8fdc1498/platform/marmotta-core/pom.xml
----------------------------------------------------------------------
diff --git a/platform/marmotta-core/pom.xml b/platform/marmotta-core/pom.xml
index 780359d..d435294 100644
--- a/platform/marmotta-core/pom.xml
+++ b/platform/marmotta-core/pom.xml
@@ -381,14 +381,6 @@
<artifactId>h2</artifactId>
<scope>test</scope>
</dependency>
- <!-- introduces a cyclic reference ...
- <dependency>
- <groupId>org.apache.marmotta</groupId>
- <artifactId>marmotta-backend-kiwi</artifactId>
- <version>${project.version}</version>
- <scope>test</scope>
- </dependency>
- -->
<dependency>
<groupId>com.jayway.restassured</groupId>
@@ -416,6 +408,18 @@
<scope>test</scope>
</dependency>
+ <dependency>
+ <groupId>org.openrdf.sesame</groupId>
+ <artifactId>sesame-sail-memory</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.openrdf.sesame</groupId>
+ <artifactId>sesame-sail-inferencer</artifactId>
+ <scope>test</scope>
+ </dependency>
+
+
<!-- CDI/Java EE 6 Environment -->
<dependency>
<groupId>javax.enterprise</groupId>
@@ -500,18 +504,8 @@
<groupId>org.openrdf.sesame</groupId>
<artifactId>sesame-sail-api</artifactId>
</dependency>
- <dependency>
- <groupId>org.openrdf.sesame</groupId>
- <artifactId>sesame-sail-memory</artifactId>
- </dependency>
- <dependency>
- <groupId>org.openrdf.sesame</groupId>
- <artifactId>sesame-sail-nativerdf</artifactId>
- </dependency>
- <dependency>
- <groupId>org.openrdf.sesame</groupId>
- <artifactId>sesame-sail-inferencer</artifactId>
- </dependency>
+
+
<dependency>
<groupId>org.apache.marmotta</groupId>
@@ -569,10 +563,6 @@
<dependency>
<groupId>org.apache.marmotta</groupId>
- <artifactId>kiwi-triplestore</artifactId>
- </dependency>
- <dependency>
- <groupId>org.apache.marmotta</groupId>
<artifactId>kiwi-transactions</artifactId>
</dependency>
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/8fdc1498/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/api/user/UserToken.java
----------------------------------------------------------------------
diff --git a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/api/user/UserToken.java b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/api/user/UserToken.java
index a56329a..940c795 100644
--- a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/api/user/UserToken.java
+++ b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/api/user/UserToken.java
@@ -18,7 +18,7 @@
package org.apache.marmotta.platform.core.api.user;
-import org.apache.marmotta.kiwi.model.rdf.KiWiUriResource;
+import org.openrdf.model.URI;
import java.util.Date;
import java.util.UUID;
@@ -34,10 +34,10 @@ public class UserToken {
private UUID uuid;
- private KiWiUriResource user;
+ private URI user;
- public UserToken(KiWiUriResource user) {
+ public UserToken(URI user) {
this.user = user;
this.uuid = UUID.randomUUID();
this.created = new Date();
@@ -60,11 +60,11 @@ public class UserToken {
this.uuid = uuid;
}
- public KiWiUriResource getUser() {
+ public URI getUser() {
return user;
}
- public void setUser(KiWiUriResource user) {
+ public void setUser(URI user) {
this.user = user;
}
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/8fdc1498/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/rio/RDFHtmlWriterImpl.java
----------------------------------------------------------------------
diff --git a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/rio/RDFHtmlWriterImpl.java b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/rio/RDFHtmlWriterImpl.java
index 9c42bc1..4d73a9c 100644
--- a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/rio/RDFHtmlWriterImpl.java
+++ b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/rio/RDFHtmlWriterImpl.java
@@ -20,7 +20,7 @@ package org.apache.marmotta.platform.core.rio;
import com.google.common.collect.ImmutableMap;
import org.apache.commons.lang3.StringUtils;
import org.apache.marmotta.commons.http.UriUtil;
-import org.apache.marmotta.kiwi.model.rdf.KiWiTriple;
+import org.apache.marmotta.commons.sesame.repository.ResourceUtils;
import org.apache.marmotta.platform.core.api.config.ConfigurationService;
import org.apache.marmotta.platform.core.api.io.RDFHtmlWriter;
import org.apache.marmotta.platform.core.api.io.RDFWriterPriority;
@@ -204,8 +204,8 @@ public class RDFHtmlWriterImpl implements RDFHtmlWriter {
triple.put("context", ImmutableMap.of("uri","","curie",""));
}
- if (t instanceof KiWiTriple && ((KiWiTriple) t).isInferred()) {
- triple.put("info", createInfo(((KiWiTriple) t).getId()));
+ if (ResourceUtils.isInferred(t)) {
+ triple.put("info", ResourceUtils.getId(t));
} else {
triple.put("info", "-");
}
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/8fdc1498/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/services/content/FileSystemContentReader.java
----------------------------------------------------------------------
diff --git a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/services/content/FileSystemContentReader.java b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/services/content/FileSystemContentReader.java
index 3c2510e..b0d9e02 100644
--- a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/services/content/FileSystemContentReader.java
+++ b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/services/content/FileSystemContentReader.java
@@ -17,21 +17,9 @@
*/
package org.apache.marmotta.platform.core.services.content;
-import static org.apache.marmotta.commons.sesame.repository.ExceptionUtils.handleRepositoryException;
-
-import java.io.BufferedInputStream;
-import java.io.File;
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.URI;
-
-import javax.annotation.PostConstruct;
-import javax.enterprise.context.ApplicationScoped;
-import javax.inject.Inject;
-
+import com.google.common.io.ByteStreams;
+import com.google.common.io.Files;
import org.apache.marmotta.commons.sesame.facading.FacadingFactory;
-import org.apache.marmotta.kiwi.model.rdf.KiWiUriResource;
import org.apache.marmotta.platform.core.api.config.ConfigurationService;
import org.apache.marmotta.platform.core.api.content.ContentReader;
import org.apache.marmotta.platform.core.api.triplestore.SesameService;
@@ -43,8 +31,13 @@ import org.openrdf.repository.RepositoryConnection;
import org.openrdf.repository.RepositoryException;
import org.slf4j.Logger;
-import com.google.common.io.ByteStreams;
-import com.google.common.io.Files;
+import javax.annotation.PostConstruct;
+import javax.enterprise.context.ApplicationScoped;
+import javax.inject.Inject;
+import java.io.*;
+import java.net.URI;
+
+import static org.apache.marmotta.commons.sesame.repository.ExceptionUtils.handleRepositoryException;
/**
* A content reader that reads the content of a resource from the file system.
@@ -138,7 +131,7 @@ public class FileSystemContentReader implements ContentReader {
MediaContentItem mci = FacadingFactory.createFacading(conn).createFacade(resource, MediaContentItem.class);
String path = mci.getContentPath();
- if(path == null && resource instanceof KiWiUriResource && resource.stringValue().startsWith("file:")) {
+ if(path == null && resource instanceof org.openrdf.model.URI && resource.stringValue().startsWith("file:")) {
try {
URI uri = new URI(resource.stringValue());
path = uri.getPath();
@@ -192,7 +185,7 @@ public class FileSystemContentReader implements ContentReader {
MediaContentItem mci = FacadingFactory.createFacading(conn).createFacade(resource, MediaContentItem.class);
String path = mci.getContentPath();
- if(path == null && resource instanceof KiWiUriResource && resource.stringValue().startsWith("file:")) {
+ if(path == null && resource instanceof org.openrdf.model.URI && resource.stringValue().startsWith("file:")) {
try {
URI uri = new URI(resource.stringValue());
path = uri.getPath();
@@ -235,7 +228,7 @@ public class FileSystemContentReader implements ContentReader {
MediaContentItem mci = FacadingFactory.createFacading(conn).createFacade(resource, MediaContentItem.class);
String path = mci.getContentPath();
- if(path == null && resource instanceof KiWiUriResource && resource.stringValue().startsWith("file:")) {
+ if(path == null && resource instanceof org.openrdf.model.URI && resource.stringValue().startsWith("file:")) {
try {
URI uri = new URI(resource.stringValue());
path = uri.getPath();
@@ -292,7 +285,7 @@ public class FileSystemContentReader implements ContentReader {
MediaContentItem mci = FacadingFactory.createFacading(conn).createFacade(resource, MediaContentItem.class);
String path = mci.getContentPath();
- if(path == null && resource instanceof KiWiUriResource && resource.stringValue().startsWith("file:")) {
+ if(path == null && resource instanceof org.openrdf.model.URI && resource.stringValue().startsWith("file:")) {
try {
URI uri = new URI(resource.stringValue());
path = uri.getPath();
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/8fdc1498/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/services/content/FileSystemContentWriter.java
----------------------------------------------------------------------
diff --git a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/services/content/FileSystemContentWriter.java b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/services/content/FileSystemContentWriter.java
index d26f2cc..5a4af17 100644
--- a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/services/content/FileSystemContentWriter.java
+++ b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/services/content/FileSystemContentWriter.java
@@ -17,17 +17,13 @@
*/
package org.apache.marmotta.platform.core.services.content;
-import static org.apache.marmotta.commons.sesame.repository.ExceptionUtils.handleRepositoryException;
-
import com.google.common.io.ByteStreams;
import com.google.common.io.Files;
+import org.apache.marmotta.commons.sesame.facading.FacadingFactory;
import org.apache.marmotta.platform.core.api.config.ConfigurationService;
import org.apache.marmotta.platform.core.api.content.ContentWriter;
import org.apache.marmotta.platform.core.api.triplestore.SesameService;
import org.apache.marmotta.platform.core.model.content.MediaContentItem;
-
-import org.apache.marmotta.commons.sesame.facading.FacadingFactory;
-import org.apache.marmotta.kiwi.model.rdf.KiWiUriResource;
import org.openrdf.model.Resource;
import org.openrdf.repository.RepositoryConnection;
import org.openrdf.repository.RepositoryException;
@@ -38,14 +34,12 @@ import sun.net.www.MimeTable;
import javax.annotation.PostConstruct;
import javax.enterprise.context.ApplicationScoped;
import javax.inject.Inject;
-import java.io.ByteArrayInputStream;
-import java.io.File;
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.io.InputStream;
+import java.io.*;
import java.net.URI;
import java.util.UUID;
+import static org.apache.marmotta.commons.sesame.repository.ExceptionUtils.handleRepositoryException;
+
/**
* A content writer that writes the content of a resource to the file system.
* It uses the kiwi:hasContentPath property to determine the destination path of the content to write to.
@@ -171,9 +165,9 @@ public class FileSystemContentWriter implements ContentWriter {
String path = mci.getContentPath();
if(path == null) {
- if(resource instanceof KiWiUriResource && ((KiWiUriResource)resource).stringValue().startsWith("file:")) {
+ if(resource instanceof org.openrdf.model.URI && resource.stringValue().startsWith("file:")) {
try {
- URI uri = new URI(((KiWiUriResource)resource).stringValue());
+ URI uri = new URI(resource.stringValue());
path = uri.getPath();
} catch(Exception ex) {}
} else {
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/8fdc1498/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/services/content/HTTPContentReader.java
----------------------------------------------------------------------
diff --git a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/services/content/HTTPContentReader.java b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/services/content/HTTPContentReader.java
index b52038e..d74c37f 100644
--- a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/services/content/HTTPContentReader.java
+++ b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/services/content/HTTPContentReader.java
@@ -17,32 +17,30 @@
*/
package org.apache.marmotta.platform.core.services.content;
-import static org.apache.marmotta.commons.sesame.repository.ExceptionUtils.handleRepositoryException;
-
-import java.io.IOException;
-import java.io.InputStream;
-
-import javax.annotation.PostConstruct;
-import javax.enterprise.context.ApplicationScoped;
-import javax.inject.Inject;
-
+import com.google.common.io.ByteStreams;
import org.apache.http.HttpResponse;
import org.apache.http.client.ClientProtocolException;
import org.apache.http.client.ResponseHandler;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.client.methods.HttpHead;
import org.apache.marmotta.commons.sesame.facading.FacadingFactory;
-import org.apache.marmotta.kiwi.model.rdf.KiWiUriResource;
import org.apache.marmotta.platform.core.api.content.ContentReader;
import org.apache.marmotta.platform.core.api.http.HttpClientService;
import org.apache.marmotta.platform.core.api.triplestore.SesameService;
import org.apache.marmotta.platform.core.model.content.MediaContentItem;
import org.openrdf.model.Resource;
+import org.openrdf.model.URI;
import org.openrdf.repository.RepositoryConnection;
import org.openrdf.repository.RepositoryException;
import org.slf4j.Logger;
-import com.google.common.io.ByteStreams;
+import javax.annotation.PostConstruct;
+import javax.enterprise.context.ApplicationScoped;
+import javax.inject.Inject;
+import java.io.IOException;
+import java.io.InputStream;
+
+import static org.apache.marmotta.commons.sesame.repository.ExceptionUtils.handleRepositoryException;
/**
* Add file description here!
@@ -122,8 +120,8 @@ public class HTTPContentReader implements ContentReader {
String location = mci.getContentLocation();
// if no location is explicitly specified, use the resource URI itself
- if(location == null && resource instanceof KiWiUriResource && ((KiWiUriResource)resource).stringValue().startsWith("http://")) {
- location = ((KiWiUriResource)resource).stringValue();
+ if(location == null && resource instanceof URI && resource.stringValue().startsWith("http://")) {
+ location = resource.stringValue();
}
if(location != null) {
@@ -168,8 +166,8 @@ public class HTTPContentReader implements ContentReader {
String location = mci.getContentLocation();
// if no location is explicitly specified, use the resource URI itself
- if(location == null && resource instanceof KiWiUriResource && ((KiWiUriResource)resource).stringValue().startsWith("http://")) {
- location = ((KiWiUriResource)resource).stringValue();
+ if(location == null && resource instanceof URI && resource.stringValue().startsWith("http://")) {
+ location = resource.stringValue();
}
try {
@@ -216,8 +214,8 @@ public class HTTPContentReader implements ContentReader {
String location = mci.getContentLocation();
// if no location is explicitly specified, use the resource URI itself
- if(location == null && resource instanceof KiWiUriResource && ((KiWiUriResource)resource).stringValue().startsWith("http://")) {
- location = ((KiWiUriResource)resource).stringValue();
+ if(location == null && resource instanceof URI && resource.stringValue().startsWith("http://")) {
+ location = resource.stringValue();
}
try {
@@ -265,8 +263,8 @@ public class HTTPContentReader implements ContentReader {
String location = mci.getContentLocation();
// if no location is explicitly specified, use the resource URI itself
- if(location == null && resource instanceof KiWiUriResource && ((KiWiUriResource)resource).stringValue().startsWith("http://")) {
- location = ((KiWiUriResource)resource).stringValue();
+ if(location == null && resource instanceof URI && resource.stringValue().startsWith("http://")) {
+ location = resource.stringValue();
}
try {
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/8fdc1498/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/services/sesame/KiWiSesameUtil.java
----------------------------------------------------------------------
diff --git a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/services/sesame/KiWiSesameUtil.java b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/services/sesame/KiWiSesameUtil.java
deleted file mode 100644
index c7943e7..0000000
--- a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/services/sesame/KiWiSesameUtil.java
+++ /dev/null
@@ -1,63 +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.core.services.sesame;
-
-import org.apache.marmotta.kiwi.model.rdf.KiWiTriple;
-import org.openrdf.model.Resource;
-import org.openrdf.model.Statement;
-import org.openrdf.repository.RepositoryConnection;
-import org.openrdf.repository.RepositoryException;
-import org.openrdf.repository.RepositoryResult;
-
-import java.util.Date;
-
-/**
- * Some utils to work with KiWi model and Sesame
- *
- * @author Sebastian Schaffert
- */
-public class KiWiSesameUtil {
-
-
- /**
- * Get the last modification of the set of triples passed as argument.
- *
- * @deprecated this class will be removed before the 2.6 release, the helper function should be moved elsewhere
- * @return date
- * @throws RepositoryException
- */
- public static Date lastModified(Resource resource, RepositoryConnection conn) throws RepositoryException {
- Date last_modified = new Date(0);
- RepositoryResult<Statement> triples = conn.getStatements(resource, null, null, false);
- try {
- while (triples.hasNext()) {
- Statement triple = triples.next();
- if (triple instanceof KiWiTriple) {
- KiWiTriple t = (KiWiTriple) triple;
- if (t.getCreated().getTime() > last_modified.getTime()) {
- last_modified = t.getCreated();
- }
- }
- }
- } finally {
- triples.close();
- }
- return last_modified;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/8fdc1498/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/services/sesame/ResourceSubjectMetadata.java
----------------------------------------------------------------------
diff --git a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/services/sesame/ResourceSubjectMetadata.java b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/services/sesame/ResourceSubjectMetadata.java
index 1b68337..800ced8 100644
--- a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/services/sesame/ResourceSubjectMetadata.java
+++ b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/services/sesame/ResourceSubjectMetadata.java
@@ -17,8 +17,6 @@
*/
package org.apache.marmotta.platform.core.services.sesame;
-import org.apache.marmotta.kiwi.model.rdf.KiWiAnonResource;
-import org.apache.marmotta.kiwi.model.rdf.KiWiUriResource;
import org.openrdf.model.BNode;
import org.openrdf.model.Resource;
import org.openrdf.model.Value;
@@ -45,11 +43,11 @@ public class ResourceSubjectMetadata extends RepositoryConnectionInterceptorAdap
if (s instanceof org.openrdf.model.URI && subject instanceof org.openrdf.model.URI ) {
// if s is a URI and subject a KiWiUriResource, return
// true if they are different
- denyAdd = !s.stringValue().equals(((KiWiUriResource) subject).toString());
+ denyAdd = !s.stringValue().equals(subject.stringValue());
} else if (s instanceof BNode && subject instanceof BNode) {
// if s is a BNode and subject a KiWiAnonResource,
// return true if they are different
- denyAdd = !s.stringValue().equals(((KiWiAnonResource) subject).getID());
+ denyAdd = !s.stringValue().equals(subject.stringValue());
} else {
// in all other cases, return true to filter out the
// triple
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/8fdc1498/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/webservices/resource/InspectionWebService.java
----------------------------------------------------------------------
diff --git a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/webservices/resource/InspectionWebService.java b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/webservices/resource/InspectionWebService.java
index 4dd30c3..13ba090 100644
--- a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/webservices/resource/InspectionWebService.java
+++ b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/webservices/resource/InspectionWebService.java
@@ -18,8 +18,7 @@
package org.apache.marmotta.platform.core.webservices.resource;
import org.apache.marmotta.commons.sesame.model.Namespaces;
-import org.apache.marmotta.kiwi.model.rdf.KiWiResource;
-import org.apache.marmotta.kiwi.model.rdf.KiWiTriple;
+import org.apache.marmotta.commons.sesame.repository.ResourceUtils;
import org.apache.marmotta.platform.core.api.config.ConfigurationService;
import org.apache.marmotta.platform.core.api.triplestore.SesameService;
import org.openrdf.model.*;
@@ -173,11 +172,7 @@ public class InspectionWebService {
private final String s, p, o, c;
public TriplePoJo(Statement t) {
- if(t instanceof KiWiTriple) {
- id = ((KiWiTriple)t).getId();
- } else {
- id = 0;
- }
+ id = ResourceUtils.getId(t);
s = t.getSubject().toString();
p = t.getPredicate().toString();
o = t.getObject().toString();
@@ -300,10 +295,11 @@ public class InspectionWebService {
ps.println("</head><body>");
ps.printf("<h1>Inspect %s</h1>%n<div>ShortName: %s<span class='%s'>%<s</span></div>%n", rsc.stringValue(), getLabel(conn,rsc), "");
- if(rsc instanceof KiWiResource) {
- ps.printf("<div>Created: <span>%tF %<tT</span> by <span>%s</span></div>%n", ((KiWiResource)rsc).getCreated(), createInspectLink(conn, null, null, ""));
+ Date created = ResourceUtils.getCreated(conn, rsc);
+ if(created != null) {
+ ps.printf("<div>Created: <span>%tF %<tT</span> by <span>%s</span></div>%n", created, createInspectLink(conn, null, null, ""));
}
- ps.printf("<div>Last Modified: <span>%tF %<tT</span></div>%n", lastModified(conn, rsc));
+ ps.printf("<div>Last Modified: <span>%tF %<tT</span></div>%n", ResourceUtils.getLastModified(conn, rsc));
// Outgoing
printOutgoing(conn, rsc, ps, subjOffset, limit);
@@ -319,7 +315,7 @@ public class InspectionWebService {
ps.println();
ps.println("</body></html>");
- return Response.ok().header("Content-Type", "text/html;charset=" + CHARSET).header("Last-Modified", lastModified(conn, rsc))
+ return Response.ok().header("Content-Type", "text/html;charset=" + CHARSET).header("Last-Modified", ResourceUtils.getLastModified(conn, rsc))
.entity(os.toString(CHARSET)).build();
}
@@ -345,7 +341,7 @@ public class InspectionWebService {
for (Statement t : triples) {
ps.printf(" <tr class='%s'><td>%s</td><td>%s</td><td>%s</td><td><span class='reasoned'>%s</span></td><td><span class='deleted %b'></span></td></tr>%n",
i++ % 2 == 0 ? "even" : "odd", createInspectLink(conn, t.getSubject()), createInspectLink(conn,t.getObject()), createInspectLink(conn,t.getContext()),
- t instanceof KiWiTriple && ((KiWiTriple)t).isInferred() ? createInfo(((KiWiTriple)t).getId()) : "", t instanceof KiWiTriple && ((KiWiTriple)t).isDeleted());
+ ResourceUtils.isInferred(conn,t) ? createInfo(ResourceUtils.getId(t)) : "", ResourceUtils.isDeleted(conn,t));
}
ps.printf(" </tbody>%n</table>");
} else if (offset > 0) {
@@ -376,7 +372,7 @@ public class InspectionWebService {
ps.printf(
" <tr class='%s'><td>%s</td><td>%s</td><td>%s</td><td><span class='reasoned'>%s</span></td><td><span class='deleted %b'></span></td></tr>%n",
i++ % 2 == 0 ? "even" : "odd", createInspectLink(conn, t.getSubject()), createInspectLink(conn,t.getObject()), createInspectLink(conn,t.getContext()),
- t instanceof KiWiTriple && ((KiWiTriple)t).isInferred() ? createInfo(((KiWiTriple)t).getId()) : "", t instanceof KiWiTriple && ((KiWiTriple)t).isDeleted());
+ ResourceUtils.isInferred(conn,t) ? createInfo(ResourceUtils.getId(t)) : "", ResourceUtils.isDeleted(conn,t));
}
ps.printf(" </tbody>%n</table>");
} else if (offset > 0) {
@@ -407,7 +403,7 @@ public class InspectionWebService {
ps.printf(
" <tr class='%s'><td>%s</td><td>%s</td><td>%s</td><td><span class='reasoned'>%s</span></td><td><span class='deleted %b'></span></td></tr>%n",
i++ % 2 == 0 ? "even" : "odd", createInspectLink(conn, t.getSubject()), createInspectLink(conn,t.getObject()), createInspectLink(conn,t.getContext()),
- t instanceof KiWiTriple && ((KiWiTriple)t).isInferred() ? createInfo(((KiWiTriple)t).getId()) : "", t instanceof KiWiTriple && ((KiWiTriple)t).isDeleted());
+ ResourceUtils.isInferred(conn,t) ? createInfo(ResourceUtils.getId(t)) : "", ResourceUtils.isDeleted(conn,t));
}
ps.printf(" </tbody>%n</table>");
} else if (offset > 0) {
@@ -439,7 +435,7 @@ public class InspectionWebService {
ps.printf(
" <tr class='%s'><td>%s</td><td>%s</td><td>%s</td><td><span class='reasoned'>%s</span></td><td><span class='deleted %b'></span></td></tr>%n",
i++ % 2 == 0 ? "even" : "odd", createInspectLink(conn, t.getSubject()), createInspectLink(conn,t.getObject()), createInspectLink(conn,t.getContext()),
- t instanceof KiWiTriple && ((KiWiTriple)t).isInferred() ? createInfo(((KiWiTriple)t).getId()) : "", t instanceof KiWiTriple && ((KiWiTriple)t).isDeleted());
+ ResourceUtils.isInferred(conn,t) ? createInfo(ResourceUtils.getId(t)) : "", ResourceUtils.isDeleted(conn,t));
}
ps.printf(" </tbody>%n</table>");
} else if (offset > 0) {
@@ -520,23 +516,5 @@ public class InspectionWebService {
return b.toString();
}
- /**
- * Get the last modification of the set of triples passed as argument.
- *
- * @return
- */
- private Date lastModified(RepositoryConnection conn, Resource resource) throws RepositoryException {
- Date last_modified = new Date(0);
- for (Statement triple : listOutgoing(conn, resource)) {
- if(triple instanceof KiWiTriple) {
- KiWiTriple t = (KiWiTriple)triple;
- if (t.getCreated().getTime() > last_modified.getTime()) {
- last_modified = t.getCreated();
- }
- }
- }
- return last_modified;
-
- }
}
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/8fdc1498/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/webservices/resource/MetaWebService.java
----------------------------------------------------------------------
diff --git a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/webservices/resource/MetaWebService.java b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/webservices/resource/MetaWebService.java
index 30de0f8..9b7cbe4 100644
--- a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/webservices/resource/MetaWebService.java
+++ b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/webservices/resource/MetaWebService.java
@@ -52,7 +52,6 @@ import org.apache.marmotta.platform.core.api.io.MarmottaIOService;
import org.apache.marmotta.platform.core.api.templating.TemplatingService;
import org.apache.marmotta.platform.core.api.triplestore.ContextService;
import org.apache.marmotta.platform.core.api.triplestore.SesameService;
-import org.apache.marmotta.platform.core.services.sesame.KiWiSesameUtil;
import org.apache.marmotta.platform.core.services.sesame.ResourceSubjectMetadata;
import org.openrdf.model.Resource;
import org.openrdf.repository.RepositoryConnection;
@@ -300,7 +299,7 @@ public class MetaWebService {
};
// build response
- Response response = Response.ok(entity).lastModified(KiWiSesameUtil.lastModified(r, conn)).build();
+ Response response = Response.ok(entity).lastModified(ResourceUtils.getLastModified(conn, r)).build();
response.getMetadata().add("ETag", "W/\"" + ETagGenerator.getWeakETag(conn, r) + "\"");
if (!mimetype.contains("html")) { // then create a proper filename
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/8fdc1498/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/webservices/resource/ResourceWebService.java
----------------------------------------------------------------------
diff --git a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/webservices/resource/ResourceWebService.java b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/webservices/resource/ResourceWebService.java
index 3de0d7d..fe3fe5d 100644
--- a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/webservices/resource/ResourceWebService.java
+++ b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/webservices/resource/ResourceWebService.java
@@ -54,7 +54,6 @@ import org.apache.marmotta.platform.core.api.content.ContentService;
import org.apache.marmotta.platform.core.api.io.MarmottaIOService;
import org.apache.marmotta.platform.core.api.templating.TemplatingService;
import org.apache.marmotta.platform.core.api.triplestore.SesameService;
-import org.apache.marmotta.platform.core.services.sesame.KiWiSesameUtil;
import org.openrdf.model.Resource;
import org.openrdf.model.URI;
import org.openrdf.repository.RepositoryConnection;
@@ -411,7 +410,7 @@ public class ResourceWebService {
if(bestType != null) {
Response response = buildGetResponse(r, bestType);
- response.getMetadata().add("Last-Modified", KiWiSesameUtil.lastModified(r, conn));
+ response.getMetadata().add("Last-Modified", ResourceUtils.getLastModified(conn, r));
response.getMetadata().add("ETag", "W/\"" + ETagGenerator.getWeakETag(conn, r) + "\"");
return response;
} else {
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/8fdc1498/platform/marmotta-core/src/test/java/org/apache/marmotta/platform/core/test/base/TestStoreProvider.java
----------------------------------------------------------------------
diff --git a/platform/marmotta-core/src/test/java/org/apache/marmotta/platform/core/test/base/TestStoreProvider.java b/platform/marmotta-core/src/test/java/org/apache/marmotta/platform/core/test/base/TestStoreProvider.java
new file mode 100644
index 0000000..984a3cb
--- /dev/null
+++ b/platform/marmotta-core/src/test/java/org/apache/marmotta/platform/core/test/base/TestStoreProvider.java
@@ -0,0 +1,9 @@
+package org.apache.marmotta.platform.core.test.base;
+
+/**
+ * A triple store provider for tests. Uses a Sesame in-memory store for holding triples.
+ *
+ * @author Sebastian Schaffert (sschaffert@apache.org)
+ */
+public class TestStoreProvider {
+}
[18/30] reorganize platform modules to give more overview over
different backends
Posted by ja...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/47855a4b/platform/backends/marmotta-backend-kiwi/src/main/resources/web/admin/configuration.html
----------------------------------------------------------------------
diff --git a/platform/backends/marmotta-backend-kiwi/src/main/resources/web/admin/configuration.html b/platform/backends/marmotta-backend-kiwi/src/main/resources/web/admin/configuration.html
new file mode 100644
index 0000000..afa5287
--- /dev/null
+++ b/platform/backends/marmotta-backend-kiwi/src/main/resources/web/admin/configuration.html
@@ -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.
+ -->
+<html>
+<head>
+<!--###BEGIN_HEAD###-->
+ <title>Core Module Configuration</title>
+ <link type="text/css" rel="stylesheet" href="../../../../../../../marmotta-core/src/main/resources/web/public/js/widgets/configurator/style.css">
+ <script type="text/javascript" src="../../webjars/jquery/1.8.2/jquery.min.js"></script>
+ <script type="text/javascript" src="js/widgets/database.js"></script>
+ <script type="text/javascript">
+ jQuery(document).ready(function(){
+ $('#lmf_database').lmf_database({host:_SERVER_URL});
+ });
+ </script>
+<!--###END_HEAD###-->
+</head>
+<body>
+<div id="main">
+<div id="contents">
+<!--###BEGIN_CONTENT###-->
+<h1>KiWi Storage Backend Configuration</h1>
+ <p>
+ Here you can configure the database options for the Marmotta KiWi Storage Backend.<br/>
+ </p>
+ <div id="lmf_database">
+ <h4>Loading database manager</h4>
+ </div>
+<!--###END_CONTENT###-->
+</div>
+</div>
+</body>
+</html>
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/47855a4b/platform/backends/marmotta-backend-kiwi/src/main/resources/web/admin/database.html
----------------------------------------------------------------------
diff --git a/platform/backends/marmotta-backend-kiwi/src/main/resources/web/admin/database.html b/platform/backends/marmotta-backend-kiwi/src/main/resources/web/admin/database.html
new file mode 100644
index 0000000..87b6835
--- /dev/null
+++ b/platform/backends/marmotta-backend-kiwi/src/main/resources/web/admin/database.html
@@ -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.
+
+-->
+<html>
+<head>
+ <!--###BEGIN_HEAD###-->
+ <title>Core Module</title>
+ <script type="text/javascript">
+ (function() {
+ window.open('../../database/');
+ })();
+ </script>
+ <!--###END_HEAD###-->
+</head>
+<body>
+<!--###BEGIN_CONTENT###-->
+<h1>Manage Marmotta database via web-interface</h1>
+<a href="../../database/" target="_blank">Open database administration page in new window.</a>
+<!--###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/src/main/resources/web/admin/js/widgets/database.js
----------------------------------------------------------------------
diff --git a/platform/backends/marmotta-backend-kiwi/src/main/resources/web/admin/js/widgets/database.js b/platform/backends/marmotta-backend-kiwi/src/main/resources/web/admin/js/widgets/database.js
new file mode 100644
index 0000000..42efb8e
--- /dev/null
+++ b/platform/backends/marmotta-backend-kiwi/src/main/resources/web/admin/js/widgets/database.js
@@ -0,0 +1,303 @@
+/*
+ * 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.
+ */
+(function( $ ){
+ $.fn.lmf_database = function(options) {
+ var settings = {
+ host: 'http://localhost:8080/LMF/',
+ anker_name: 'database',
+ title: 'Database Configuration',
+ loading_img: '../public/img/loader/ajax-loader_small.gif',
+ toplink:true
+ }
+
+ //jquery elements
+ var table;
+
+ //basically there are 2 functions
+ //1. getValues from server and write it to inputFields
+ //2. storeValues after testing Configuration
+ var functions = {
+ input_fields:undefined,
+ getValues : function(callback) {
+
+ var writeValues = function(databases, values) {
+ table.html("");
+ this.input_fields={};
+
+ //DB Type
+ var tr1 = $("<tr/>");
+ var td11 = $("<td/>").css({"font-weight":"bold"}).text("Database: ");
+ var td12 = $("<td/>");
+ this.input_fields.db_select = $("<select/>").css({'width':'200px'});
+ for (value in databases) {
+ this.input_fields.db_select.append("<option>" + databases[value] + "</option>");
+ }
+ this.input_fields.db_select.val(values["database.type"]);
+ td12.append(this.input_fields.db_select);
+ this.input_fields.l_div = $("<div style='float:right;margin-top: -55px;'></div>");
+ table.parent().append(this.input_fields.l_div);
+ td11.appendTo(tr1);
+ td12.appendTo(tr1);
+ tr1.appendTo(table);
+
+ //DBHost
+ var tr2 = $("<tr/>");
+ var td21 = $("<td/>").css({"font-weight":"bold"}).text("Host: ");
+ var td22 = $("<td/>");
+ this.input_fields.db_host = $("<input type='text' style='width:100%'/>");
+ this.input_fields.db_host.val(values["database.url"]);
+ td22.append(this.input_fields.db_host);
+ td21.appendTo(tr2);
+ td22.appendTo(tr2);
+ tr2.appendTo(table);
+
+ //DBUser
+ var tr3 = $("<tr/>");
+ var td31 = $("<td/>").css({"font-weight":"bold"}).text("User: ");
+ var td32 = $("<td/>");
+ this.input_fields.db_user = $("<input type='text' style='width:100%'/>");
+ this.input_fields.db_user.val(values["database.user"]);
+ td32.append(this.input_fields.db_user);
+ td31.appendTo(tr3);
+ td32.appendTo(tr3);
+ tr3.appendTo(table);
+
+ //DB password
+ var tr4 = $("<tr/>");
+ var td41 = $("<td/>").css({"font-weight":"bold"}).text("Password: ");
+ var td42 = $("<td/>");
+ this.input_fields.db_pass = $("<input type='password' style='width:100%'/>");
+ this.input_fields.db_pass.val(values["database.password"]);
+ td42.append(this.input_fields.db_pass);
+ td41.appendTo(tr4);
+ td42.appendTo(tr4);
+ tr4.appendTo(table);
+
+ this.input_fields.db_select.change(function() {
+ getUrlValue();
+ });
+
+ if (callback) callback();
+ };
+
+ var getDatabases = function() {
+ //get prefixes
+ var url = settings.host+"config/list?prefix=database";
+ var that = this;
+ $.getJSON(url,function(data) {
+ var values = [];
+ var databases = new Array();
+ for(var property in data) {
+ property = property.substring(property.indexOf('.')+1);
+ property = property.substring(0,property.indexOf('.'));
+ if(property!="") {
+ if($.inArray(property,databases)==-1) {
+ databases.push(property);
+ }
+ }
+ }
+ getDBType(databases,new Array());
+ });
+ };
+
+ var getDBType = function(databases,values) {
+ var cid = "database.type";
+ var url = settings.host+"config/data/"+cid;
+ $.getJSON(url,function(data) {
+ values[cid] = data[cid];
+ getDBHost(databases,values);
+ });
+ };
+
+ var getDBHost = function(databases,values) {
+ var cid = "database.url";
+ var url = settings.host+"config/data/"+cid;
+ $.getJSON(url,function(data) {
+ values[cid] = data[cid];
+ getDBUser(databases,values);
+ });
+ };
+
+ var getDBUser = function(databases,values) {
+ var cid = "database.user";
+ var url = settings.host+"config/data/"+cid;
+ $.getJSON(url,function(data) {
+ values[cid] = data[cid];
+ getDBPass(databases,values);
+ });
+ };
+
+ var getDBPass = function(databases,values) {
+ var cid = "database.password";
+ var url = settings.host+"config/data/"+cid;
+ $.getJSON(url,function(data) {
+ values[cid] = data[cid];
+ writeValues(databases,values);
+ });
+
+ };
+ getDatabases();
+
+ //helper
+ function getUrlValue() {
+ var that = this;
+ $.getJSON(settings.host+"config/data/"+"database."+this.input_fields.db_select.val()+".url",function(data){
+ that.input_fields.db_host.val(data["database."+that.input_fields.db_select.val()+".url"]);
+ })
+ }
+ },
+
+ ping:function() {
+ var that = this;
+ var dburl = input_fields.db_host.val();
+ if (input_fields.db_host.val().indexOf(";") > 0) {
+ dburl = input_fields.db_host.val().substring(0, input_fields.db_host.val().indexOf(";"));
+ }
+ var url = settings.host + "storage-kiwi/ping?type=" + input_fields.db_select.val() + "&url=" + dburl + "&user=" + input_fields.db_user.val() + "&pwd=" + input_fields.db_pass.val();
+ $.ajax({
+ type:"POST",
+ url: url,
+ success: function() {
+ if(confirm("Configuration Test successfully! Save values?")){
+ that.saveValues();
+ }
+ },
+ error: function(jqXHR, statusText, errorThrown) {
+ alert(errorThrown + "(" + jqXHR.status + "):\n"+jqXHR.responseText)
+ }
+ });
+ },
+
+ saveValues: function(callback) {
+
+ var saveDatabase = function() {
+ $.ajax({
+ type:"POST",
+ contentType: "application/json",
+ url: settings.host + "config/data/database.type",
+ data: '["' + input_fields.db_select.val() + '"]',
+ success: function() {
+ saveUrl();
+ },
+ error: function(jqXHR, statusText, errorThrown) {
+ that.input_fields.l_div.html("");
+ alert("Error: " + errorThrown + "(" + jqXHR.status + ")" + jqXHR.responseText);
+ }
+ });
+ }
+
+ function saveUrl() {
+ $.ajax({
+ type:"POST",
+ contentType: "application/json",
+ url: settings.host + "config/data/database.url",
+ data: '["' + input_fields.db_host.val() + '"]',
+ success: function() {
+ saveUser();
+ },
+ error: function(jqXHR, statusText, errorThrown) {
+ that.input_fields.l_div.html("");
+ alert("Error: " + errorThrown + "(" + jqXHR.status + ")" + jqXHR.responseText);
+ }
+ });
+ }
+
+ function saveUser() {
+ $.ajax({
+ type:"POST",
+ contentType: "application/json",
+ url: settings.host + "config/data/database.user",
+ data: '["' + input_fields.db_user.val() + '"]',
+ success: function() {
+ savePwd();
+ },
+ error: function(jqXHR, statusText, errorThrown) {
+ that.input_fields.l_div.html("");
+ alert("Error: " + errorThrown + "(" + jqXHR.status + ")" + jqXHR.responseText);
+ }
+ });
+ }
+
+ function savePwd() {
+ $.ajax({
+ type:"POST",
+ contentType: "application/json",
+ url: settings.host + "config/data/database.password",
+ data: '["' + input_fields.db_pass.val() + '"]',
+ success: function() {
+ reinit();
+ },
+ error: function(jqXHR, statusText, errorThrown) {
+ that.input_fields.l_div.html("");
+ alert("Error: " + errorThrown + "(" + jqXHR.status + ")" + jqXHR.responseText);
+ }
+ });
+ }
+
+ function reinit() {
+ var that = this;
+ input_fields.l_div.html("<span>Reinitialize Database </span><img src='" + settings.loading_img + "'/>");
+ $.ajax({
+ type:"POST",
+ url: settings.host + "system/database/reinit",
+ success: function() {
+ that.input_fields.l_div.html("");
+ alert("Successfully reloaded!")
+ },
+ error: function(jqXHR, statusText, errorThrown) {
+ that.input_fields.l_div.html("");
+ alert("Error: " + errorThrown + "(" + jqXHR.status + ")" + jqXHR.responseText);
+ }
+ });
+ }
+ saveDatabase();
+ }
+ }
+
+ /**
+ * main method
+ */
+ return this.each(function() {
+ // merge options
+ if ( options ) {
+ $.extend( settings, options );
+ }
+ //build skeleton
+
+ //get Values
+ functions.getValues();
+ var top="";
+ if(settings.toplink)top='<a href="#" target="_top" style="position:absolute;right:5px;font-size:12px;top:7px;text-decoration:none;">top</a>';
+ //build basic view elements
+ var title = $("<h2 style='position:relative;margin-bottom:10px'><a style='text-decoration:none' name='"+settings.anker_name+"'>"+settings.title+"</a><span style='margin-left:10px;display:none;' class='tiny_text,lmf_configurator_loader'><img src='"+settings.loading_img+"' alt='loading...'></span>"+top+"</h2>");
+ table = $("<table style='margin:0px auto;background-color:#eeeeee;padding:20px;border:1px solid gray;-webkit-border-radius: 3px;border-radius: 3px;'></table>");
+ var buttons = $("<div style='width:100%;text-align:center;padding-top:10px;margin-bottom:30px;'></div>");
+ var b1 = $("<button>Reload</button>").click(function(){if(confirm("Discard all changes?"))functions.getValues()});
+ var b3 = $("<button style='margin-left:10px;'>Test Configuration</button>").click(function(){functions.ping()});
+ buttons.append(b1);
+ buttons.append(b3);
+
+ //append elements
+ $(this).html("");
+ $(this).append(title);
+ $(this).append(table);
+ $(this).append(buttons);
+ });
+ };
+})( jQuery );
+
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/47855a4b/platform/backends/marmotta-backend-memory/pom.xml
----------------------------------------------------------------------
diff --git a/platform/backends/marmotta-backend-memory/pom.xml b/platform/backends/marmotta-backend-memory/pom.xml
new file mode 100644
index 0000000..126b643
--- /dev/null
+++ b/platform/backends/marmotta-backend-memory/pom.xml
@@ -0,0 +1,154 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<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-memory</artifactId>
+
+ <name>Apache Marmotta Platform: Sesame Memory Backend</name>
+ <description>
+ This module provides an Apache Marmotta backend using a Sesame Memory Store. This backend is suitable for
+ testing purposes only as it does not allow persisting data.
+ </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-transactions</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.openrdf.sesame</groupId>
+ <artifactId>sesame-sail-memory</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-memory/src/main/java/org/apache/marmotta/platform/backend/memory/MemoryStoreProvider.java
----------------------------------------------------------------------
diff --git a/platform/backends/marmotta-backend-memory/src/main/java/org/apache/marmotta/platform/backend/memory/MemoryStoreProvider.java b/platform/backends/marmotta-backend-memory/src/main/java/org/apache/marmotta/platform/backend/memory/MemoryStoreProvider.java
new file mode 100644
index 0000000..c251573
--- /dev/null
+++ b/platform/backends/marmotta-backend-memory/src/main/java/org/apache/marmotta/platform/backend/memory/MemoryStoreProvider.java
@@ -0,0 +1,83 @@
+/*
+ * 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.memory;
+
+import org.apache.marmotta.platform.core.api.triplestore.StoreProvider;
+import org.openrdf.repository.sail.SailRepository;
+import org.openrdf.sail.NotifyingSail;
+import org.openrdf.sail.Sail;
+import org.openrdf.sail.memory.MemoryStore;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import javax.enterprise.context.ApplicationScoped;
+
+/**
+ * A triple store provider for tests. Uses a Sesame in-memory store for holding triples.
+ *
+ * @author Sebastian Schaffert (sschaffert@apache.org)
+ */
+@ApplicationScoped
+public class MemoryStoreProvider implements StoreProvider {
+
+ private static Logger log = LoggerFactory.getLogger(MemoryStoreProvider.class);
+
+
+ /**
+ * 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) {
+ log.warn("using in-memory triple store - no persistence");
+ return new SailRepository(sail);
+ }
+
+ /**
+ * Create the store provided by this SailProvider
+ *
+ * @return a new instance of the store
+ */
+ @Override
+ public NotifyingSail createStore() {
+ return new MemoryStore();
+ }
+
+ /**
+ * Return the name of the provider. Used e.g. for displaying status information or logging.
+ *
+ * @return
+ */
+ @Override
+ public String getName() {
+ return "Memory 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-memory/src/main/resources/META-INF/beans.xml
----------------------------------------------------------------------
diff --git a/platform/backends/marmotta-backend-memory/src/main/resources/META-INF/beans.xml b/platform/backends/marmotta-backend-memory/src/main/resources/META-INF/beans.xml
new file mode 100644
index 0000000..461858e
--- /dev/null
+++ b/platform/backends/marmotta-backend-memory/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-memory/src/main/resources/kiwi-module.properties
----------------------------------------------------------------------
diff --git a/platform/backends/marmotta-backend-memory/src/main/resources/kiwi-module.properties b/platform/backends/marmotta-backend-memory/src/main/resources/kiwi-module.properties
new file mode 100644
index 0000000..95b3330
--- /dev/null
+++ b/platform/backends/marmotta-backend-memory/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: Memory
+
+container=Generic
+container.weight = 10
+
+subtitle = Configure Memory Backend
+weight = 10
+
+icon_small = /admin/img/config_small.png
+
+#do not change!!!
+baseurl=/storage-native
+
+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-native/pom.xml
----------------------------------------------------------------------
diff --git a/platform/backends/marmotta-backend-native/pom.xml b/platform/backends/marmotta-backend-native/pom.xml
new file mode 100644
index 0000000..2021834
--- /dev/null
+++ b/platform/backends/marmotta-backend-native/pom.xml
@@ -0,0 +1,170 @@
+<?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-native</artifactId>
+
+ <name>Apache Marmotta Platform: Sesame Native Backend</name>
+ <description>
+ This module provides an Apache Marmotta backend using a Sesame Native Store. This is a suitable backend in
+ case no database is available or no advanced features like rule-based reasoning or versioning are required.
+ </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-transactions</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.openrdf.sesame</groupId>
+ <artifactId>sesame-sail-nativerdf</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-native/src/main/java/org/apache/marmotta/platform/backend/sesame/NativeStoreProvider.java
----------------------------------------------------------------------
diff --git a/platform/backends/marmotta-backend-native/src/main/java/org/apache/marmotta/platform/backend/sesame/NativeStoreProvider.java b/platform/backends/marmotta-backend-native/src/main/java/org/apache/marmotta/platform/backend/sesame/NativeStoreProvider.java
new file mode 100644
index 0000000..5aea749
--- /dev/null
+++ b/platform/backends/marmotta-backend-native/src/main/java/org/apache/marmotta/platform/backend/sesame/NativeStoreProvider.java
@@ -0,0 +1,94 @@
+/*
+ * 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.sesame;
+
+import org.apache.marmotta.platform.core.api.config.ConfigurationService;
+import org.apache.marmotta.platform.core.api.triplestore.StoreProvider;
+import org.openrdf.repository.sail.SailRepository;
+import org.openrdf.sail.NotifyingSail;
+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;
+
+/**
+ * A store implementation using a Sesame NativeStore as backend for Marmotta. The triples are stored in the
+ * Marmotta home directory in the subdirectory "triples".
+ *
+ * @author Sebastian Schaffert (sschaffert@apache.org)
+ */
+@ApplicationScoped
+public class NativeStoreProvider implements StoreProvider {
+
+ @Inject
+ private Logger log;
+
+ @Inject
+ private ConfigurationService configurationService;
+
+
+
+ /**
+ * Create the store provided by this SailProvider
+ *
+ * @return a new instance of the store
+ */
+ @Override
+ public NotifyingSail createStore() {
+ log.info("Initializing Backend: Native Store");
+
+ File dataDir = new File(configurationService.getHome() + File.separator + "triples");
+ return new NativeStore(dataDir);
+ }
+
+ /**
+ * 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 "Native 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-native/src/main/resources/META-INF/beans.xml
----------------------------------------------------------------------
diff --git a/platform/backends/marmotta-backend-native/src/main/resources/META-INF/beans.xml b/platform/backends/marmotta-backend-native/src/main/resources/META-INF/beans.xml
new file mode 100644
index 0000000..461858e
--- /dev/null
+++ b/platform/backends/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/47855a4b/platform/backends/marmotta-backend-native/src/main/resources/kiwi-module.properties
----------------------------------------------------------------------
diff --git a/platform/backends/marmotta-backend-native/src/main/resources/kiwi-module.properties b/platform/backends/marmotta-backend-native/src/main/resources/kiwi-module.properties
new file mode 100644
index 0000000..5a94c6e
--- /dev/null
+++ b/platform/backends/marmotta-backend-native/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: Native
+
+container=Generic
+container.weight = 10
+
+subtitle = Configure Native Backend
+weight = 10
+
+icon_small = /admin/img/config_small.png
+
+#do not change!!!
+baseurl=/storage-native
+
+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/pom.xml
----------------------------------------------------------------------
diff --git a/platform/backends/pom.xml b/platform/backends/pom.xml
new file mode 100644
index 0000000..62303f0
--- /dev/null
+++ b/platform/backends/pom.xml
@@ -0,0 +1,72 @@
+<?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>platform-backends-reactor</artifactId>
+ <packaging>pom</packaging>
+
+ <name>Apache Marmotta Backends: Reactor</name>
+ <description>Different triple store backends for the Apache Marmotta Platform</description>
+
+
+ <!-- release management -->
+ <build>
+ <plugins>
+ <!-- do not install / deploy reactor -->
+ <plugin>
+ <artifactId>maven-deploy-plugin</artifactId>
+ <configuration>
+ <skip>true</skip>
+ </configuration>
+ </plugin>
+ <plugin>
+ <artifactId>maven-install-plugin</artifactId>
+ <configuration>
+ <skip>true</skip>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+ <modules>
+ <!-- alternative backend implementations, only include exactly one in your classpath -->
+ <module>marmotta-backend-kiwi</module>
+ <module>marmotta-backend-native</module>
+ <module>marmotta-backend-memory</module>
+ </modules>
+
+
+ <profiles>
+ <!-- non-free backends and modules -->
+ <profile>
+ <id>non-free</id>
+ <modules>
+ <module>marmotta-backend-bigdata</module>
+ </modules>
+ </profile>
+ </profiles>
+
+</project>
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/47855a4b/platform/ldcache/marmotta-ldcache-common/pom.xml
----------------------------------------------------------------------
diff --git a/platform/ldcache/marmotta-ldcache-common/pom.xml b/platform/ldcache/marmotta-ldcache-common/pom.xml
new file mode 100644
index 0000000..9af8e41
--- /dev/null
+++ b/platform/ldcache/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)</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/47855a4b/platform/ldcache/marmotta-ldcache-common/src/main/java/org/apache/marmotta/platform/ldcache/api/endpoint/LinkedDataEndpointService.java
----------------------------------------------------------------------
diff --git a/platform/ldcache/marmotta-ldcache-common/src/main/java/org/apache/marmotta/platform/ldcache/api/endpoint/LinkedDataEndpointService.java b/platform/ldcache/marmotta-ldcache-common/src/main/java/org/apache/marmotta/platform/ldcache/api/endpoint/LinkedDataEndpointService.java
new file mode 100644
index 0000000..b6bd8cd
--- /dev/null
+++ b/platform/ldcache/marmotta-ldcache-common/src/main/java/org/apache/marmotta/platform/ldcache/api/endpoint/LinkedDataEndpointService.java
@@ -0,0 +1,87 @@
+/**
+ * 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.ldcache.api.endpoint;
+
+import org.apache.marmotta.ldclient.api.endpoint.Endpoint;
+import org.openrdf.model.URI;
+
+import java.util.List;
+
+/**
+ * A service for managing Linked Data endpoints.
+ * <p/>
+ * User: sschaffe
+ */
+public interface LinkedDataEndpointService {
+
+ /**
+ * Add a new endpoint to the system. The endpoint will be persisted in the database.
+ *
+ * @param endpoint
+ */
+ public void addEndpoint(Endpoint endpoint);
+
+ /**`
+ * Update the endpoint passed as argument in the database.
+ *
+ * @param endpoint
+ */
+ public void updateEndpoint(Endpoint endpoint);
+
+ /**
+ * List all endpoints registered in the system.
+ *
+ * @return a list of endpoints in the order they were added to the database.
+ */
+ public List<Endpoint> listEndpoints();
+
+ /**
+ * Remove the endpoint given as argument. The endpoint will be deleted in the database.
+ *
+ * @param endpoint
+ */
+ public void removeEndpoint(Endpoint endpoint);
+
+ /**
+ * Return the endpoint with the given ID.
+ *
+ * @param id ID of the endpoint to return.
+ * @return
+ */
+ public Endpoint getEndpoint(String id);
+
+
+
+ /**
+ * Retrieve the endpoint matching the KiWiUriResource passed as argument. The endpoint is determined by
+ * matching the endpoint's URI prefix with the resource URI. If no matching endpoint exists, returns null.
+ * The LinkedDataClientService can then decide (based on configuration) whether to try with a standard
+ * LinkedDataRequest or ignore the request.
+ *
+ * @param resource the KiWiUriResource to check.
+ */
+ public Endpoint getEndpoint(URI resource);
+
+ /**
+ * Test whether an endpoint definition for the given url pattern already exists.
+ *
+ * @param urlPattern
+ * @return
+ */
+ public boolean hasEndpoint(String urlPattern);
+}
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/47855a4b/platform/ldcache/marmotta-ldcache-common/src/main/java/org/apache/marmotta/platform/ldcache/api/ldcache/LDCacheSailProvider.java
----------------------------------------------------------------------
diff --git a/platform/ldcache/marmotta-ldcache-common/src/main/java/org/apache/marmotta/platform/ldcache/api/ldcache/LDCacheSailProvider.java b/platform/ldcache/marmotta-ldcache-common/src/main/java/org/apache/marmotta/platform/ldcache/api/ldcache/LDCacheSailProvider.java
new file mode 100644
index 0000000..2cc597d
--- /dev/null
+++ b/platform/ldcache/marmotta-ldcache-common/src/main/java/org/apache/marmotta/platform/ldcache/api/ldcache/LDCacheSailProvider.java
@@ -0,0 +1,191 @@
+/*
+ * 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.ldcache.api.ldcache;
+
+import org.apache.marmotta.ldcache.services.LDCache;
+import org.apache.marmotta.ldclient.api.endpoint.Endpoint;
+import org.apache.marmotta.ldclient.api.ldclient.LDClientService;
+import org.apache.marmotta.ldclient.model.ClientConfiguration;
+import org.apache.marmotta.platform.core.api.config.ConfigurationService;
+import org.apache.marmotta.platform.core.api.http.HttpClientService;
+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.apache.marmotta.platform.ldcache.api.endpoint.LinkedDataEndpointService;
+import org.apache.marmotta.platform.ldcache.model.filter.LDCacheIgnoreFilter;
+import org.openrdf.model.URI;
+import org.openrdf.repository.RepositoryException;
+import org.slf4j.Logger;
+
+import javax.annotation.PostConstruct;
+import javax.enterprise.event.Observes;
+import javax.enterprise.inject.Instance;
+import javax.inject.Inject;
+import java.util.HashSet;
+import java.util.Set;
+
+/**
+ * A sail provider service that allows wrapping a transparent Linked Data caching component around the
+ * main SAIL. This is the generic superclass for all LDCache backends.
+ *
+ * <p/>
+ * Author: Sebastian Schaffert (sschaffert@apache.org)
+ */
+public abstract class LDCacheSailProvider implements NotifyingSailProvider {
+
+
+ public static final String LDCACHE_ENABLED = "ldcache.enabled";
+
+ @Inject
+ protected ConfigurationService configurationService;
+
+ @Inject
+ protected Instance<LDCacheIgnoreFilter> ignoreFilters;
+
+ protected ClientConfiguration ldclientConfig;
+
+ @Inject
+ private Logger log;
+
+ @Inject
+ private LinkedDataEndpointService endpointService;
+
+ @Inject
+ private SesameService sesameService;
+
+ @Inject
+ private HttpClientService httpClientService;
+
+ private Set<Endpoint> volatileEndpoints;
+
+ /**
+ * Return true in case the URI resource passed as argument is cached.
+ * @param resource
+ * @return
+ */
+ public boolean isCached(URI resource) throws RepositoryException {
+ return getLDCache().isCached(resource.stringValue());
+ }
+
+ /**
+ * Clear the currently configured Linked Data Sail.
+ */
+ public abstract void clearSail();
+
+ /**
+ * Return true if this sail provider is enabled in the configuration.
+ *
+ * @return
+ */
+ @Override
+ public boolean isEnabled() {
+ return configurationService.getBooleanConfiguration(LDCACHE_ENABLED,true);
+ }
+
+ public void configurationChanged(@Observes ConfigurationChangedEvent e) {
+ if(e.containsChangedKey(LDCACHE_ENABLED)) {
+ sesameService.restart();
+
+ if(!isEnabled()) {
+ clearSail();
+ }
+ }
+ }
+
+ @PostConstruct
+ public void initialize() {
+ volatileEndpoints = new HashSet<Endpoint>();
+ ldclientConfig = new ClientConfiguration();
+ updateConfig();
+ }
+
+ public void updateEndpoints() {
+ HashSet<Endpoint> endpoints = new HashSet<Endpoint>();
+ endpoints.addAll(endpointService.listEndpoints());
+ endpoints.addAll(volatileEndpoints);
+
+ ldclientConfig.setEndpoints(endpoints);
+
+ if(getLDCache() != null) {
+ getLDCache().reload();
+ }
+ }
+
+ public void updateConfig() {
+ ldclientConfig.setDefaultExpiry(configurationService.getLongConfiguration("ldcache.expiry", 86400L));
+ ldclientConfig.setMinimumExpiry(configurationService.getLongConfiguration("ldcache.minexpiry", 3600L));
+ ldclientConfig.setSocketTimeout(configurationService.getIntConfiguration("ldcache.so_timeout", 60000));
+ ldclientConfig.setConnectionTimeout(configurationService.getIntConfiguration("ldcache.connection_timeout", 10000));
+ ldclientConfig.setMaxParallelRequests(configurationService.getIntConfiguration("ldcache.max_parallel_requests",10));
+
+ HashSet<Endpoint> endpoints = new HashSet<Endpoint>();
+ endpoints.addAll(endpointService.listEndpoints());
+ endpoints.addAll(volatileEndpoints);
+ ldclientConfig.setEndpoints(endpoints);
+
+ ldclientConfig.setHttpClient(httpClientService.getHttpClient());
+
+ if(getLDCache() != null) {
+ getLDCache().reload();
+ }
+ }
+
+ /**
+ * Return the Linked Data Client used by the caching system (e.g. for debugging).
+ * @return
+ */
+ public abstract LDClientService getLDClient();
+
+ /**
+ * Return the caching backend used by the caching system (e.g. for debugging)
+ * @return
+ */
+ public abstract LDCache getLDCache();
+
+ /**
+ * Add a volatile (in-memory) endpoint to the LDClient configuration. Can be used by other services for auto-registering
+ * LDClient endpoints for special endpoints.
+ *
+ * @param endpoint
+ */
+ public void addVolatileEndpoint(Endpoint endpoint) {
+ if(!volatileEndpoints.contains(endpoint)) {
+ volatileEndpoints.add(endpoint);
+ updateEndpoints();
+ }
+ }
+
+ /**
+ * Remove a volatile (in-memory) endpoint from the LDClient configuration.
+ * @param endpoint
+ */
+ public void removeVolatileEndpoint(Endpoint endpoint) {
+ if(volatileEndpoints.contains(endpoint)) {
+ volatileEndpoints.remove(endpoint);
+ updateEndpoints();
+ }
+ }
+
+ /**
+ * Return all configured volatile endpoints.
+ * @return
+ */
+ public Set<Endpoint> getVolatileEndpoints() {
+ return new HashSet<Endpoint>(volatileEndpoints);
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/47855a4b/platform/ldcache/marmotta-ldcache-common/src/main/java/org/apache/marmotta/platform/ldcache/model/filter/LDCacheIgnoreFilter.java
----------------------------------------------------------------------
diff --git a/platform/ldcache/marmotta-ldcache-common/src/main/java/org/apache/marmotta/platform/ldcache/model/filter/LDCacheIgnoreFilter.java b/platform/ldcache/marmotta-ldcache-common/src/main/java/org/apache/marmotta/platform/ldcache/model/filter/LDCacheIgnoreFilter.java
new file mode 100644
index 0000000..9e3614f
--- /dev/null
+++ b/platform/ldcache/marmotta-ldcache-common/src/main/java/org/apache/marmotta/platform/ldcache/model/filter/LDCacheIgnoreFilter.java
@@ -0,0 +1,32 @@
+/*
+ * 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.ldcache.model.filter;
+
+import org.apache.marmotta.commons.sesame.filter.resource.ResourceFilter;
+
+/**
+ * This filter can be used to define as CDI services additional filters that allow to ignore resources when
+ * caching. The advantage of this approach over "blacklisting" is that filters defined in this way do not even
+ * create a cache entry, they ignore the resource early on.
+ *
+ * The filter should return true in case the resource should be ignored.
+ *
+ * @author Sebastian Schaffert (sschaffert@apache.org)
+ */
+public interface LDCacheIgnoreFilter extends ResourceFilter {
+}
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/47855a4b/platform/ldcache/marmotta-ldcache-common/src/main/java/org/apache/marmotta/platform/ldcache/model/filter/MarmottaNotCachedFilter.java
----------------------------------------------------------------------
diff --git a/platform/ldcache/marmotta-ldcache-common/src/main/java/org/apache/marmotta/platform/ldcache/model/filter/MarmottaNotCachedFilter.java b/platform/ldcache/marmotta-ldcache-common/src/main/java/org/apache/marmotta/platform/ldcache/model/filter/MarmottaNotCachedFilter.java
new file mode 100644
index 0000000..5c40815
--- /dev/null
+++ b/platform/ldcache/marmotta-ldcache-common/src/main/java/org/apache/marmotta/platform/ldcache/model/filter/MarmottaNotCachedFilter.java
@@ -0,0 +1,85 @@
+/**
+ * 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.ldcache.model.filter;
+
+import org.apache.marmotta.commons.sesame.filter.resource.ResourceFilter;
+import org.apache.marmotta.platform.core.model.filter.MarmottaLocalFilter;
+import org.apache.marmotta.platform.core.util.CDIContext;
+import org.apache.marmotta.platform.ldcache.api.ldcache.LDCacheSailProvider;
+import org.openrdf.model.BNode;
+import org.openrdf.model.Resource;
+import org.openrdf.model.URI;
+import org.openrdf.repository.RepositoryException;
+
+/**
+ * Accept only resources that are considered "not cached", i.e. do not have an entry in the caching table.
+ * <p/>
+ * Author: Sebastian Schaffert
+ */
+public class MarmottaNotCachedFilter implements ResourceFilter {
+
+ private LDCacheSailProvider cacheSailProvider;
+ private MarmottaLocalFilter marmottaLocalFilter;
+
+ public MarmottaNotCachedFilter() {
+ cacheSailProvider = CDIContext.getInstance(LDCacheSailProvider.class);
+ marmottaLocalFilter = CDIContext.getInstance(MarmottaLocalFilter.class);
+ }
+
+
+ private static MarmottaNotCachedFilter instance = null;
+
+ public static MarmottaNotCachedFilter getInstance() {
+ if(instance == null) {
+ instance = new MarmottaNotCachedFilter();
+ }
+ return instance;
+ }
+
+
+ /**
+ * Return false in case the filter does not accept the resource passed as argument, true otherwise.
+ *
+ *
+ * @param resource
+ * @return
+ */
+ @Override
+ public boolean accept(Resource resource) {
+ if(resource instanceof BNode) {
+ return true;
+ }
+ if(!cacheSailProvider.isEnabled()) {
+ return true;
+ }
+
+ if(marmottaLocalFilter.accept(resource)) {
+ return true;
+ }
+
+ URI uri = (URI)resource;
+
+ try {
+ return !cacheSailProvider.getLDCache().isCached(uri.stringValue());
+ } catch (RepositoryException e) {
+ return false;
+ }
+
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/47855a4b/platform/ldcache/marmotta-ldcache-common/src/main/java/org/apache/marmotta/platform/ldcache/services/endpoint/LinkedDataEndpointServiceImpl.java
----------------------------------------------------------------------
diff --git a/platform/ldcache/marmotta-ldcache-common/src/main/java/org/apache/marmotta/platform/ldcache/services/endpoint/LinkedDataEndpointServiceImpl.java b/platform/ldcache/marmotta-ldcache-common/src/main/java/org/apache/marmotta/platform/ldcache/services/endpoint/LinkedDataEndpointServiceImpl.java
new file mode 100644
index 0000000..2a0dac4
--- /dev/null
+++ b/platform/ldcache/marmotta-ldcache-common/src/main/java/org/apache/marmotta/platform/ldcache/services/endpoint/LinkedDataEndpointServiceImpl.java
@@ -0,0 +1,207 @@
+/**
+ * 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.ldcache.services.endpoint;
+
+import com.google.common.base.Joiner;
+import org.apache.marmotta.commons.http.ContentType;
+import org.apache.marmotta.commons.http.MarmottaHttpUtils;
+import org.apache.marmotta.ldclient.api.endpoint.Endpoint;
+import org.apache.marmotta.platform.core.api.config.ConfigurationService;
+import org.apache.marmotta.platform.ldcache.api.endpoint.LinkedDataEndpointService;
+import org.openrdf.model.URI;
+import org.slf4j.Logger;
+
+import javax.annotation.PostConstruct;
+import javax.enterprise.context.ApplicationScoped;
+import javax.inject.Inject;
+import java.util.*;
+
+/**
+ * Add file description here!
+ * <p/>
+ * User: sschaffe
+ */
+@ApplicationScoped
+public class LinkedDataEndpointServiceImpl implements LinkedDataEndpointService {
+
+ @Inject
+ private Logger log;
+
+
+ @Inject
+ private ConfigurationService configurationService;
+
+
+ private static Endpoint[] blacklist = new Endpoint[] {
+ new Endpoint("HolyGoat", "NONE","^http://www\\.holygoat\\.co\\.uk","","",86400l),
+ new Endpoint("KiWi Project","NONE","^http://www\\.kiwi-project\\.eu/","","",86400l)
+ };
+
+ @PostConstruct
+ public void initialize() {
+ log.trace("LDEndpointService starting up...");
+ }
+
+
+ /**
+ * Add a new endpoint to the system. The endpoint will be persisted in the database.
+ *
+ * @param endpoint
+ */
+ @Override
+ public void addEndpoint(Endpoint endpoint) {
+ storeEndpoint(endpoint);
+ }
+
+ /**
+ * `
+ * Update the endpoint passed as argument in the database.
+ *
+ * @param endpoint
+ */
+ @Override
+ public void updateEndpoint(Endpoint endpoint) {
+ storeEndpoint(endpoint);
+ }
+
+ /**
+ * List all endpoints registered in the system.
+ *
+ * @return a list of endpoints in the order they were added to the database.
+ */
+ @Override
+ public List<Endpoint> listEndpoints() {
+ List<Endpoint> result = new ArrayList<Endpoint>();
+ for(String label : listEndpointLabels()) {
+ result.add(getEndpointByLabel(label));
+ }
+ for(Endpoint e : blacklist) {
+ if(!result.contains(e)) {
+ result.add(e);
+ }
+ }
+ return result;
+ }
+
+ /**
+ * Remove the endpoint given as argument. The endpoint will be deleted in the database.
+ *
+ * @param endpoint
+ */
+ @Override
+ public void removeEndpoint(Endpoint endpoint) {
+ String label = endpoint.getName().replaceAll("[^A-Za-z0-9 ]", "").toLowerCase();
+
+ List<String> keys = configurationService.listConfigurationKeys("ldcache.endpoint."+label);
+ for(String key : keys) {
+ configurationService.removeConfiguration(key);
+ }
+ }
+
+ /**
+ * Return the endpoint with the given ID.
+ *
+ * @param id ID of the endpoint to return.
+ * @return
+ */
+ @Override
+ public Endpoint getEndpoint(String id) {
+ for(Endpoint endpoint : listEndpoints()) {
+ if(endpoint.getName().replaceAll("[^A-Za-z0-9 ]", "").toLowerCase().equals(id)) return endpoint;
+ }
+ return null;
+ }
+
+ /**
+ * Retrieve the endpoint matching the KiWiUriResource passed as argument. The endpoint is determined by
+ * matching the endpoint's URI prefix with the resource URI. If no matching endpoint exists, returns null.
+ * The LinkedDataClientService can then decide (based on configuration) whether to try with a standard
+ * LinkedDataRequest or ignore the request.
+ *
+ * @param resource the KiWiUriResource to check.
+ */
+ @Override
+ public Endpoint getEndpoint(URI resource) {
+ for(Endpoint endpoint : listEndpoints()) {
+ if (endpoint.handles(resource.stringValue())) return endpoint;
+ }
+
+ return null;
+ }
+
+ /**
+ * Test whether an endpoint definition for the given url pattern already exists.
+ *
+ * @param urlPattern
+ * @return
+ */
+ @Override
+ public boolean hasEndpoint(String urlPattern) {
+ for(Endpoint endpoint : listEndpoints()) {
+ if(endpoint.getUriPattern() != null && endpoint.getUriPattern().equals(urlPattern)) return true;
+ }
+ return false;
+ }
+
+
+ private void storeEndpoint(Endpoint endpoint) {
+
+ String label = endpoint.getName().replaceAll("[^A-Za-z0-9 ]", "").toLowerCase();
+ configurationService.setConfiguration("ldcache.endpoint."+label+".name", endpoint.getName());
+ configurationService.setIntConfiguration("ldcache.endpoint." + label + ".prio", endpoint.getPriority());
+ configurationService.setConfiguration("ldcache.endpoint." + label + ".provider", endpoint.getType());
+ configurationService.setConfiguration("ldcache.endpoint." + label + ".pattern", endpoint.getUriPattern());
+ configurationService.setConfiguration("ldcache.endpoint." + label + ".service", endpoint.getEndpointUrl());
+ configurationService.setLongConfiguration("ldcache.endpoint." + label + ".expiry", endpoint.getDefaultExpiry());
+ configurationService.setBooleanConfiguration("ldcache.endpoint." + label + ".active", endpoint.isActive());
+ configurationService.setConfiguration(
+ "ldcache.endpoint." + label + ".contenttype",
+ Joiner.on(",").join(endpoint.getContentTypes())
+ );
+ }
+
+
+ private Endpoint getEndpointByLabel(String label) {
+ Endpoint endpoint = new Endpoint();
+
+ endpoint.setName(configurationService.getStringConfiguration("ldcache.endpoint."+label+".name"));
+ endpoint.setPriority(configurationService.getIntConfiguration("ldcache.endpoint." + label + ".prio"));
+ endpoint.setType(configurationService.getStringConfiguration("ldcache.endpoint." + label + ".provider"));
+ endpoint.setUriPattern(configurationService.getStringConfiguration("ldcache.endpoint." + label + ".pattern"));
+ endpoint.setEndpointUrl(configurationService.getStringConfiguration("ldcache.endpoint." + label + ".service"));
+ endpoint.setDefaultExpiry(configurationService.getLongConfiguration("ldcache.endpoint." + label + ".expiry"));
+ endpoint.setActive(configurationService.getBooleanConfiguration("ldcache.endpoint." + label + ".active"));
+ endpoint.setContentTypes(new HashSet<ContentType>(
+ MarmottaHttpUtils.parseAcceptHeader(
+ configurationService.getStringConfiguration("ldcache.endpoint." + label + ".contenttype",""))
+ ));
+
+ return endpoint;
+ }
+
+
+ private Collection<String> listEndpointLabels() {
+ Set<String> labels = new HashSet<String>();
+ for(String key : configurationService.listConfigurationKeys("ldcache.endpoint")) {
+ String[] components = key.split("\\.");
+ labels.add(components[2]);
+ }
+ return labels;
+ }
+
+}