You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@marmotta.apache.org by wi...@apache.org on 2013/02/19 13:52:01 UTC
[6/52] [partial] code contribution,
initial import of relevant modules of LMF-3.0.0-SNAPSHOT based on
revision 4bf944319368 of the default branch at https://code.google.com/p/lmf/
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/c32963d5/lmf-core/src/main/java/kiwi/core/webservices/resource/ResourceWebServiceHelper.java
----------------------------------------------------------------------
diff --git a/lmf-core/src/main/java/kiwi/core/webservices/resource/ResourceWebServiceHelper.java b/lmf-core/src/main/java/kiwi/core/webservices/resource/ResourceWebServiceHelper.java
new file mode 100644
index 0000000..8da2256
--- /dev/null
+++ b/lmf-core/src/main/java/kiwi/core/webservices/resource/ResourceWebServiceHelper.java
@@ -0,0 +1,151 @@
+/**
+ * Copyright (C) 2013 Salzburg Research.
+ *
+ * Licensed 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 kiwi.core.webservices.resource;
+
+import kiwi.core.api.config.ConfigurationService;
+import kiwi.core.services.templating.TemplatingHelper;
+import org.apache.marmotta.commons.http.ContentType;
+import org.openrdf.model.URI;
+
+import javax.ws.rs.core.Response;
+import javax.ws.rs.core.Response.Status;
+import java.io.UnsupportedEncodingException;
+import java.net.URLEncoder;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * Helper methods shared accross the difference resource web services
+ *
+ * @author Sergio Fernández
+ *
+ */
+public class ResourceWebServiceHelper {
+
+ public static void addHeader(Response response, String name, String value) {
+ response.getMetadata().add(name, value);
+ }
+
+ public static String appendTypes(List<String> datamimes, String mime) {
+ StringBuilder sb = new StringBuilder();
+ sb.append(appendContentTypes(mime));
+ sb.append(appendMetaTypes(datamimes));
+ return sb.toString();
+ }
+
+ public static String appendMetaTypes(List<String> datamimes) {
+ StringBuilder sb = new StringBuilder();
+ for (int i = 0; i < datamimes.size(); i++) {
+ sb.append(datamimes.get(i));
+ sb.append(";rel=meta");
+ if (i < datamimes.size() - 1) {
+ sb.append(",");
+ }
+ }
+ return sb.toString();
+ }
+
+ public static String appendContentTypes(String mime) {
+ if (mime != null) {
+ return mime + ";rel=content";
+ } else {
+ return "";
+ }
+ }
+
+ public static String buildContentLink(URI resource, String uuid, String mime, ConfigurationService configurationService) {
+ // test if there is content
+ StringBuffer b = new StringBuffer();
+ if (mime != null) {
+ b.append("<");
+ // b.append(configurationService.getBaseUri() + "content/" + mime +
+ // appendix);
+ b.append(buildResourceLink(resource, ConfigurationService.CONTENT_PATH, mime, configurationService));
+ b.append(">");
+ b.append(";type=");
+ b.append(mime);
+ b.append(";rel=content");
+ }
+ return b.toString();
+ }
+
+ public static String buildMetaLinks(URI resource, String uuid, List<String> datamimes, ConfigurationService configurationService) {
+ StringBuilder b = new StringBuilder();
+ for (int i = 0; i < datamimes.size(); i++) {
+ b.append("<");
+ // b.append(configurationService.getBaseUri() + "meta/" +
+ // datamimes.get(i) + appendix);
+ b.append(buildResourceLink(resource, ConfigurationService.META_PATH, datamimes.get(i), configurationService));
+ b.append(">");
+ b.append(";type=");
+ b.append(datamimes.get(i));
+ b.append(";rel=meta");
+ if (i < datamimes.size() - 1) {
+ b.append(",");
+ }
+ }
+ return b.toString();
+ }
+
+ public static String buildResourceLink(URI resource, ContentType cType, ConfigurationService configurationService) {
+ return buildResourceLink(resource, cType.getParameter("rel"),
+ cType.getMime(), configurationService);
+ }
+
+ public static String buildResourceLink(URI resource, String rel, String mime, ConfigurationService configurationService) {
+ final String src = configurationService.getServerUri(), base = configurationService
+ .getBaseUri();
+
+ if (src.equals(base)
+ && resource.stringValue().startsWith(base + ConfigurationService.RESOURCE_PATH + "/")) {
+ final String uuid;
+ uuid = resource.stringValue().substring(
+ (base + "resource/").length());
+ return String.format("%s%s/%s/%s", base, rel, mime, uuid);
+
+ } else {
+ try {
+ return String.format("%s%s/%s?uri=%s", src, rel, mime,
+ URLEncoder.encode(resource.stringValue(), ResourceWebService.CHARSET));
+ } catch (UnsupportedEncodingException e) {
+ return String.format("%s%s/%s?uri=%s", src, rel, mime,
+ resource.stringValue());
+ }
+ }
+ }
+
+ public static Response buildErrorPage(String uri, String base, Status status, String message) {
+ Map<String, Object> data = new HashMap<String, Object>();
+ data.put("uri", uri);
+ data.put("baseUri", base);
+ data.put("message", message);
+ try {
+ data.put("encoded_uri", URLEncoder.encode(uri, "UTF-8"));
+ } catch (UnsupportedEncodingException uee) {
+ data.put("encoded_uri", uri);
+ }
+ try {
+ return Response.status(status)
+ .entity(TemplatingHelper.processTemplate("404.ftl", data))
+ .build();
+ } catch (Exception e) {
+ return Response.status(Response.Status.NOT_FOUND)
+ .entity("Not Found").build();
+ }
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/c32963d5/lmf-core/src/main/java/kiwi/core/webservices/statistics/StatisticsWebService.java
----------------------------------------------------------------------
diff --git a/lmf-core/src/main/java/kiwi/core/webservices/statistics/StatisticsWebService.java b/lmf-core/src/main/java/kiwi/core/webservices/statistics/StatisticsWebService.java
new file mode 100644
index 0000000..73221ce
--- /dev/null
+++ b/lmf-core/src/main/java/kiwi/core/webservices/statistics/StatisticsWebService.java
@@ -0,0 +1,162 @@
+/**
+ * Copyright (C) 2013 Salzburg Research.
+ *
+ * Licensed 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 kiwi.core.webservices.statistics;
+
+import kiwi.core.api.statistics.StatisticsModule;
+import kiwi.core.api.statistics.StatisticsService;
+import org.slf4j.Logger;
+
+import javax.enterprise.context.ApplicationScoped;
+import javax.inject.Inject;
+import javax.ws.rs.GET;
+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.core.Response;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * Add file description here!
+ * <p/>
+ * User: sschaffe
+ */
+@ApplicationScoped
+@Path("/statistics")
+public class StatisticsWebService {
+
+ @Inject
+ private Logger log;
+
+ @Inject
+ private StatisticsService statisticsService;
+
+
+ /**
+ * Enable or disable the statistics gathering. If enabled, might cause additional overhead in execution.
+ *
+ * @param enabled if true, statistics gathering will be enabled, if false, it will be disabled
+ * @HTTP 200 when the statistics gathering has been enabled or disabled successfully
+ * @return OK when changing the statistics setting was successful
+ */
+ @PUT
+ @Path("/enabled")
+ public Response setEnabled(@QueryParam("value") boolean enabled) {
+ if(enabled) {
+ log.info("enabling statistics gathering ...");
+ statisticsService.enableAll();
+ } else {
+ log.info("disabling statistics gathering ...");
+ statisticsService.disableAll();
+ }
+ return Response.ok().entity("statistics gathering "+(enabled?"enabled":"disabled")).build();
+ }
+
+ /**
+ * Return the status of statistics gathering.
+ *
+ * @return Returns true if statistics gathering is enabled, false if it is disabled.
+ */
+ @GET
+ @Path("/enabled")
+ public boolean isEnabled() {
+ return statisticsService.isEnabled();
+ }
+
+ /**
+ * Retrieve the statistics information of all statistics modules.
+ * @return a JSON-formatted map with an entry for each statistics module, where the value is a map of
+ * (key,value) entries for the statistics properties that are collected by the module
+ */
+ @GET
+ @Produces("application/json")
+ @Path("/list")
+ public Map<String,Map<String,String>> getStatistics() {
+ Map<String,Map<String,String>> result = new HashMap<String, Map<String, String>>();
+
+ for(String module : statisticsService.listModules()) {
+ result.put(module, statisticsService.getModule(module).getStatistics());
+ }
+
+ return result;
+ }
+
+ /**
+ * Retrieve the statistics information of the statistics module with the name passed as path argument. The
+ * result format is identical to the result returned by /list
+ *
+ * @param module the module for which to return the statistics
+ * @return a JSON-formatted map with an entry for each statistics module, where the value is a map of
+ * (key,value) entries for the statistics properties that are collected by the module
+ * @HTTP 200 if the statistics module exists
+ * @HTTP 404 if the statistics module does not exist
+ */
+ @GET
+ @Produces("application/json")
+ @Path("/{module}")
+ public Response getStatistics(@PathParam("module") String module) {
+ if(statisticsService.getModule(module) != null) {
+ Map<String,Map<String,String>> result = new HashMap<String, Map<String, String>>();
+
+ result.put(module, statisticsService.getModule(module).getStatistics());
+
+ return Response.ok().entity(result).build();
+ } else
+ return Response.status(404).entity("module with name "+module+" does not exist; available modules: "+statisticsService.listModules()).build();
+ }
+
+ @PUT
+ @Path("/{module}/enabled")
+ public Response setEnabled(@PathParam("module") String module, @QueryParam("value") boolean enabled) {
+ final StatisticsModule mod = statisticsService.getModule(module);
+ if (mod != null) {
+ if (enabled) {
+ mod.enable();
+ } else {
+ mod.disable();
+ }
+ return Response.ok().entity(enabled).build();
+ }
+ else
+ return Response.status(404)
+ .entity("module with name " + module + " does not exist; available modules: " + statisticsService.listModules()).build();
+ }
+
+ @GET
+ @Path("/{module}/enabled")
+ public boolean isEnabled(@PathParam("module") String module) {
+ final StatisticsModule mod = statisticsService.getModule(module);
+ if (mod != null)
+ return mod.isEnabled();
+ else
+ return false;
+ }
+
+ /**
+ * Return a JSON-formatted list of all statistics modules that are available in the system.
+ *
+ * @return a JSON-formatted list of strings, each representing the name of a statistics module
+ */
+ @GET
+ @Produces("application/json")
+ @Path("/modules")
+ public List<String> getModules() {
+ return statisticsService.listModules();
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/c32963d5/lmf-core/src/main/java/kiwi/core/webservices/system/SystemWebService.java
----------------------------------------------------------------------
diff --git a/lmf-core/src/main/java/kiwi/core/webservices/system/SystemWebService.java b/lmf-core/src/main/java/kiwi/core/webservices/system/SystemWebService.java
new file mode 100644
index 0000000..ca925b6
--- /dev/null
+++ b/lmf-core/src/main/java/kiwi/core/webservices/system/SystemWebService.java
@@ -0,0 +1,104 @@
+/**
+ * Copyright (C) 2013 Salzburg Research.
+ *
+ * Licensed 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 kiwi.core.webservices.system;
+
+import kiwi.core.api.config.ConfigurationService;
+import kiwi.core.api.triplestore.SesameService;
+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;
+
+/**
+ * Perform various system actions like restarting database access or rebuilding indexes.
+ */
+@ApplicationScoped
+@Path("/system")
+public class SystemWebService {
+
+ @Inject
+ private Logger log;
+
+ @Inject
+ private ConfigurationService configurationService;
+
+ @Inject
+ private SesameService sesameService;
+
+ /**
+ * Reinitialise the database configuration. Will close the database connection and
+ * reopen it, possibly with new settings.
+ *
+ * @return ok if successful, 500 if not
+ * @HTTP 200 if database was reinitialised successfully
+ * @HTTP 500 if there was an error while reinitialising database (see log)
+ */
+ @POST
+ @Path("/database/reinit")
+ public Response reinitDatabase() {
+ log.info("Reinitialising database after admin user request ...");
+ try {
+ sesameService.shutdown();
+ sesameService.initialise();
+
+ return Response.ok().entity("database reinitialised successfully").build();
+ } catch(Exception ex) {
+ log.error("Error while reinitalising database ...",ex);
+ return Response.status(500).entity("error while reinitialising database").build();
+ }
+ }
+
+ @POST
+ @Path("/database/ping")
+ public Response pingDatabase(@QueryParam("type")String type,@QueryParam("url")String url,@QueryParam("user")String user,@QueryParam("pwd")String pwd) {
+ if(type==null||url==null||user==null||pwd==null) {
+ 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 Response.serverError().entity("driver for "+type+" not defined").build();
+ }
+
+ //try if type matches url
+ if(!url.startsWith("jdbc:"+type)) {
+ return Response.serverError().entity("database and url do not match properly").build();
+ }
+
+ //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 Response.serverError().entity("Can't load driver " + e).build();
+ } catch (SQLException e) {
+ return Response.serverError().entity("Database access failed " + e).build();
+ }
+ }
+
+
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/c32963d5/lmf-core/src/main/java/kiwi/core/webservices/task/TaskManagerWebService.java
----------------------------------------------------------------------
diff --git a/lmf-core/src/main/java/kiwi/core/webservices/task/TaskManagerWebService.java b/lmf-core/src/main/java/kiwi/core/webservices/task/TaskManagerWebService.java
new file mode 100644
index 0000000..43c8163
--- /dev/null
+++ b/lmf-core/src/main/java/kiwi/core/webservices/task/TaskManagerWebService.java
@@ -0,0 +1,134 @@
+/**
+ * Copyright (C) 2013 Salzburg Research.
+ *
+ * Licensed 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 kiwi.core.webservices.task;
+
+import kiwi.core.api.task.Task;
+import kiwi.core.api.task.TaskInfo;
+import kiwi.core.api.task.TaskManagerService;
+import org.json.JSONObject;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import javax.enterprise.context.ApplicationScoped;
+import javax.inject.Inject;
+import javax.ws.rs.GET;
+import javax.ws.rs.Path;
+import javax.ws.rs.PathParam;
+import javax.ws.rs.Produces;
+import javax.ws.rs.core.Response;
+
+import java.lang.ref.WeakReference;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Stack;
+
+/**
+ * A webservice for listing and managing currently active background tasks of services that support the task manager
+ * interface.
+ *
+ * <p/>
+ * User: sschaffe
+ */
+@ApplicationScoped
+@Path("/tasks")
+public class TaskManagerWebService {
+
+ private static Logger log = LoggerFactory.getLogger(TaskManagerWebService.class);
+
+ @Inject
+ private TaskManagerService taskManagerService;
+
+ /**
+ * List all tasks in all groups currently running in the system. The result
+ * is a map from group to list of tasks, each task formatted as a key-value
+ * map.
+ *
+ * @return List of {@link TaskInfo}s boxed in {@link JSONObject}s
+ */
+ @GET
+ @Path("/")
+ @Produces("application/json")
+ public Map<String, List<TaskInfo>> list() {
+ log.debug("Listing all running tasks.");
+
+ return taskManagerService.getTasksByGroup();
+ }
+
+ @GET
+ @Path("/byThread")
+ @Produces("application/json")
+ public Map<String, List<TaskInfo>> listByThread() {
+ HashMap<String, List<TaskInfo>> result = new HashMap<String, List<TaskInfo>>();
+ final Map<WeakReference<Thread>, Stack<TaskInfo>> tasksByThread = taskManagerService.getTasksByThread();
+ for (Map.Entry<WeakReference<Thread>, Stack<TaskInfo>> e : tasksByThread.entrySet()) {
+ Thread t = e.getKey().get();
+ if (t != null) {
+ result.put(t.getName(), e.getValue());
+ }
+ }
+
+ return result;
+ }
+
+ /**
+ * List all tasks in the group given as argument. The result is a map from
+ * group to list of tasks, each task formatted as a key-value map.
+ *
+ * @param group
+ * the group to list the running tasks
+ * @return List of {@link TaskInfo}s boxed in {@link JSONObject}s
+ */
+ @GET
+ @Path("/{group}")
+ @Produces("application/json")
+ public Map<String, List<TaskInfo>> list(@PathParam("group") String group) {
+ log.debug("Listing all tasks of group '{}'", group);
+
+ Map<String, List<TaskInfo>> result = new HashMap<String, List<TaskInfo>>();
+
+ Map<String, List<TaskInfo>> allTasks = taskManagerService.getTasksByGroup();
+ if (allTasks.containsKey(group)) {
+ result.put(group, allTasks.get(group));
+ }
+
+ return result;
+ }
+
+
+ /**
+ * Return the task identified by the id given as argument.
+ *
+ * @param id
+ * the id of the task to return (long value)
+ * @return The {@link Task} boxed in a {@link JSONObject}
+ */
+ @GET
+ @Path("/{group}/{name}")
+ @Produces("application/json")
+ public Response get(@PathParam("group") String group, @PathParam("name") String name) {
+ Map<String, List<TaskInfo>> gList = list(group);
+ if (gList.containsKey(group)) return Response.status(404).entity("Group " + group + " not found").build();
+
+ for (TaskInfo t : gList.get(group)) {
+ if (t != null && t.getName().equals(name)) return Response.ok().entity(t).build();
+ }
+
+ return Response.status(404).entity("Task " + name + " in Group " + group + " not found").build();
+ }
+
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/c32963d5/lmf-core/src/main/java/kiwi/core/webservices/triplestore/ContextWebService.java
----------------------------------------------------------------------
diff --git a/lmf-core/src/main/java/kiwi/core/webservices/triplestore/ContextWebService.java b/lmf-core/src/main/java/kiwi/core/webservices/triplestore/ContextWebService.java
new file mode 100644
index 0000000..1bc65af
--- /dev/null
+++ b/lmf-core/src/main/java/kiwi/core/webservices/triplestore/ContextWebService.java
@@ -0,0 +1,193 @@
+/**
+ * Copyright (C) 2013 Salzburg Research.
+ *
+ * Licensed 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 kiwi.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.HashMap;
+import java.util.Map;
+import java.util.Set;
+
+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.core.Context;
+import javax.ws.rs.core.Response;
+import javax.ws.rs.core.Response.Status;
+
+import kiwi.core.api.config.ConfigurationService;
+import kiwi.core.api.triplestore.ContextService;
+import kiwi.core.util.JerseyUtils;
+
+import org.apache.commons.lang.StringUtils;
+
+/**
+ * Context Web Service
+ *
+ * @author Thomas Kurz
+ * @author Sebastian Schaffert
+ * @author Sergio Fernández
+ */
+@ApplicationScoped
+@Path("/" + ConfigurationService.CONTEXT_PATH)
+public class ContextWebService {
+
+ @Inject
+ private ContextService contextService;
+
+ @Inject
+ private ConfigurationService configurationService;
+
+ private static final String UUID_PATTERN = "{uuid:[^#?]+}";
+
+ /**
+ * Indirect context identification, listing in case 'graph' is missing
+ *
+ * @param types
+ * @param context uri
+ * @return
+ * @throws URISyntaxException
+ * @see http://www.w3.org/TR/sparql11-http-rdf-update/#indirect-graph-identification
+ */
+ @GET
+ public Response get(@HeaderParam("Accept") String types, @QueryParam("graph") String context) throws URISyntaxException {
+ URI uri;
+ if (StringUtils.isBlank(context)) {
+ uri = new URI(configurationService.getServerUri() + ConfigurationService.CONTEXT_PATH + "/list");
+ } else {
+ uri = buildExportUri(context);
+ }
+ return Response.seeOther(uri).header("Accept", types).build();
+ }
+
+ /**
+ *
+ * @return a list of URIs representing contexts
+ */
+ @GET
+ @Path("/list")
+ @Produces("application/json")
+ public Response listContexts(@QueryParam("labels") String labels, @QueryParam("filter") String filter) {
+ try {
+ if(labels == null) {
+ ArrayList<String> res = new ArrayList<String>();
+ for(org.openrdf.model.URI r : contextService.listContexts(filter != null)) {
+ res.add(r.stringValue());
+ }
+ return Response.ok().entity(res).build();
+ } else {
+ ArrayList<Map<String,String>> result = new ArrayList<Map<String, String>>();
+ for(org.openrdf.model.URI r : contextService.listContexts(filter != null)) {
+ Map<String,String> ctxDesc = new HashMap<String, String>();
+ ctxDesc.put("uri",r.stringValue());
+ ctxDesc.put("label", contextService.getContextLabel(r));
+ result.add(ctxDesc);
+ }
+ return Response.ok().entity(result).build();
+ }
+ } catch(Exception e) {
+ return Response.serverError().entity(e.getMessage()).build();
+ }
+ }
+
+ /**
+ * Returns the content stored on this context
+ *
+ * @param types, accepted formats
+ * @param uuid, a unique context identifier
+ * @return redirects to the export service
+ */
+ @GET
+ @Path(UUID_PATTERN)
+ public Response getContext(@HeaderParam("Accept") String types, @PathParam("uuid") String uuid) throws UnsupportedEncodingException,
+ URISyntaxException {
+ String context = buildUri(uuid);
+ URI uri = buildExportUri(context);
+ return Response.seeOther(uri).header("Accept", types).build();
+ }
+
+ @PUT
+ public Response put(@QueryParam("graph") String context, @HeaderParam("Content-Type") String type, @Context HttpServletRequest request) throws IOException {
+ if (StringUtils.isBlank(context)) {
+ return Response.status(Status.NOT_ACCEPTABLE).entity("missing 'graph' uri for indirect grpah identification").build();
+ } else {
+ if(type != null && type.lastIndexOf(';') >= 0) {
+ type = type.substring(0,type.lastIndexOf(';'));
+ }
+ Set<String> acceptedFormats = contextService.getAcceptFormats();
+ if (type == null || !acceptedFormats.contains(type)) {
+ return Response.status(412).entity("define a valid content-type (types: " + acceptedFormats + ")").build();
+ }
+ final boolean imported = contextService.importContent(context, request.getInputStream(), type);
+ return imported ? Response.ok().build() : Response.status(Status.NOT_FOUND).build();
+ }
+ }
+
+ @PUT
+ public Response putContext(@PathParam("uuid") String uuid, @HeaderParam("Content-Type") String type, @Context HttpServletRequest request) throws IOException {
+ return put(buildUri(uuid), type, request);
+ }
+
+ @DELETE
+ public Response delete(@QueryParam("graph") String context) {
+ if (StringUtils.isBlank(context)) {
+ return Response.status(Status.NOT_ACCEPTABLE).entity("missing 'graph' uri for indirect grpah identification").build();
+ } else {
+ final boolean deleted = contextService.removeContext(context);
+ return deleted ? Response.ok().build() : Response.status(Status.NOT_FOUND).build();
+ }
+ }
+
+ /**
+ * Deletes a named graph from the system
+ *
+ * @param types formats accepted
+ * @param uuid context identifier
+ * @return status code
+ * @throws UnsupportedEncodingException
+ * @throws URISyntaxException
+ */
+ @DELETE
+ @Path(UUID_PATTERN)
+ public Response deleteContext(@PathParam("uuid") String uuid) {
+ return delete(buildUri(uuid));
+ }
+
+ 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;
+ }
+
+ private URI buildExportUri(String uri) throws URISyntaxException {
+ return new URI(configurationService.getBaseUri() + "export/download?context=" + uri);
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/c32963d5/lmf-core/src/main/java/kiwi/core/webservices/triplestore/KnowledgeSpaceWebService.java
----------------------------------------------------------------------
diff --git a/lmf-core/src/main/java/kiwi/core/webservices/triplestore/KnowledgeSpaceWebService.java b/lmf-core/src/main/java/kiwi/core/webservices/triplestore/KnowledgeSpaceWebService.java
new file mode 100644
index 0000000..b70ce26
--- /dev/null
+++ b/lmf-core/src/main/java/kiwi/core/webservices/triplestore/KnowledgeSpaceWebService.java
@@ -0,0 +1,120 @@
+/**
+ * Copyright (C) 2013 Salzburg Research.
+ *
+ * Licensed 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 kiwi.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 kiwi.core.api.config.ConfigurationService;
+import kiwi.core.api.triplestore.ContextService;
+import kiwi.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/c32963d5/lmf-core/src/main/java/kiwi/core/webservices/triplestore/LdpWebService.java
----------------------------------------------------------------------
diff --git a/lmf-core/src/main/java/kiwi/core/webservices/triplestore/LdpWebService.java b/lmf-core/src/main/java/kiwi/core/webservices/triplestore/LdpWebService.java
new file mode 100644
index 0000000..b5099fe
--- /dev/null
+++ b/lmf-core/src/main/java/kiwi/core/webservices/triplestore/LdpWebService.java
@@ -0,0 +1,151 @@
+/**
+ * Copyright (C) 2013 Salzburg Research.
+ *
+ * Licensed 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 kiwi.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 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.core.Response;
+import javax.ws.rs.core.Response.Status;
+
+import kiwi.core.api.config.ConfigurationService;
+import kiwi.core.api.triplestore.LdpService;
+import kiwi.core.util.JerseyUtils;
+
+import org.openrdf.model.URI;
+import org.openrdf.repository.RepositoryException;
+
+/**
+ * LDP Web Service (isolated for the moment for experimenting with
+ * the concepts, but at some point it should be merged back to
+ * {@link kiwi.core.webservices.resource.ResourceWebService})
+ *
+ * @author Sergio Fernández
+ *
+ */
+@ApplicationScoped
+@Path("/" + ConfigurationService.LDP_PATH)
+public class LdpWebService {
+
+ @Inject
+ private ConfigurationService configurationService;
+
+ @Inject
+ private LdpService ldpService;
+
+ private static final String UUID_PATTERN = "{uuid:[^#?]+}";
+
+ /**
+ * Produces a list of all containers available
+ *
+ * @return list of container
+ */
+ @GET
+ @Produces("application/json")
+ public Response list() {
+ try {
+ List<String> l = new ArrayList<String>();
+ for(URI container : ldpService.list()) {
+ l.add(container.stringValue());
+ }
+ return Response.ok().entity(l).build();
+ } catch(Exception e) {
+ return Response.serverError().entity(e.getMessage()).build();
+ }
+ }
+
+ /**
+ * Returns the content stored on this resource/container
+ *
+ * @param types, accepted formats
+ * @param uuid, a unique container identifier
+ * @return redirect response to the export service
+ */
+ @GET
+ @Path(UUID_PATTERN)
+ public Response get(@HeaderParam("Accept") String types, @PathParam("uuid") String uuid) throws UnsupportedEncodingException,
+ URISyntaxException {
+ String uri = buildUri(uuid);
+ if (ldpService.get(uri) != null) {
+ java.net.URI seeAlso = new java.net.URI(configurationService.getBaseUri() + ConfigurationService.RESOURCE_PATH + "?uri=" + uri);
+ return Response.seeOther(seeAlso).header("Accept", types).build();
+ } else {
+ return Response.status(Status.NOT_FOUND).entity("Container not found").header("Accept", types).build();
+ }
+ }
+
+ @POST
+ @Path(UUID_PATTERN)
+ public Response create(@HeaderParam("Accept") String types, @PathParam("uuid") String uuid, @QueryParam("title") String title) throws UnsupportedEncodingException,
+ URISyntaxException {
+ String uri = buildUri(uuid);
+ if (ldpService.create(uri)) {
+ Response response = status(Status.CREATED).entity("Container created").header("Accept", types).build();
+ response.getMetadata().add("Location", uri);
+ response.getMetadata().add("Vary", "Content-Type");
+ return response;
+ } else {
+ return Response.status(Status.CONFLICT).entity("Container already exists").header("Accept", types).build();
+ }
+ }
+
+ /**
+ * Deletes this resource/container
+ *
+ * @param types formats accepted
+ * @param uuid container identifier
+ * @return response
+ */
+ @DELETE
+ @Path(UUID_PATTERN)
+ public Response delete(String types, @PathParam("uuid") String uuid) {
+ String uri = buildUri(uuid);
+ try {
+ final boolean deleted = ldpService.delete(uri);
+ if (deleted) {
+ return Response.ok().build();
+ } else {
+ return Response.status(Response.Status.NOT_FOUND).build();
+ }
+ } catch (RepositoryException ex) {
+ return Response.serverError().entity(ex.getMessage()).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/c32963d5/lmf-core/src/main/resources/META-INF/MANIFEST.MF
----------------------------------------------------------------------
diff --git a/lmf-core/src/main/resources/META-INF/MANIFEST.MF b/lmf-core/src/main/resources/META-INF/MANIFEST.MF
new file mode 100644
index 0000000..59499bc
--- /dev/null
+++ b/lmf-core/src/main/resources/META-INF/MANIFEST.MF
@@ -0,0 +1,2 @@
+Manifest-Version: 1.0
+
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/c32963d5/lmf-core/src/main/resources/META-INF/beans.xml
----------------------------------------------------------------------
diff --git a/lmf-core/src/main/resources/META-INF/beans.xml b/lmf-core/src/main/resources/META-INF/beans.xml
new file mode 100644
index 0000000..8b6f6c1
--- /dev/null
+++ b/lmf-core/src/main/resources/META-INF/beans.xml
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ Copyright (C) 2013 Salzburg Research.
+
+ Licensed 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">
+
+<!--
+ <interceptors>
+ <class>kiwi.core.services.transaction.RequiresTransactionInterceptor</class>
+ <class>kiwi.core.services.transaction.TransactionInterceptor</class>
+ <class>kiwi.core.services.transaction.ExceptionHandlingTransactionInterceptor</class>
+ </interceptors>
+-->
+
+</beans>
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/c32963d5/lmf-core/src/main/resources/META-INF/ehcache.xml
----------------------------------------------------------------------
diff --git a/lmf-core/src/main/resources/META-INF/ehcache.xml b/lmf-core/src/main/resources/META-INF/ehcache.xml
new file mode 100644
index 0000000..1cb33e4
--- /dev/null
+++ b/lmf-core/src/main/resources/META-INF/ehcache.xml
@@ -0,0 +1,496 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ Copyright (C) 2013 Salzburg Research.
+
+ Licensed 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.
+
+-->
+<!--
+CacheManager Configuration
+==========================
+An ehcache.xml corresponds to a single CacheManager.
+
+See instructions below or the ehcache schema (ehcache.xsd) on how to configure.
+
+System property tokens can be specified in this file which are replaced when the configuration
+is loaded. For example multicastGroupPort=${multicastGroupPort} can be replaced with the
+System property either from an environment variable or a system property specified with a
+command line switch such as -DmulticastGroupPort=4446.
+
+The attributes of <ehcache> are:
+* name - an optional name for the CacheManager. The name is optional and primarily used
+for documentation or to distinguish Terracotta clustered cache state. With Terracotta
+clustered caches, a combination of CacheManager name and cache name uniquely identify a
+particular cache store in the Terracotta clustered memory.
+* updateCheck - an optional boolean flag specifying whether this CacheManager should check
+for new versions of Ehcache over the Internet. If not specified, updateCheck="true".
+* monitoring - an optional setting that determines whether the CacheManager should
+automatically register the SampledCacheMBean with the system MBean server. Currently,
+this monitoring is only useful when using Terracotta and thus the "autodetect" value
+will detect the presence of Terracotta and register the MBean. Other allowed values
+are "on" and "off". The default is "autodetect".
+-->
+<ehcache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="ehcache.xsd">
+
+ <!--
+ DiskStore configuration
+ =======================
+
+ The diskStore element is optional. To turn off disk store path creation, comment out the diskStore
+ element below.
+
+ Configure it if you have overflowToDisk or diskPersistent enabled for any cache.
+
+ If it is not configured, and a cache is created which requires a disk store, a warning will be
+ issued and java.io.tmpdir will automatically be used.
+
+ diskStore has only one attribute - "path". It is the path to the directory where
+ .data and .index files will be created.
+
+ If the path is one of the following Java System Property it is replaced by its value in the
+ running VM. For backward compatibility these are not specified without being enclosed in the ${token}
+ replacement syntax.
+
+ The following properties are translated:
+ * user.home - KiWiUser's home directory
+ * user.dir - KiWiUser's current working directory
+ * java.io.tmpdir - Default temp file path
+ * ehcache.disk.store.dir - A system property you would normally specify on the command line
+ e.g. java -Dehcache.disk.store.dir=/u01/myapp/diskdir ...
+
+ Subdirectories can be specified below the property e.g. java.io.tmpdir/one
+
+ -->
+ <diskStore path="java.io.tmpdir/lmf-cache"/>
+
+ <!--
+ Cachemanagereventlistener
+ =========================
+ Specifies a CacheManagerEventListenerFactory which is notified when Caches are added
+ or removed from the CacheManager.
+
+ The attributes of CacheManagerEventListenerFactory are:
+ * class - a fully qualified factory class name
+ * properties - comma separated properties having meaning only to the factory.
+
+ Sets the fully qualified class name to be registered as the CacheManager event listener.
+
+ The events include:
+ * adding a Cache
+ * removing a Cache
+
+ Callbacks to listener methods are synchronous and unsynchronized. It is the responsibility
+ of the implementer to safely handle the potential performance and thread safety issues
+ depending on what their listener is doing.
+
+ If no class is specified, no listener is created. There is no default.
+ -->
+ <cacheManagerEventListenerFactory class="" properties=""/>
+
+
+ <!--
+ CacheManagerPeerProvider
+ ========================
+ (For distributed operation)
+
+ Specifies a CacheManagerPeerProviderFactory which will be used to create a
+ CacheManagerPeerProvider, which discovers other CacheManagers in the cluster.
+
+ One or more providers can be configured. The first one in the ehcache.xml is the default, which is used
+ for replication and bootstrapping.
+
+ The attributes of cacheManagerPeerProviderFactory are:
+ * class - a fully qualified factory class name
+ * properties - comma separated properties having meaning only to the factory.
+
+ Providers are available for RMI, JGroups and JMS as shown following.
+
+ RMICacheManagerPeerProvider
+ +++++++++++++++++++++++++++
+
+ Ehcache comes with a built-in RMI-based distribution system with two means of discovery of
+ CacheManager peers participating in the cluster:
+ * automatic, using a multicast group. This one automatically discovers peers and detects
+ changes such as peers entering and leaving the group
+ * manual, using manual rmiURL configuration. A hardcoded list of peers is provided at
+ configuration time.
+
+ Configuring Automatic Discovery:
+ Automatic discovery is configured as per the following example:
+ <cacheManagerPeerProviderFactory
+ class="net.sf.ehcache.distribution.RMICacheManagerPeerProviderFactory"
+ properties="hostName=fully_qualified_hostname_or_ip,
+ peerDiscovery=automatic, multicastGroupAddress=230.0.0.1,
+ multicastGroupPort=4446, timeToLive=32"/>
+
+ Valid properties are:
+ * peerDiscovery (mandatory) - specify "automatic"
+ * multicastGroupAddress (mandatory) - specify a valid multicast group address
+ * multicastGroupPort (mandatory) - specify a dedicated port for the multicast heartbeat
+ traffic
+ * timeToLive - specify a value between 0 and 255 which determines how far the packets will
+ propagate.
+
+ By convention, the restrictions are:
+ 0 - the same host
+ 1 - the same subnet
+ 32 - the same site
+ 64 - the same region
+ 128 - the same continent
+ 255 - unrestricted
+
+ * hostName - the hostname or IP of the interface to be used for sending and receiving multicast packets
+ (relevant to mulithomed hosts only)
+
+ Configuring Manual Discovery:
+ Manual discovery requires a unique configuration per host. It is contains a list of rmiURLs for the peers, other
+ than itself. So, if we have server1, server2 and server3 the configuration will be:
+
+ In server1's configuration:
+ <cacheManagerPeerProviderFactory class=
+ "net.sf.ehcache.distribution.RMICacheManagerPeerProviderFactory"
+ properties="peerDiscovery=manual,
+ rmiUrls=//server2:40000/sampleCache1|//server3:40000/sampleCache1
+ | //server2:40000/sampleCache2|//server3:40000/sampleCache2"
+ propertySeparator="," />
+
+ In server2's configuration:
+ <cacheManagerPeerProviderFactory class=
+ "net.sf.ehcache.distribution.RMICacheManagerPeerProviderFactory"
+ properties="peerDiscovery=manual,
+ rmiUrls=//server1:40000/sampleCache1|//server3:40000/sampleCache1
+ | //server1:40000/sampleCache2|//server3:40000/sampleCache2"
+ propertySeparator="," />
+
+ In server3's configuration:
+ <cacheManagerPeerProviderFactory class=
+ "net.sf.ehcache.distribution.RMICacheManagerPeerProviderFactory"
+ properties="peerDiscovery=manual,
+ rmiUrls=//server1:40000/sampleCache1|//server2:40000/sampleCache1
+ | //server1:40000/sampleCache2|//server2:40000/sampleCache2"
+ propertySeparator="," />
+
+
+ Valid properties are:
+ * peerDiscovery (mandatory) - specify "manual"
+ * rmiUrls (mandatory) - specify a pipe separated list of rmiUrls, in the form
+ //hostname:port
+ * hostname (optional) - the hostname is the hostname of the remote CacheManager peer. The port is the listening
+ port of the RMICacheManagerPeerListener of the remote CacheManager peer.
+
+ JGroupsCacheManagerPeerProvider
+ +++++++++++++++++++++++++++++++
+ <cacheManagerPeerProviderFactory class="net.sf.ehcache.distribution.jgroups.JGroupsCacheManagerPeerProviderFactory"
+ properties="connect=UDP(mcast_addr=231.12.21.132;mcast_port=45566;ip_ttl=32;
+ mcast_send_buf_size=150000;mcast_recv_buf_size=80000):
+ PING(timeout=2000;num_initial_members=6):
+ MERGE2(min_interval=5000;max_interval=10000):
+ FD_SOCK:VERIFY_SUSPECT(timeout=1500):
+ pbcast.NAKACK(gc_lag=10;retransmit_timeout=3000):
+ UNICAST(timeout=5000):
+ pbcast.STABLE(desired_avg_gossip=20000):
+ FRAG:
+ pbcast.GMS(join_timeout=5000;join_retry_timeout=2000;shun=false;print_local_addr=false)"
+ propertySeparator="::"
+ />
+ The only property necessary is the connect String used by jgroups to configure itself. Refer to the Jgroups documentation for explanation
+ of all the protocols. The example above uses UDP multicast. If the connect property is not specified the default JGroups connection will be
+ used.
+
+
+ JMSCacheManagerPeerProviderFactory
+ ++++++++++++++++++++++++++++++++++
+ <cacheManagerPeerProviderFactory
+ class="net.sf.ehcache.distribution.jms.JMSCacheManagerPeerProviderFactory"
+ properties="..."
+ propertySeparator=","
+ />
+
+ The JMS PeerProviderFactory uses JNDI to maintain message queue independence. Refer to the manual for full configuration
+ examples using ActiveMQ and Open Message Queue.
+
+ Valid properties are:
+ * initialContextFactoryName (mandatory) - the name of the factory used to create the message queue initial context.
+ * providerURL (mandatory) - the JNDI configuration information for the service provider to use.
+ * topicConnectionFactoryBindingName (mandatory) - the JNDI binding name for the TopicConnectionFactory
+ * topicBindingName (mandatory) - the JNDI binding name for the topic name
+ * getQueueBindingName (mandatory only if using jmsCacheLoader) - the JNDI binding name for the queue name
+ * securityPrincipalName - the JNDI java.naming.security.principal
+ * securityCredentials - the JNDI java.naming.security.credentials
+ * urlPkgPrefixes - the JNDI java.naming.factory.url.pkgs
+ * userName - the user name to use when creating the TopicConnection to the Message Queue
+ * password - the password to use when creating the TopicConnection to the Message Queue
+ * acknowledgementMode - the JMS Acknowledgement mode for both publisher and subscriber. The available choices are
+ AUTO_ACKNOWLEDGE, DUPS_OK_ACKNOWLEDGE and SESSION_TRANSACTED. The default is AUTO_ACKNOWLEDGE.
+ -->
+<!-- <cacheManagerPeerProviderFactory-->
+<!-- class="net.sf.ehcache.distribution.RMICacheManagerPeerProviderFactory"-->
+<!-- properties="peerDiscovery=automatic,-->
+<!-- multicastGroupAddress=230.0.0.1,-->
+<!-- multicastGroupPort=4446, timeToLive=1"-->
+<!-- propertySeparator=","-->
+<!-- />-->
+
+
+ <!--
+ CacheManagerPeerListener
+ ========================
+ (Enable for distributed operation)
+
+ Specifies a CacheManagerPeerListenerFactory which will be used to create a
+ CacheManagerPeerListener, which listens for messages from cache replicators participating in the cluster.
+
+ The attributes of cacheManagerPeerListenerFactory are:
+ class - a fully qualified factory class name
+ properties - comma separated properties having meaning only to the factory.
+
+ Ehcache comes with a built-in RMI-based distribution system. The listener component is
+ RMICacheManagerPeerListener which is configured using
+ RMICacheManagerPeerListenerFactory. It is configured as per the following example:
+
+ <cacheManagerPeerListenerFactory
+ class="net.sf.ehcache.distribution.RMICacheManagerPeerListenerFactory"
+ properties="hostName=fully_qualified_hostname_or_ip,
+ port=40001,
+ remoteObjectPort=40002,
+ socketTimeoutMillis=120000"
+ propertySeparator="," />
+
+ All properties are optional. They are:
+ * hostName - the hostName of the host the listener is running on. Specify
+ where the host is multihomed and you want to control the interface over which cluster
+ messages are received. Defaults to the host name of the default interface if not
+ specified.
+ * port - the port the RMI Registry listener listens on. This defaults to a free port if not specified.
+ * remoteObjectPort - the port number on which the remote objects bound in the registry receive calls.
+ This defaults to a free port if not specified.
+ * socketTimeoutMillis - the number of ms client sockets will stay open when sending
+ messages to the listener. This should be long enough for the slowest message.
+ If not specified it defaults to 120000ms.
+
+ -->
+<!-- <cacheManagerPeerListenerFactory-->
+<!-- class="net.sf.ehcache.distribution.RMICacheManagerPeerListenerFactory"/>-->
+
+ <!-- Cache configuration.
+
+ The following attributes are required.
+
+ name:
+ Sets the name of the cache. This is used to identify the cache. It must be unique.
+
+ maxElementsInMemory:
+ Sets the maximum number of objects that will be created in memory
+
+ maxElementsOnDisk:
+ Sets the maximum number of objects that will be maintained in the DiskStore
+ The default value is zero, meaning unlimited.
+
+ eternal:
+ Sets whether elements are eternal. If eternal, timeouts are ignored and the
+ element is never expired.
+
+ overflowToDisk:
+ Sets whether elements can overflow to disk when the memory store
+ has reached the maxInMemory limit.
+
+ The following attributes are optional.
+
+ timeToIdleSeconds:
+ Sets the time to idle for an element before it expires.
+ i.e. The maximum amount of time between accesses before an element expires
+ Is only used if the element is not eternal.
+ Optional attribute. A value of 0 means that an Element can idle for infinity.
+ The default value is 0.
+
+ timeToLiveSeconds:
+ Sets the time to live for an element before it expires.
+ i.e. The maximum time between creation time and when an element expires.
+ Is only used if the element is not eternal.
+ Optional attribute. A value of 0 means that and Element can live for infinity.
+ The default value is 0.
+
+ diskPersistent:
+ Whether the disk store persists between restarts of the Virtual Machine.
+ The default value is false.
+
+ diskExpiryThreadIntervalSeconds:
+ The number of seconds between runs of the disk expiry thread. The default value
+ is 120 seconds.
+
+ memoryStoreEvictionPolicy:
+ Policy would be enforced upon reaching the maxElementsInMemory limit. Default
+ policy is Least Recently Used (specified as LRU). Other policies available -
+ First In First Out (specified as FIFO) and Less Frequently Used
+ (specified as LFU)
+
+ -->
+
+ <!--
+ Mandatory Default Cache configuration. These settings will be applied to caches
+ created programmtically using CacheManager.add(String cacheName)
+ -->
+ <defaultCache
+ maxElementsInMemory="20000"
+ eternal="true"
+ overflowToDisk="false"
+ memoryStoreEvictionPolicy="LRU"
+ />
+
+ <cache name="kiwi.core.model.rdf.KiWiNode"
+ statistics="true"
+ maxElementsInMemory="10000"
+ eternal="true"
+ overflowToDisk="false"
+ memoryStoreEvictionPolicy="LRU"/>
+
+ <cache name="at.newmedialab.lmf.versioning.model.Version"
+ statistics="true"
+ maxElementsInMemory="10000"
+ eternal="true"
+ overflowToDisk="false"
+ memoryStoreEvictionPolicy="LRU"/>
+
+
+ <cache name="kiwi.core.model.rdf.KiWiNamespace"
+ statistics="true"
+ maxElementsInMemory="100"
+ eternal="true"
+ overflowToDisk="false"
+ memoryStoreEvictionPolicy="LRU"/>
+
+ <cache name="kiwi.core.model.user.KiWiGroup"
+ statistics="true"
+ maxElementsInMemory="100"
+ eternal="true"
+ overflowToDisk="false"
+ memoryStoreEvictionPolicy="LRU"/>
+
+ <cache name="kiwi.core.model.user.KiWiUser"
+ statistics="true"
+ maxElementsInMemory="100"
+ eternal="true"
+ overflowToDisk="false"
+ memoryStoreEvictionPolicy="LRU"/>
+
+
+ <cache name="kiwi.core.model.rdf.KiWiTriple"
+ statistics="true"
+ maxElementsInMemory="100000"
+ eternal="true"
+ overflowToDisk="false"
+ memoryStoreEvictionPolicy="LRU"/>
+
+ <cache name="kiwi.reasoner.model.Pattern"
+ statistics="true"
+ maxElementsInMemory="1000"
+ eternal="true"
+ overflowToDisk="false"
+ memoryStoreEvictionPolicy="LRU"/>
+
+ <cache name="kiwi.reasoner.model.Field"
+ statistics="true"
+ maxElementsInMemory="10000"
+ eternal="true"
+ overflowToDisk="false"
+ memoryStoreEvictionPolicy="LRU"/>
+
+ <cache name="org.hibernate.cache.StandardQueryCache"
+ statistics="true"
+ maxElementsInMemory="10000"
+ eternal="true"
+ overflowToDisk="false"
+ memoryStoreEvictionPolicy="LRU"/>
+
+ <cache name="org.hibernate.cache.UpdateTimestampsCache"
+ statistics="true"
+ maxElementsInMemory="10000"
+ eternal="true"
+ overflowToDisk="false"/>
+
+ <!-- the cache used for triple queries by KiWi -->
+ <!-- the cache used for triple queries by KiWi -->
+ <cache name="uri-node-cache"
+ statistics="true"
+ maxElementsInMemory="100000"
+ timeToIdleSeconds="3600"
+ overflowToDisk="false"/>
+ <cache name="anon-node-cache"
+ statistics="true"
+ maxElementsInMemory="10000"
+ timeToIdleSeconds="3600"
+ overflowToDisk="false"/>
+ <cache name="literal-cache"
+ statistics="true"
+ maxElementsInMemory="10000"
+ timeToIdleSeconds="3600"
+ overflowToDisk="false"/>
+
+ <cache name="triple-cache"
+ statistics="true"
+ maxElementsInMemory="100000"
+ memoryStoreEvictionPolicy="LRU"
+ overflowToDisk="false"/>
+
+ <cache name="namespace-prefix-cache"
+ statistics="true"
+ maxElementsInMemory="100"
+ overflowToDisk="true"/>
+
+ <cache name="namespace-uri-cache"
+ statistics="true"
+ maxElementsInMemory="100"
+ overflowToDisk="true"/>
+
+ <!-- the cache used for triple queries by KiWi -->
+ <cache name="query-cache"
+ statistics="true"
+ maxElementsInMemory="10000"
+ timeToIdleSeconds="3600"
+ overflowToDisk="false"/>
+
+ <!-- the cache used for resource lookups from module jar files -->
+ <cache name="resource-cache"
+ statistics="true"
+ maxElementsInMemory="10000"
+ timeToIdleSeconds="3600"
+ timeToLiveSeconds="3600"
+ overflowToDisk="false"
+ memoryStoreEvictionPolicy="LRU"/>
+
+ <!-- the cache used for triple queries by KiWi -->
+ <cache name="page-cache"
+ statistics="true"
+ maxElementsInMemory="500"
+ timeToIdleSeconds="3600"
+ memoryStoreEvictionPolicy="LRU"
+ overflowToDisk="true"/>
+
+ <!-- the cache used by the file system importer module -->
+ <cache name="fsimport-file-cache"
+ statistics="true"
+ maxElementsInMemory="500"
+ timeToIdleSeconds="3600"
+ memoryStoreEvictionPolicy="LRU"
+ diskPersistent="true"
+ eternal="true"/>
+
+<!-- uncomment to enable cache debugging -->
+<!--
+ <cacheManagerPeerListenerFactory
+ class="org.terracotta.ehcachedx.monitor.probe.ProbePeerListenerFactory"
+ properties="monitorAddress=localhost, monitorPort=9889" />
+-->
+
+</ehcache>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/c32963d5/lmf-core/src/main/resources/META-INF/services/kiwi.core.api.io.RdfHtmlWriter
----------------------------------------------------------------------
diff --git a/lmf-core/src/main/resources/META-INF/services/kiwi.core.api.io.RdfHtmlWriter b/lmf-core/src/main/resources/META-INF/services/kiwi.core.api.io.RdfHtmlWriter
new file mode 100644
index 0000000..49259fe
--- /dev/null
+++ b/lmf-core/src/main/resources/META-INF/services/kiwi.core.api.io.RdfHtmlWriter
@@ -0,0 +1 @@
+at.newmedialab.templating.writer.RDFHtmlExtendedWriter
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/c32963d5/lmf-core/src/main/resources/META-INF/services/org.openrdf.rio.RDFWriterFactory
----------------------------------------------------------------------
diff --git a/lmf-core/src/main/resources/META-INF/services/org.openrdf.rio.RDFWriterFactory b/lmf-core/src/main/resources/META-INF/services/org.openrdf.rio.RDFWriterFactory
new file mode 100644
index 0000000..e1c50b6
--- /dev/null
+++ b/lmf-core/src/main/resources/META-INF/services/org.openrdf.rio.RDFWriterFactory
@@ -0,0 +1 @@
+kiwi.core.rio.RDFHtmlWriterFactory
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/c32963d5/lmf-core/src/main/resources/config-defaults.properties
----------------------------------------------------------------------
diff --git a/lmf-core/src/main/resources/config-defaults.properties b/lmf-core/src/main/resources/config-defaults.properties
new file mode 100644
index 0000000..fe3a7c4
--- /dev/null
+++ b/lmf-core/src/main/resources/config-defaults.properties
@@ -0,0 +1,217 @@
+#
+# Copyright (C) 2013 Salzburg Research.
+#
+# Licensed 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 core configuration
+###############################################################################
+
+# KiWi home directory (for configuration files etc)
+kiwi.home = /tmp/lmf
+
+# directory where KiWi stores the search index for SOLR search
+solr.home = /tmp/lmf/solr
+
+# base URI of this KiWi installation; used for constructing resource URIs
+kiwi.context = http://localhost:8080/LMF/
+
+# base URL of the KiWi installation; used for accessing additional web services like SOLR and H2
+kiwi.host = http://localhost:8080/LMF/
+
+#the path of the KiWi installation, e.g. /LMF or /KiWi
+kiwi.path = /LMF
+
+# true if the LMF system host configuration has been set up, do not change
+kiwi.setup.host = false
+
+# true if the LMF system database configuration has been set up, do not change
+kiwi.setup.database = false
+
+# kiwi startup page
+kiwi.pages.startup = core/admin/first_steps.html
+
+# lmf default style
+kiwi.pages.project = lmf
+
+# marmotta logo
+kiwi.pages.project.marmotta.logo = core/public/img/logo/marmotta-logo.png
+
+# marmotta footer
+kiwi.pages.project.marmotta.footer = Copyright © 2013 The Apache Software Foundation\, Licensed under the <a href="#">Apache License\, Version 2.0.</a><br>Apache\, Marmotta\, the Apache feather and Marmotta logos are trademarks of The Apache Software Foundation.
+
+# lmf logo
+kiwi.pages.project.lmf.logo = core/public/img/logo/lmf-logo.png
+
+# lmf footer
+kiwi.pages.project.lmf.footer = The <a href="http://lmf.googlecode.com">Linked Media Framework</a> is developed in the <a href="http://www.newmedialab.at/">SNML-TNG</a>.
+
+# supported styles
+kiwi.pages.style = blue
+
+# allow the following origins for JavaScript webservice access (sets Access-Control-Allow-Origin header)
+kiwi.allow_origin = *
+
+# allow the following HTTP methods for JavaScript webservice access (sets Access-Control-Allow-Methods header)
+kiwi.allow_methods = POST, PUT, GET, DELETE, HEAD, OPTIONS
+
+# enable or disable the logging of debugging messages for the whole system
+debug.enabled = false
+
+# the status code to use for redirects; 303 is used in the Linked Data guidelines, but 300 is more correct
+# according to HTTP
+linkeddata.redirect.status = 303
+
+
+# determines whether to issue a redirect for PUT requests; if set to true, the resource service will return
+# a redirect to the actual content or metadata location for the resource, resulting in a second request to be issued
+# by the browser; if set to false, the resource service directly processes the content/metadata upload
+linkeddata.redirect.put = false
+
+
+# default rel value for resource interaction with HTTP (MUST be 'meta' or 'content')
+linkeddata.mime.rel.default = meta
+
+
+# sort menu entries by weight instead of alphabet
+templating.sort_by_weight = true
+
+# recache templating file every time
+templating.cache.enabled = true
+
+
+###############################################################################
+# Logging configuration
+###############################################################################
+
+# configure logging for the core system; valid values: DEBUG, INFO, WARN, ERROR
+logging.kiwi.core = INFO
+
+# configure logging for the security system; valid values: DEBUG, INFO, WARN, ERROR
+logging.kiwi.core.services.security = DEBUG
+
+
+# configure logging for the reasoner; valid values: DEBUG, INFO, WARN, ERROR
+logging.kiwi.reasoner = INFO
+
+
+###############################################################################
+# Content Readers and Writers (in case a resource is requested with ;rel=content
+###############################################################################
+
+
+# a reader/writer for content stored in the file system; by default, this is applied to all resources that have
+# a file:/ URI. It is disabled by default, because it potentially allows reading/writing all files in the file system
+# to only enable reading but disable writing, remove the content.filesystem.writer property
+content.filesystem.reader=kiwi.core.services.content.FileSystemContentReader
+content.filesystem.writer=kiwi.core.services.content.FileSystemContentWriter
+content.filesystem.pattern=(${kiwi.home}/resources|${kiwi.context}resource/|urn:).*
+#content.filesystem.pattern=file:/tmp/.*
+content.filesystem.enabled=true
+# if enabled allow only access to resources stored in the LMF work directory
+content.filesystem.secure=true
+
+
+# a reader for content stored on a remote HTTP server; by default, this is applied to all resources that are not in
+# the context of the LMF web application; enabled by default, because it is a safe operation
+content.http.reader=kiwi.core.services.content.HTTPContentReader
+content.http.pattern=(?!${kiwi.context}resource)http://.*
+content.http.enabled=false
+
+###############################################################################
+# Resource Filter configuration
+###############################################################################
+
+# enable/disable browser caching of static resources; if enabled, the KiWiResourceFilter will set appropriate
+# Expires: headers in the response
+resources.browsercache.enabled = true
+
+# how many seconds should the Expires-header set for expiration of static resources?
+resources.browsercache.seconds = 3600
+
+# enable/disable server-side caching of static resources
+resources.servercache.enabled = false
+
+###############################################################################
+# LMF 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 =
+
+# 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
+
+
+###############################################################################
+# LMF importer configuration
+###############################################################################
+
+# generate KiWi title and text content for each imported resource in the RDF importer
+importer.generate_descriptions = false
+
+# commit import-transaction X items.
+importer.batchsize = 50
+
+###############################################################################
+# LMF Statistics Module
+###############################################################################
+
+# whether collecting statistics about the execution should be enabled on start or not
+statistics.enabled = true
+
+###############################################################################
+# LMF Default Prefixes
+###############################################################################
+
+# prefixes mappings
+prefix.dc = http://purl.org/dc/elements/1.1/
+prefix.dct = http://purl.org/dc/terms/
+prefix.foaf = http://xmlns.com/foaf/0.1/
+prefix.lmftypes = http://www.newmedialab.at/lmf/types/1.0/
+prefix.sioc = http://rdfs.org/sioc/ns#
+prefix.rdfs = http://www.w3.org/2000/01/rdf-schema#
+prefix.dcat = http://www.w3.org/ns/dcat#
+prefix.yt = http://gdata.youtube.com/schemas/2007#
+prefix.xsd = http://www.w3.org/2001/XMLSchema#
+prefix.owl = http://www.w3.org/2002/07/owl#
+prefix.rdf = http://www.w3.org/1999/02/22-rdf-syntax-ns#
+prefix.skos = http://www.w3.org/2004/02/skos/core#
+prefix.ldp = http://www.w3.org/ns/ldp#
+prefix.mao = http://www.w3.org/ns/ma-ont#
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/c32963d5/lmf-core/src/main/resources/config-descriptions.properties
----------------------------------------------------------------------
diff --git a/lmf-core/src/main/resources/config-descriptions.properties b/lmf-core/src/main/resources/config-descriptions.properties
new file mode 100644
index 0000000..3becae8
--- /dev/null
+++ b/lmf-core/src/main/resources/config-descriptions.properties
@@ -0,0 +1,190 @@
+#
+# Copyright (C) 2013 Salzburg Research.
+#
+# Licensed 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 core configuration
+###############################################################################
+
+kiwi.home.description = KiWi home directory (for configuration files etc)
+kiwi.home.type = java.lang.String
+
+solr.home.description = directory where KiWi stores the search index for SOLR search
+solr.home.type = java.lang.String
+
+kiwi.context.description = base URI of this KiWi installation; used for constructing resource URIs
+kiwi.context.type = java.lang.String
+
+kiwi.host.description = base URL of the KiWi installation; used for accessing additional web services like SOLR and H2
+kiwi.host.type = java.net.URL
+
+kiwi.path.description = the path of the KiWi installation, e.g. /LMF or /KiWi
+kiwi.path.type = java.lang.String
+
+kiwi.setup.host.description = true if the LMF system host configuration has been set up, do not change
+kiwi.setup.host.type = java.lang.Boolean
+
+kiwi.setup.database.description = true if the LMF system database configuration has been set up, do not change
+kiwi.setup.database.type = java.lang.Boolean
+
+kiwi.pages.startup.description = startup page to display when accessing the LMF admin page
+kiwi.pages.startup.type = java.lang.String
+
+kiwi.pages.project.description = Project for logo and footer
+kiwi.pages.project.type = java.lang.Enum("marmotta"|"lmf")
+
+kiwi.pages.style.description = stylesheet to use for LMF Admin page
+kiwi.pages.style.type = java.lang.Enum("blue"|"dark"|"white")
+
+kiwi.allow_origin.description = allow the following origins for JavaScript webservice access (sets Access-Control-Allow-Origin header); \
+ you can use the wildcard * to allow all origins
+kiwi.allow_origin.type = java.lang.String
+
+kiwi.allow_methods.description = allow the following HTTP methods for JavaScript webservice access (sets Access-Control-Allow-Methods header)
+kiwi.allow_methods.type = java.util.List
+
+debug.enabled.description = enable or disable the logging of debugging messages for the whole system
+debug.enabled.type = java.lang.Boolean
+
+linkeddata.redirect.status.description = the status code to use for redirects; 303 is used in the Linked Data \
+ guidelines, but 300 is more correct according to HTTP
+linkeddata.redirect.status.type = java.lang.Enum("300"|"301"|"302"|"303"|"304"|"305"|"306"|"307")
+
+
+linkeddata.redirect.put.description = determines whether to issue a redirect for PUT requests; if set to true, the \
+ resource service will return a redirect to the actual content or metadata location for the resource, resulting in a \
+ second request to be issued by the browser; if set to false, the resource service directly processes the \
+ content/metadata upload
+linkeddata.redirect.put.type = java.lang.Boolean
+
+linkeddata.mime.rel.default.description = default rel value for resource interaction with HTTP (MUST be 'meta' or 'content')
+linkeddata.mime.rel.default.type = java.lang.Enum("meta"|"content")
+
+templating.sort_by_weight.description = sort menu entries by weight instead of alphabet
+templating.sort_by_weight.type = java.lang.Boolean
+
+templating.cache.enabled.description = Recache templating files every time
+templating.cache.enabled.type = java.lang.Boolean
+
+
+###############################################################################
+# Logging configuration
+###############################################################################
+
+logging.kiwi.core.description = configure logging for the core system; valid values: DEBUG, INFO, WARN, ERROR
+logging.kiwi.core.type = java.lang.Enum("DEBUG"|"INFO"|"WARN"|"ERROR")
+
+logging.kiwi.core.services.security.description = configure logging for the security system; valid values: DEBUG, INFO, WARN, ERROR
+logging.kiwi.core.services.security.type = java.lang.Enum("DEBUG"|"INFO"|"WARN"|"ERROR")
+
+logging.kiwi.reasoner.description = configure logging for the reasoner; valid values: DEBUG, INFO, WARN, ERROR
+logging.kiwi.reasoner.type = java.lang.Enum("DEBUG"|"INFO"|"WARN"|"ERROR")
+
+
+
+###############################################################################
+# Content Readers and Writers (in case a resource is requested with ;rel=content
+###############################################################################
+
+# a reader/writer for content stored in the triple store; by default, this is applied to resources directly served
+# from this LMF installation
+content.triplestore.reader.description = a reader/writer for content stored in the triple store; by default, this is applied to resources directly served from this LMF installation
+content.triplestore.reader.type = java.lang.String
+
+content.triplestore.writer.type = java.lang.String
+
+content.triplestore.pattern.type = java.lang.String
+
+content.triplestore.enabled.type = java.lang.Boolean
+#content.triplestore.enabled=true
+
+# a reader/writer for content stored in the file system; by default, this is applied to all resources that have
+# a file:/ URI. It is disabled by default, because it potentially allows reading/writing all files in the file system
+# to only enable reading but disable writing, remove the content.filesystem.writer property
+content.filesystem.reader.description = a reader/writer for content stored in the file system; by default, this is applied to all resources that have a file:/ URI. It is disabled by default, because it potentially allows reading/writing all files in the file system to only enable reading but disable writing, remove the content.filesystem.writer property
+content.filesystem.reader.type = java.lang.String
+
+content.filesystem.writer.type = java.lang.String
+
+content.filesystem.pattern.type = java.lang.String
+
+content.filesystem.enabled.type = java.lang.Boolean
+
+content.filesystem.secure.description = if enabled allow only access to resources stored in the LMF work directory
+content.filesystem.secure.type = java.lang.Boolean
+
+
+# a reader for content stored on a remote HTTP server; by default, this is applied to all resources that are not in
+# the context of the LMF web application; enabled by default, because it is a safe operation
+content.http.reader.description = a reader for content stored on a remote HTTP server; by default, this is applied to all resources that are not in the context of the LMF web application; enabled by default, because it is a safe operation
+content.http.reader.type = java.lang.String
+
+content.http.pattern.type = java.lang.String
+
+content.http.enabled.type = java.lang.Boolean
+
+###############################################################################
+# Resource Filter configuration
+###############################################################################
+
+resources.browsercache.enabled.description = enable/disable browser caching of static resources; if enabled, the \
+ KiWiResourceFilter will set appropriate Expires: headers in the response
+resources.browsercache.enabled.type = java.lang.Boolean
+
+resources.browsercache.seconds.description = ow many seconds should the Expires-header set for expiration of static resources?
+resources.browsercache.seconds.type = java.lang.Integer(60|0|*)
+
+resources.servercache.enabled.description = enable/disable server-side caching of static resources
+resources.servercache.enabled.type = java.lang.Boolean
+
+###############################################################################
+# 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")
+
+
+
+###############################################################################
+# LMF importer configuration
+###############################################################################
+
+importer.generate_descriptions.description = generate KiWi title and text content for each imported resource in the RDF importer
+importer.generate_descriptions.type = java.lang.Boolean
+
+importer.batchsize.description = commit import-transaction X items
+importer.batchsize.type = java.lang.Integer(10|0|*)
+
+###############################################################################
+# LMF Statistics Module
+###############################################################################
+
+# whether collecting statistics about the execution should be enabled on start or not
+statistics.enabled.description = true
+statistics.enabled.type = java.lang.Boolean
+
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/c32963d5/lmf-core/src/main/resources/jndi.properties
----------------------------------------------------------------------
diff --git a/lmf-core/src/main/resources/jndi.properties b/lmf-core/src/main/resources/jndi.properties
new file mode 100644
index 0000000..c57dbad
--- /dev/null
+++ b/lmf-core/src/main/resources/jndi.properties
@@ -0,0 +1,17 @@
+#
+# Copyright (C) 2013 Salzburg Research.
+#
+# Licensed 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.
+#
+
+java.naming.factory.initial=kiwi.core.jndi.LMFContextFactory
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/c32963d5/lmf-core/src/main/resources/kiwi-module.properties
----------------------------------------------------------------------
diff --git a/lmf-core/src/main/resources/kiwi-module.properties b/lmf-core/src/main/resources/kiwi-module.properties
new file mode 100644
index 0000000..28eef1f
--- /dev/null
+++ b/lmf-core/src/main/resources/kiwi-module.properties
@@ -0,0 +1,55 @@
+#
+# Copyright (C) 2013 Salzburg Research.
+#
+# Licensed 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=Core Services
+
+subtitle = Configure LMF Core
+weight = 10
+
+icon_small = /admin/img/config_small.png
+
+#do not change!!!
+baseurl=/core
+
+adminpages=/admin/first_steps.html,\
+ /admin/about.html,\
+ /admin/configuration.html,\
+ /admin/tasks.html,\
+ /admin/import.html,\
+ /admin/export.html,\
+ /admin/dataview.html,\
+ /admin/contexts.html,\
+ /admin/prefixes.html,\
+ /admin/system.html,\
+ /admin/database.html,
+
+webservices=kiwi.core.webservices.config.ConfigurationWebService,\
+ kiwi.core.webservices.config.DependenciesWebService,\
+ kiwi.core.webservices.system.SystemWebService,\
+ kiwi.core.webservices.task.TaskManagerWebService,\
+ kiwi.core.webservices.io.ImportWebService,\
+ kiwi.core.webservices.io.ExportWebService,\
+ kiwi.core.webservices.statistics.StatisticsWebService,\
+ kiwi.core.webservices.modules.ModuleWebService,\
+ kiwi.core.webservices.resource.ResourceWebService,\
+ kiwi.core.webservices.resource.MetaWebService,\
+ kiwi.core.webservices.resource.ContentWebService,\
+ kiwi.core.webservices.resource.InspectionWebService,\
+ kiwi.core.webservices.triplestore.LdpWebService,\
+ kiwi.core.webservices.triplestore.ContextWebService,\
+ kiwi.core.webservices.triplestore.KnowledgeSpaceWebService,\
+ kiwi.core.webservices.prefix.PrefixWebService
+
\ No newline at end of file