You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@marmotta.apache.org by ss...@apache.org on 2013/10/03 17:07:19 UTC
[20/22] MARMOTTA-85: reestablished ldcache module (for all backends)
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/200783d3/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
new file mode 100644
index 0000000..ee32b22
--- /dev/null
+++ b/platform/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/200783d3/platform/marmotta-ldcache-file/pom.xml
----------------------------------------------------------------------
diff --git a/platform/marmotta-ldcache-file/pom.xml b/platform/marmotta-ldcache-file/pom.xml
new file mode 100644
index 0000000..92de994
--- /dev/null
+++ b/platform/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/200783d3/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
new file mode 100644
index 0000000..394a4a2
--- /dev/null
+++ b/platform/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/200783d3/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
new file mode 100644
index 0000000..461858e
--- /dev/null
+++ b/platform/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/200783d3/platform/marmotta-ldcache-kiwi/pom.xml
----------------------------------------------------------------------
diff --git a/platform/marmotta-ldcache-kiwi/pom.xml b/platform/marmotta-ldcache-kiwi/pom.xml
index 1614dc9..4633171 100644
--- a/platform/marmotta-ldcache-kiwi/pom.xml
+++ b/platform/marmotta-ldcache-kiwi/pom.xml
@@ -28,7 +28,7 @@
<artifactId>marmotta-ldcache-kiwi</artifactId>
<packaging>jar</packaging>
- <name>Apache Marmotta Platform: Linked Data Caching</name>
+ <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
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/200783d3/platform/marmotta-ldcache-kiwi/src/main/java/org/apache/marmotta/platform/ldcache/api/endpoint/LinkedDataEndpointService.java
----------------------------------------------------------------------
diff --git a/platform/marmotta-ldcache-kiwi/src/main/java/org/apache/marmotta/platform/ldcache/api/endpoint/LinkedDataEndpointService.java b/platform/marmotta-ldcache-kiwi/src/main/java/org/apache/marmotta/platform/ldcache/api/endpoint/LinkedDataEndpointService.java
deleted file mode 100644
index b6bd8cd..0000000
--- a/platform/marmotta-ldcache-kiwi/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/200783d3/platform/marmotta-ldcache-kiwi/src/main/java/org/apache/marmotta/platform/ldcache/model/filter/LDCacheIgnoreFilter.java
----------------------------------------------------------------------
diff --git a/platform/marmotta-ldcache-kiwi/src/main/java/org/apache/marmotta/platform/ldcache/model/filter/LDCacheIgnoreFilter.java b/platform/marmotta-ldcache-kiwi/src/main/java/org/apache/marmotta/platform/ldcache/model/filter/LDCacheIgnoreFilter.java
deleted file mode 100644
index 9e3614f..0000000
--- a/platform/marmotta-ldcache-kiwi/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/200783d3/platform/marmotta-ldcache-kiwi/src/main/java/org/apache/marmotta/platform/ldcache/model/filter/MarmottaNotCachedFilter.java
----------------------------------------------------------------------
diff --git a/platform/marmotta-ldcache-kiwi/src/main/java/org/apache/marmotta/platform/ldcache/model/filter/MarmottaNotCachedFilter.java b/platform/marmotta-ldcache-kiwi/src/main/java/org/apache/marmotta/platform/ldcache/model/filter/MarmottaNotCachedFilter.java
deleted file mode 100644
index cd6ae95..0000000
--- a/platform/marmotta-ldcache-kiwi/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.services.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/200783d3/platform/marmotta-ldcache-kiwi/src/main/java/org/apache/marmotta/platform/ldcache/services/endpoint/LinkedDataEndpointServiceImpl.java
----------------------------------------------------------------------
diff --git a/platform/marmotta-ldcache-kiwi/src/main/java/org/apache/marmotta/platform/ldcache/services/endpoint/LinkedDataEndpointServiceImpl.java b/platform/marmotta-ldcache-kiwi/src/main/java/org/apache/marmotta/platform/ldcache/services/endpoint/LinkedDataEndpointServiceImpl.java
deleted file mode 100644
index 2a0dac4..0000000
--- a/platform/marmotta-ldcache-kiwi/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/200783d3/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
new file mode 100644
index 0000000..e97737d
--- /dev/null
+++ b/platform/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/200783d3/platform/marmotta-ldcache-kiwi/src/main/java/org/apache/marmotta/platform/ldcache/services/ldcache/LDCacheSailProvider.java
----------------------------------------------------------------------
diff --git a/platform/marmotta-ldcache-kiwi/src/main/java/org/apache/marmotta/platform/ldcache/services/ldcache/LDCacheSailProvider.java b/platform/marmotta-ldcache-kiwi/src/main/java/org/apache/marmotta/platform/ldcache/services/ldcache/LDCacheSailProvider.java
deleted file mode 100644
index 274f11e..0000000
--- a/platform/marmotta-ldcache-kiwi/src/main/java/org/apache/marmotta/platform/ldcache/services/ldcache/LDCacheSailProvider.java
+++ /dev/null
@@ -1,233 +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.ldcache;
-
-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.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.core.model.filter.MarmottaLocalFilter;
-import org.apache.marmotta.platform.ldcache.api.endpoint.LinkedDataEndpointService;
-import org.apache.marmotta.platform.ldcache.model.filter.LDCacheIgnoreFilter;
-import org.openrdf.model.Resource;
-import org.openrdf.sail.NotifyingSail;
-import org.openrdf.sail.helpers.NotifyingSailWrapper;
-import org.slf4j.Logger;
-
-import javax.annotation.PostConstruct;
-import javax.enterprise.context.ApplicationScoped;
-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.
- *
- * <p/>
- * Author: Sebastian Schaffert (sschaffert@apache.org)
- */
-@ApplicationScoped
-public class LDCacheSailProvider implements NotifyingSailProvider {
-
- public static final String LDCACHE_ENABLED = "ldcache.enabled";
- @Inject
- private Logger log;
-
- @Inject
- private LinkedDataEndpointService endpointService;
-
- @Inject
- private ConfigurationService configurationService;
-
- @Inject
- private SesameService sesameService;
-
- @Inject
- private HttpClientService httpClientService;
-
- @Inject
- private Instance<LDCacheIgnoreFilter> ignoreFilters;
-
- private Set<Endpoint> volatileEndpoints;
-
- private ClientConfiguration ldclientConfig;
-
- 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";
- }
-
-
- /**
- * 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()) {
- sail = null;
- }
- }
- }
-
-
- @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(sail != null && sail.getLDCache() != null) {
- sail.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(sail != null && sail.getLDCache() != null) {
- sail.getLDCache().reload();
- }
- }
-
- /**
- * 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;
- }
- }
-
-
- /**
- * 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/200783d3/platform/marmotta-ldcache-kiwi/src/main/java/org/apache/marmotta/platform/ldcache/webservices/LinkedDataCachingWebService.java
----------------------------------------------------------------------
diff --git a/platform/marmotta-ldcache-kiwi/src/main/java/org/apache/marmotta/platform/ldcache/webservices/LinkedDataCachingWebService.java b/platform/marmotta-ldcache-kiwi/src/main/java/org/apache/marmotta/platform/ldcache/webservices/LinkedDataCachingWebService.java
deleted file mode 100644
index 983228a..0000000
--- a/platform/marmotta-ldcache-kiwi/src/main/java/org/apache/marmotta/platform/ldcache/webservices/LinkedDataCachingWebService.java
+++ /dev/null
@@ -1,306 +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.services.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);
- }
-
-
- 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/200783d3/platform/marmotta-ldcache-kiwi/src/main/resources/config-defaults.properties
----------------------------------------------------------------------
diff --git a/platform/marmotta-ldcache-kiwi/src/main/resources/config-defaults.properties b/platform/marmotta-ldcache-kiwi/src/main/resources/config-defaults.properties
deleted file mode 100644
index 750de20..0000000
--- a/platform/marmotta-ldcache-kiwi/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/200783d3/platform/marmotta-ldcache-kiwi/src/main/resources/config-descriptions.properties
----------------------------------------------------------------------
diff --git a/platform/marmotta-ldcache-kiwi/src/main/resources/config-descriptions.properties b/platform/marmotta-ldcache-kiwi/src/main/resources/config-descriptions.properties
deleted file mode 100644
index 7d6b4b4..0000000
--- a/platform/marmotta-ldcache-kiwi/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/200783d3/platform/marmotta-ldcache-kiwi/src/main/resources/kiwi-module.properties
----------------------------------------------------------------------
diff --git a/platform/marmotta-ldcache-kiwi/src/main/resources/kiwi-module.properties b/platform/marmotta-ldcache-kiwi/src/main/resources/kiwi-module.properties
deleted file mode 100644
index 3f3dd4e..0000000
--- a/platform/marmotta-ldcache-kiwi/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
-
-
-