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:00 UTC

[30/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/ldclient/ldclient-provider-phpbb/.project
----------------------------------------------------------------------
diff --git a/ldclient/ldclient-provider-phpbb/.project b/ldclient/ldclient-provider-phpbb/.project
new file mode 100644
index 0000000..1f18556
--- /dev/null
+++ b/ldclient/ldclient-provider-phpbb/.project
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>ldclient-provider-phpbb</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>org.eclipse.wst.common.project.facet.core.builder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.jdt.core.javabuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.m2e.core.maven2Builder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.wst.validation.validationbuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>org.eclipse.jem.workbench.JavaEMFNature</nature>
+		<nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature>
+		<nature>org.eclipse.jdt.core.javanature</nature>
+		<nature>org.eclipse.m2e.core.maven2Nature</nature>
+		<nature>org.eclipse.wst.common.project.facet.core.nature</nature>
+	</natures>
+</projectDescription>

http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/c32963d5/ldclient/ldclient-provider-phpbb/.settings/org.eclipse.core.resources.prefs
----------------------------------------------------------------------
diff --git a/ldclient/ldclient-provider-phpbb/.settings/org.eclipse.core.resources.prefs b/ldclient/ldclient-provider-phpbb/.settings/org.eclipse.core.resources.prefs
new file mode 100644
index 0000000..8fb0e26
--- /dev/null
+++ b/ldclient/ldclient-provider-phpbb/.settings/org.eclipse.core.resources.prefs
@@ -0,0 +1,3 @@
+eclipse.preferences.version=1
+encoding//src/main/java=UTF-8
+encoding//src/main/resources=UTF-8

http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/c32963d5/ldclient/ldclient-provider-phpbb/.settings/org.eclipse.jdt.core.prefs
----------------------------------------------------------------------
diff --git a/ldclient/ldclient-provider-phpbb/.settings/org.eclipse.jdt.core.prefs b/ldclient/ldclient-provider-phpbb/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 0000000..69c31cd
--- /dev/null
+++ b/ldclient/ldclient-provider-phpbb/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,8 @@
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
+org.eclipse.jdt.core.compiler.compliance=1.6
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
+org.eclipse.jdt.core.compiler.source=1.6

http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/c32963d5/ldclient/ldclient-provider-phpbb/.settings/org.eclipse.m2e.core.prefs
----------------------------------------------------------------------
diff --git a/ldclient/ldclient-provider-phpbb/.settings/org.eclipse.m2e.core.prefs b/ldclient/ldclient-provider-phpbb/.settings/org.eclipse.m2e.core.prefs
new file mode 100644
index 0000000..f897a7f
--- /dev/null
+++ b/ldclient/ldclient-provider-phpbb/.settings/org.eclipse.m2e.core.prefs
@@ -0,0 +1,4 @@
+activeProfiles=
+eclipse.preferences.version=1
+resolveWorkspaceProjects=true
+version=1

http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/c32963d5/ldclient/ldclient-provider-phpbb/.settings/org.eclipse.wst.common.component
----------------------------------------------------------------------
diff --git a/ldclient/ldclient-provider-phpbb/.settings/org.eclipse.wst.common.component b/ldclient/ldclient-provider-phpbb/.settings/org.eclipse.wst.common.component
new file mode 100644
index 0000000..034e780
--- /dev/null
+++ b/ldclient/ldclient-provider-phpbb/.settings/org.eclipse.wst.common.component
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project-modules id="moduleCoreId" project-version="1.5.0">
+    <wb-module deploy-name="ldclient-provider-phpbb">
+        <wb-resource deploy-path="/" source-path="/src/main/java"/>
+        <wb-resource deploy-path="/" source-path="/src/main/resources"/>
+    </wb-module>
+</project-modules>

http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/c32963d5/ldclient/ldclient-provider-phpbb/.settings/org.eclipse.wst.common.project.facet.core.xml
----------------------------------------------------------------------
diff --git a/ldclient/ldclient-provider-phpbb/.settings/org.eclipse.wst.common.project.facet.core.xml b/ldclient/ldclient-provider-phpbb/.settings/org.eclipse.wst.common.project.facet.core.xml
new file mode 100644
index 0000000..c78d932
--- /dev/null
+++ b/ldclient/ldclient-provider-phpbb/.settings/org.eclipse.wst.common.project.facet.core.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<faceted-project>
+  <installed facet="java" version="1.6"/>
+  <installed facet="jst.utility" version="1.0"/>
+</faceted-project>

http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/c32963d5/ldclient/ldclient-provider-phpbb/pom.xml
----------------------------------------------------------------------
diff --git a/ldclient/ldclient-provider-phpbb/pom.xml b/ldclient/ldclient-provider-phpbb/pom.xml
new file mode 100644
index 0000000..5161741
--- /dev/null
+++ b/ldclient/ldclient-provider-phpbb/pom.xml
@@ -0,0 +1,57 @@
+<?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.
+  -->
+
+<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>at.newmedialab.lmf</groupId>
+        <artifactId>ldclient-parent</artifactId>
+        <version>3.0.0-SNAPSHOT</version>
+    </parent>
+
+    <artifactId>ldclient-provider-phpbb</artifactId>
+    <name>LDClient Provider: PHPBB Resource Access</name>
+
+    <description>
+        This package provides access to posts, topics and forums stored in a PHPBB installation and maps them to
+        the SIOC ontology to represent the information in RDF. This package is experimental, as PHPBB does not provide
+        proper API access over web services. The providers try parsing the HTML content instead.
+    </description>
+
+    <dependencies>
+        <dependency>
+            <groupId>at.newmedialab.lmf</groupId>
+            <artifactId>ldclient-api</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>at.newmedialab.lmf</groupId>
+            <artifactId>ldclient-core</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>at.newmedialab.lmf</groupId>
+            <artifactId>ldclient-provider-html</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>at.newmedialab.sesame</groupId>
+            <artifactId>sesame-commons</artifactId>
+        </dependency>
+
+    </dependencies>
+
+</project>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/c32963d5/ldclient/ldclient-provider-phpbb/src/main/java/org/apache/marmotta/ldclient/endpoint/phpbb/PHPBBEndpoints.java
----------------------------------------------------------------------
diff --git a/ldclient/ldclient-provider-phpbb/src/main/java/org/apache/marmotta/ldclient/endpoint/phpbb/PHPBBEndpoints.java b/ldclient/ldclient-provider-phpbb/src/main/java/org/apache/marmotta/ldclient/endpoint/phpbb/PHPBBEndpoints.java
new file mode 100644
index 0000000..916ec6f
--- /dev/null
+++ b/ldclient/ldclient-provider-phpbb/src/main/java/org/apache/marmotta/ldclient/endpoint/phpbb/PHPBBEndpoints.java
@@ -0,0 +1,46 @@
+/**
+ * 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 org.apache.marmotta.ldclient.endpoint.phpbb;
+
+import org.apache.marmotta.ldclient.api.endpoint.Endpoint;
+
+import java.util.HashSet;
+import java.util.Set;
+import java.util.regex.Pattern;
+
+/**
+ * Utility class for simplifying registering of PHPBB endpoints
+ * <p/>
+ * Author: Sebastian Schaffert (sschaffert@apache.org)
+ */
+public class PHPBBEndpoints {
+
+    /**
+     * Construct a set of PHPBB endpoints from a PHPBB base URL and a name
+     *
+     * @param phpBBUrl base URL of the PHPBB installation, e.g. "http://www.carving-ski.de/phpBB/"
+     * @param name a name for the endpoints (e.g. "carving-ski.de")
+     * @return a forum endpoint, a post endpoint and a topic endpoint
+     */
+    public static Set<Endpoint> getEndpoints(String phpBBUrl, String name) {
+        Set<Endpoint> result = new HashSet<Endpoint>();
+        String pattern = "^" + Pattern.quote(phpBBUrl);
+        result.add(new PHPBBForumEndpoint("PHPBB Forum ("+name+")", pattern + "viewforum.php\\?.*f=.*"));
+        result.add(new PHPBBTopicEndpoint("PHPBB Topics ("+name+")", pattern + "viewtopic.php\\?.*t=.*"));
+        result.add(new PHPBBPostEndpoint("PHPBB Posts ("+name+")", pattern + "viewtopic.php\\?.*p=.*"));
+        return result;
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/c32963d5/ldclient/ldclient-provider-phpbb/src/main/java/org/apache/marmotta/ldclient/endpoint/phpbb/PHPBBForumEndpoint.java
----------------------------------------------------------------------
diff --git a/ldclient/ldclient-provider-phpbb/src/main/java/org/apache/marmotta/ldclient/endpoint/phpbb/PHPBBForumEndpoint.java b/ldclient/ldclient-provider-phpbb/src/main/java/org/apache/marmotta/ldclient/endpoint/phpbb/PHPBBForumEndpoint.java
new file mode 100644
index 0000000..972c537
--- /dev/null
+++ b/ldclient/ldclient-provider-phpbb/src/main/java/org/apache/marmotta/ldclient/endpoint/phpbb/PHPBBForumEndpoint.java
@@ -0,0 +1,35 @@
+/**
+ * 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 org.apache.marmotta.ldclient.endpoint.phpbb;
+
+import org.apache.marmotta.commons.http.ContentType;
+import org.apache.marmotta.ldclient.api.endpoint.Endpoint;
+import org.apache.marmotta.ldclient.provider.phpbb.PHPBBForumProvider;
+
+/**
+ * Create a new PHPBBForumEndpoint; the URL pattern for the forum needs to be passed as argument, e.g.
+ * "^http://www\\.carving-ski\\.de/phpBB/viewforum.php\\?.*f=.*"
+ * <p/>
+ * Author: Sebastian Schaffert (sschaffert@apache.org)
+ */
+public class PHPBBForumEndpoint extends Endpoint {
+
+    public PHPBBForumEndpoint(String name, String urlPattern) {
+        super(name, PHPBBForumProvider.PROVIDER_NAME, urlPattern, null, 86400L);
+        setPriority(PRIORITY_HIGH);
+        addContentType(new ContentType("text", "html"));
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/c32963d5/ldclient/ldclient-provider-phpbb/src/main/java/org/apache/marmotta/ldclient/endpoint/phpbb/PHPBBPostEndpoint.java
----------------------------------------------------------------------
diff --git a/ldclient/ldclient-provider-phpbb/src/main/java/org/apache/marmotta/ldclient/endpoint/phpbb/PHPBBPostEndpoint.java b/ldclient/ldclient-provider-phpbb/src/main/java/org/apache/marmotta/ldclient/endpoint/phpbb/PHPBBPostEndpoint.java
new file mode 100644
index 0000000..ebef2fe
--- /dev/null
+++ b/ldclient/ldclient-provider-phpbb/src/main/java/org/apache/marmotta/ldclient/endpoint/phpbb/PHPBBPostEndpoint.java
@@ -0,0 +1,35 @@
+/**
+ * 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 org.apache.marmotta.ldclient.endpoint.phpbb;
+
+import org.apache.marmotta.commons.http.ContentType;
+import org.apache.marmotta.ldclient.api.endpoint.Endpoint;
+import org.apache.marmotta.ldclient.provider.phpbb.PHPBBPostProvider;
+
+/**
+ * Create a new PHPBBForumEndpoint; the URL pattern for the forum needs to be passed as argument, e.g.
+ * "^http://www\\.carving-ski\\.de/phpBB/viewtopic.php\\?.*p=.*"
+ * <p/>
+ * Author: Sebastian Schaffert (sschaffert@apache.org)
+ */
+public class PHPBBPostEndpoint extends Endpoint {
+
+    public PHPBBPostEndpoint(String name, String urlPattern) {
+        super(name, PHPBBPostProvider.PROVIDER_NAME, urlPattern, null, 86400L);
+        setPriority(PRIORITY_HIGH);
+        addContentType(new ContentType("text", "html"));
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/c32963d5/ldclient/ldclient-provider-phpbb/src/main/java/org/apache/marmotta/ldclient/endpoint/phpbb/PHPBBTopicEndpoint.java
----------------------------------------------------------------------
diff --git a/ldclient/ldclient-provider-phpbb/src/main/java/org/apache/marmotta/ldclient/endpoint/phpbb/PHPBBTopicEndpoint.java b/ldclient/ldclient-provider-phpbb/src/main/java/org/apache/marmotta/ldclient/endpoint/phpbb/PHPBBTopicEndpoint.java
new file mode 100644
index 0000000..a22918c
--- /dev/null
+++ b/ldclient/ldclient-provider-phpbb/src/main/java/org/apache/marmotta/ldclient/endpoint/phpbb/PHPBBTopicEndpoint.java
@@ -0,0 +1,35 @@
+/**
+ * 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 org.apache.marmotta.ldclient.endpoint.phpbb;
+
+import org.apache.marmotta.commons.http.ContentType;
+import org.apache.marmotta.ldclient.api.endpoint.Endpoint;
+import org.apache.marmotta.ldclient.provider.phpbb.PHPBBTopicProvider;
+
+/**
+ * Create a new PHPBBForumEndpoint; the URL pattern for the forum needs to be passed as argument, e.g.
+ * "^http://www\\.carving-ski\\.de/phpBB/viewtopic.php\\?.*t=.*"
+ * <p/>
+ * Author: Sebastian Schaffert (sschaffert@apache.org)
+ */
+public class PHPBBTopicEndpoint extends Endpoint {
+
+    public PHPBBTopicEndpoint(String name, String urlPattern) {
+        super(name, PHPBBTopicProvider.PROVIDER_NAME, urlPattern, null, 86400L);
+        setPriority(PRIORITY_HIGH);
+        addContentType(new ContentType("text", "html"));
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/c32963d5/ldclient/ldclient-provider-phpbb/src/main/java/org/apache/marmotta/ldclient/provider/phpbb/PHPBBForumProvider.java
----------------------------------------------------------------------
diff --git a/ldclient/ldclient-provider-phpbb/src/main/java/org/apache/marmotta/ldclient/provider/phpbb/PHPBBForumProvider.java b/ldclient/ldclient-provider-phpbb/src/main/java/org/apache/marmotta/ldclient/provider/phpbb/PHPBBForumProvider.java
new file mode 100644
index 0000000..d231b41
--- /dev/null
+++ b/ldclient/ldclient-provider-phpbb/src/main/java/org/apache/marmotta/ldclient/provider/phpbb/PHPBBForumProvider.java
@@ -0,0 +1,182 @@
+/**
+ * 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 org.apache.marmotta.ldclient.provider.phpbb;
+
+import at.newmedialab.sesame.commons.model.Namespaces;
+import com.google.common.collect.ImmutableList;
+import org.apache.http.NameValuePair;
+import org.apache.http.client.utils.URLEncodedUtils;
+import org.apache.marmotta.ldclient.api.endpoint.Endpoint;
+import org.apache.marmotta.ldclient.api.provider.DataProvider;
+import org.apache.marmotta.ldclient.provider.html.AbstractHTMLDataProvider;
+import org.apache.marmotta.ldclient.provider.html.mapping.CssTextLiteralMapper;
+import org.apache.marmotta.ldclient.provider.html.mapping.JSoupMapper;
+import org.apache.marmotta.ldclient.provider.phpbb.mapping.PHPBBForumHrefMapper;
+import org.apache.marmotta.ldclient.provider.phpbb.mapping.PHPBBTopicHrefMapper;
+import org.jsoup.nodes.Document;
+import org.jsoup.nodes.Element;
+
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * A wrapper that allows wrapping a whole PHPBB Forum, linking to all its topics. The resource will
+ * be of type
+ * sioc:Forum, have a dc:title, and have a sioc:container_of relation to all threads
+ * <p/>
+ * Author: Sebastian Schaffert
+ */
+public class PHPBBForumProvider extends AbstractHTMLDataProvider implements DataProvider {
+
+
+    public static final String PROVIDER_NAME = "PHPBB Forum";
+
+    /**
+     * Return a list of URIs that should be added as types for each processed resource.
+     * 
+     * @return
+     * @param resource
+     */
+    @Override
+    protected List<String> getTypes(org.openrdf.model.URI resource) {
+        return ImmutableList.of(
+                Namespaces.NS_SIOC + "Forum",
+                Namespaces.NS_SIOC + "Collection",
+                Namespaces.NS_FOAF + "Document"
+                );
+    }
+
+    /**
+     * Return a mapping table mapping from RDF properties to XPath Value Mappers. Each entry in the
+     * map is evaluated
+     * in turn; in case the XPath expression yields a result, the property is added for the
+     * processed resource.
+     * 
+     * @return
+     * @param requestUrl
+     */
+    @Override
+    protected Map<String, JSoupMapper> getMappings(String resource, String requestUrl) {
+        URI uri = null;
+        try {
+            uri = new URI(requestUrl);
+            Map<String, String> params = new HashMap<String, String>();
+            for (NameValuePair p : URLEncodedUtils.parse(uri, "UTF-8")) {
+                params.put(p.getName(), p.getValue());
+            }
+
+            if (params.containsKey("f")) {
+
+                Map<String, JSoupMapper> postMappings = new HashMap<String, JSoupMapper>();
+                if (params.containsKey("start")) {
+                    // when start is set, we only take the replies; we are in a second or further
+                    // page of the topic
+                    postMappings.put(Namespaces.NS_SIOC + "container_of", new PHPBBTopicHrefMapper("a.topictitle"));
+                } else {
+                    // otherwise we also take the initial title, creator and date for the topic
+                    postMappings.put(Namespaces.NS_DC + "title", new CssTextLiteralMapper("div#pageheader a.titles"));
+                    postMappings.put(Namespaces.NS_DC + "description", new CssTextLiteralMapper("div#pageheader span.forumdesc"));
+                    postMappings.put(Namespaces.NS_SIOC + "container_of", new PHPBBTopicHrefMapper("a.topictitle"));
+
+                    postMappings.put(Namespaces.NS_SIOC + "parent_of", new PHPBBForumHrefMapper("a.forumlink, a.forumtitle"));
+                }
+
+                return postMappings;
+            } else
+                throw new RuntimeException("the requested resource does not seem to identify a PHPBB Forum (t=... parameter missing)");
+
+        } catch (URISyntaxException e) {
+            throw new RuntimeException("the requested resource does not seem to identify a PHPBB Forum (URI syntax error)");
+        }
+
+    }
+
+    /**
+     * Return the name of this data provider. To be used e.g. in the configuration and in log
+     * messages.
+     * 
+     * @return
+     */
+    @Override
+    public String getName() {
+        return PROVIDER_NAME;
+    }
+
+    /**
+     * Return the list of mime types accepted by this data provider.
+     * 
+     * @return
+     */
+    @Override
+    public String[] listMimeTypes() {
+        return new String[] { "text/html" };
+    }
+
+    /**
+     * Build the URL to use to call the webservice in order to retrieve the data for the resource
+     * passed as argument.
+     * In many cases, this will just return the URI of the resource (e.g. Linked Data), but there
+     * might be data providers
+     * that use different means for accessing the data for a resource, e.g. SPARQL or a Cache.
+     * 
+     *
+     * @param resource
+     * @param endpoint endpoint configuration for the data provider (optional)
+     * @return
+     */
+    @Override
+    public List<String> buildRequestUrl(String resource, Endpoint endpoint) {
+        return Collections.singletonList(resource);
+    }
+
+    /**
+     * Try to find further URLs in the document that need to be requested to complete the resource
+     * data.
+     * Used e.g. to parse the result of paging in HTML pages. The default implementation returns an
+     * empty list.
+     * <p/>
+     * This implementation tries to locate the paging area of PHPBB and selects the last link of the
+     * paging, which will be the "next" page.
+     * 
+     * @param document
+     * @param requestUrl
+     * @return
+     */
+    @Override
+    protected List<String> findAdditionalRequestUrls(String resource, Document document, String requestUrl) {
+        List<String> result = new LinkedList<String>();
+
+        // return the next page in the result list
+        String foo = "a[href*='start='][href*='viewforum.php']";
+
+        List<Element> values = document.select(foo);
+        for (Element e : values) {
+            String baseUrl = e.absUrl("href");
+            if (baseUrl.length() > 0) {
+                result.add(baseUrl);
+            }
+        }
+
+        return result;
+
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/c32963d5/ldclient/ldclient-provider-phpbb/src/main/java/org/apache/marmotta/ldclient/provider/phpbb/PHPBBPostProvider.java
----------------------------------------------------------------------
diff --git a/ldclient/ldclient-provider-phpbb/src/main/java/org/apache/marmotta/ldclient/provider/phpbb/PHPBBPostProvider.java b/ldclient/ldclient-provider-phpbb/src/main/java/org/apache/marmotta/ldclient/provider/phpbb/PHPBBPostProvider.java
new file mode 100644
index 0000000..c85a69a
--- /dev/null
+++ b/ldclient/ldclient-provider-phpbb/src/main/java/org/apache/marmotta/ldclient/provider/phpbb/PHPBBPostProvider.java
@@ -0,0 +1,170 @@
+/**
+ * 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 org.apache.marmotta.ldclient.provider.phpbb;
+
+import at.newmedialab.sesame.commons.model.Namespaces;
+import com.google.common.collect.ImmutableList;
+import org.apache.http.NameValuePair;
+import org.apache.http.client.utils.URLEncodedUtils;
+import org.apache.marmotta.ldclient.api.endpoint.Endpoint;
+import org.apache.marmotta.ldclient.api.provider.DataProvider;
+import org.apache.marmotta.ldclient.provider.html.AbstractHTMLDataProvider;
+import org.apache.marmotta.ldclient.provider.html.mapping.CssTextLiteralMapper;
+import org.apache.marmotta.ldclient.provider.html.mapping.JSoupMapper;
+import org.apache.marmotta.ldclient.provider.phpbb.mapping.PHPBBDateMapper;
+import org.jsoup.nodes.Element;
+import org.jsoup.select.Elements;
+import org.openrdf.model.Value;
+import org.openrdf.model.ValueFactory;
+
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * Wrap a PHPBB Forum Post and try to extract the content from the HTML page using typical patterns.
+ * <p/>
+ * Author: Sebastian Schaffert
+ */
+public class PHPBBPostProvider extends AbstractHTMLDataProvider implements DataProvider {
+
+    public static final String PROVIDER_NAME = "PHPBB Forum Post";
+
+    /**
+     * Return a list of URIs that should be added as types for each processed resource.
+     * 
+     * @return
+     * @param resource
+     */
+    @Override
+    protected List<String> getTypes(org.openrdf.model.URI resource) {
+        return ImmutableList.of(
+                Namespaces.NS_SIOC_TYPES + "BoardPost",
+                Namespaces.NS_SIOC + "Post",
+                Namespaces.NS_FOAF + "Document"
+                );
+    }
+
+    /**
+     * Return a mapping table mapping from RDF properties to XPath Value Mappers. Each entry in the
+     * map is evaluated
+     * in turn; in case the XPath expression yields a result, the property is added for the
+     * processed resource.
+     * 
+     * @return
+     * @param requestUrl
+     */
+    @Override
+    protected Map<String, JSoupMapper> getMappings(String resource, String requestUrl) {
+        URI uri = null;
+        try {
+            uri = new URI(requestUrl);
+            Map<String, String> params = new HashMap<String, String>();
+            for (NameValuePair p : URLEncodedUtils.parse(uri, "UTF-8")) {
+                params.put(p.getName(), p.getValue());
+            }
+
+            if (params.containsKey("p")) {
+                // mappings for a reply that has directly been addressed using the ?p=... parameter
+                // to viewtopic.php, e.g. http://www.carving-ski.de/phpBB/viewtopic.php?p=119208
+                Map<String, JSoupMapper> commentMappings = new HashMap<String, JSoupMapper>();
+                commentMappings.put(Namespaces.NS_DC + "title",
+                        new CssTextLiteralMapper(String.format("div#pagecontent table:has(a[name=p%s]) td.gensmall div", params.get("p"))) {
+                    @Override
+                    public List<Value> map(String resourceUri, Element elem, ValueFactory factory) {
+                        final String val = elem.ownText().replaceFirst("^\\s*:", "").replaceAll("&nbsp;", " ").trim();
+                        if (datatype != null)
+                            return Collections.singletonList((Value) factory.createLiteral(val,
+                                    factory.createURI(Namespaces.NS_XSD + datatype)));
+                        else
+                            return Collections.singletonList((Value) factory.createLiteral(val));
+                    }
+
+                    @Override
+                    public Elements select(Element htmlDoc) {
+                        final Element first = super.select(htmlDoc).first();
+                        return first != null ? new Elements(first) : new Elements();
+                    }
+                });
+                commentMappings.put(Namespaces.NS_DC + "creator",
+                        new CssTextLiteralMapper(String.format("div#pagecontent table:has(a[name=p%s]) .postauthor", params.get("p"))));
+                commentMappings.put(Namespaces.NS_DC + "description",
+                        new CssTextLiteralMapper(String.format("div#pagecontent table:has(a[name=p%s]) div.postbody", params.get("p"))));
+                commentMappings.put(Namespaces.NS_DC + "date",
+                        new PHPBBDateMapper(String.format("div#pagecontent td.gensmall:has(a[name=p%s]) div", params.get("p"))) {
+                    @Override
+                    public Elements select(Element htmlDoc) {
+                        final Elements sel = super.select(htmlDoc);
+                        if (sel.size() > 0) {
+                            final Element e = sel.get(1);
+                            if (e != null)
+                                return new Elements(e);
+                        }
+                        return new Elements();
+                    }
+                });
+
+                return commentMappings;
+            } else
+                throw new RuntimeException("the requested resource does not seem to identify a PHPBB Post (p=... parameter missing)");
+
+        } catch (URISyntaxException e) {
+            throw new RuntimeException("the requested resource does not seem to identify a PHPBB Post (URI syntax error)");
+        }
+
+    }
+
+    /**
+     * Return the name of this data provider. To be used e.g. in the configuration and in log
+     * messages.
+     * 
+     * @return
+     */
+    @Override
+    public String getName() {
+        return PROVIDER_NAME;
+    }
+
+    /**
+     * Return the list of mime types accepted by this data provider.
+     * 
+     * @return
+     */
+    @Override
+    public String[] listMimeTypes() {
+        return new String[] { "text/html" };
+    }
+
+    /**
+     * Build the URL to use to call the webservice in order to retrieve the data for the resource
+     * passed as argument.
+     * In many cases, this will just return the URI of the resource (e.g. Linked Data), but there
+     * might be data providers
+     * that use different means for accessing the data for a resource, e.g. SPARQL or a Cache.
+     * 
+     *
+     * @param resource
+     * @param endpoint endpoint configuration for the data provider (optional)
+     * @return
+     */
+    @Override
+    public List<String> buildRequestUrl(String resource, Endpoint endpoint) {
+        return Collections.singletonList(resource);
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/c32963d5/ldclient/ldclient-provider-phpbb/src/main/java/org/apache/marmotta/ldclient/provider/phpbb/PHPBBTopicProvider.java
----------------------------------------------------------------------
diff --git a/ldclient/ldclient-provider-phpbb/src/main/java/org/apache/marmotta/ldclient/provider/phpbb/PHPBBTopicProvider.java b/ldclient/ldclient-provider-phpbb/src/main/java/org/apache/marmotta/ldclient/provider/phpbb/PHPBBTopicProvider.java
new file mode 100644
index 0000000..b57ebd1
--- /dev/null
+++ b/ldclient/ldclient-provider-phpbb/src/main/java/org/apache/marmotta/ldclient/provider/phpbb/PHPBBTopicProvider.java
@@ -0,0 +1,202 @@
+/**
+ * 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 org.apache.marmotta.ldclient.provider.phpbb;
+
+import at.newmedialab.sesame.commons.model.Namespaces;
+import com.google.common.collect.ImmutableList;
+import org.apache.http.NameValuePair;
+import org.apache.http.client.utils.URLEncodedUtils;
+import org.apache.marmotta.ldclient.api.endpoint.Endpoint;
+import org.apache.marmotta.ldclient.provider.html.AbstractHTMLDataProvider;
+import org.apache.marmotta.ldclient.provider.html.mapping.CssSelectorMapper;
+import org.apache.marmotta.ldclient.provider.html.mapping.CssTextLiteralMapper;
+import org.apache.marmotta.ldclient.provider.html.mapping.JSoupMapper;
+import org.apache.marmotta.ldclient.provider.phpbb.mapping.PHPBBDateMapper;
+import org.apache.marmotta.ldclient.provider.phpbb.mapping.PHPBBForumHrefMapper;
+import org.apache.marmotta.ldclient.provider.phpbb.mapping.PHPBBPostIdMapper;
+import org.jsoup.nodes.Document;
+import org.jsoup.nodes.Element;
+import org.jsoup.select.Elements;
+
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * Retrieve and parse a whole PHPBB topic; will try to use paging to retrieve all relevant HTML pages. The
+ * resource will be represented as a sioc:Container with the title of the first post in the page and sioc:has_reply
+ * to all individual posts.
+ * <p/>
+ * Author: Sebastian Schaffert
+ */
+public class PHPBBTopicProvider extends AbstractHTMLDataProvider {
+
+
+    public static final String PROVIDER_NAME = "PHPBB Forum Topic";
+
+
+    /**
+     * Return a list of URIs that should be added as types for each processed resource.
+     *
+     * @return
+     * @param resource
+     */
+    @Override
+    protected List<String> getTypes(org.openrdf.model.URI resource) {
+        return ImmutableList.of(
+                Namespaces.NS_SIOC + "Thread",
+                Namespaces.NS_SIOC + "Collection",
+                Namespaces.NS_FOAF + "Document"
+                );
+    }
+
+    /**
+     * Return a mapping table mapping from RDF properties to XPath Value Mappers. Each entry in the map is evaluated
+     * in turn; in case the XPath expression yields a result, the property is added for the processed resource.
+     *
+     * @return
+     * @param requestUrl
+     */
+    @Override
+    protected Map<String, JSoupMapper> getMappings(String resource, String requestUrl) {
+        URI uri = null;
+        try {
+            uri = new URI(requestUrl);
+            Map<String,String> params = new HashMap<String, String>();
+            for(NameValuePair p : URLEncodedUtils.parse(uri, "UTF-8")) {
+                params.put(p.getName(),p.getValue());
+            }
+
+            if(params.containsKey("t")) {
+
+                Map<String, JSoupMapper> postMappings = new HashMap<String, JSoupMapper>();
+                if(params.containsKey("start")) {
+                    // when start is set, we only take the replies; we are in a second or further page of the topic
+                    postMappings.put(Namespaces.NS_SIOC + "container_of", new PHPBBPostIdMapper("div#pagecontent table td.gensmall a[name]"));
+                } else {
+                    // otherwise we also take the initial title, creator and date for the topic
+                    postMappings.put(Namespaces.NS_DC + "title", new CssTextLiteralMapper("div#pageheader a.titles"));
+                    postMappings.put(Namespaces.NS_DC + "creator", new CssTextLiteralMapper(new CssSelectorMapper.Selector() {
+                        @Override
+                        public Elements select(Element node) {
+                            final Element first = node.select("div#pagecontent table b.postauthor").first();
+                            if (first != null)
+                                return new Elements(first);
+                            return new Elements();
+                        }
+                    }));
+                    postMappings.put(Namespaces.NS_DC + "date", new PHPBBDateMapper("div#pagecontent table td.gensmall div") {
+                        @Override
+                        public Elements select(Element htmlDoc) {
+                            final Elements sel = super.select(htmlDoc);
+                            if (sel.size() > 0) {
+                                final Element e = sel.get(1);
+                                if (e != null)
+                                    return new Elements(e);
+                            }
+                            return new Elements();
+                        }
+                    });
+                    postMappings.put(Namespaces.NS_SIOC + "has_container", new PHPBBForumHrefMapper("p.breadcrumbs a") {
+                        @Override
+                        public Elements select(Element htmlDoc) {
+                            final Element select = super.select(htmlDoc).last();
+                            return select != null ? new Elements(select) : new Elements();
+                        }
+                    });
+                    postMappings.put(Namespaces.NS_SIOC + "container_of", new PHPBBPostIdMapper("div#pagecontent table td.gensmall a[name]"));
+                }
+
+                return postMappings;
+            } else
+                throw new RuntimeException("the requested resource does not seem to identify a PHPBB topic (t=... parameter missing)");
+
+
+        } catch (URISyntaxException e) {
+            throw new RuntimeException("the requested resource does not seem to identify a PHPBB topic (URI syntax error)");
+        }
+
+    }
+
+    /**
+     * Return the name of this data provider. To be used e.g. in the configuration and in log messages.
+     *
+     * @return
+     */
+    @Override
+    public String getName() {
+        return PROVIDER_NAME;
+    }
+
+    /**
+     * Return the list of mime types accepted by this data provider.
+     *
+     * @return
+     */
+    @Override
+    public String[] listMimeTypes() {
+        return new String[] { "text/html"};
+    }
+
+    /**
+     * Build the URL to use to call the webservice in order to retrieve the data for the resource passed as argument.
+     * In many cases, this will just return the URI of the resource (e.g. Linked Data), but there might be data providers
+     * that use different means for accessing the data for a resource, e.g. SPARQL or a Cache.
+     *
+     *
+     * @param resource
+     * @param endpoint endpoint configuration for the data provider (optional)
+     * @return
+     */
+    @Override
+    public List<String> buildRequestUrl(String resource, Endpoint endpoint) {
+        return Collections.singletonList(resource);
+    }
+
+
+    /**
+     * Try to find further URLs in the document that need to be requested to complete the resource data.
+     * Used e.g. to parse the result of paging in HTML pages. The default implementation returns an empty list.
+     * <p/>
+     * This implementation tries to locate the paging area of PHPBB and selects the last link of the paging, which will
+     * be the "next" page.
+     *
+     * @param document
+     * @param requestUrl
+     * @return
+     */
+    @Override
+    protected List<String> findAdditionalRequestUrls(String resource, Document document, String requestUrl) {
+        List<String> result = new LinkedList<String>();
+
+
+        // return the next page in the result list
+        Elements values = document.select("div#pagecontent a[href~=viewtopic\\.php.*start=]");
+        for (Element o : values) {
+            String baseUrl = o.absUrl("href");
+            if (baseUrl.length() > 0) {
+                result.add(baseUrl);
+            }
+        }
+
+        return result;
+
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/c32963d5/ldclient/ldclient-provider-phpbb/src/main/java/org/apache/marmotta/ldclient/provider/phpbb/mapping/PHPBBDateMapper.java
----------------------------------------------------------------------
diff --git a/ldclient/ldclient-provider-phpbb/src/main/java/org/apache/marmotta/ldclient/provider/phpbb/mapping/PHPBBDateMapper.java b/ldclient/ldclient-provider-phpbb/src/main/java/org/apache/marmotta/ldclient/provider/phpbb/mapping/PHPBBDateMapper.java
new file mode 100644
index 0000000..cf6950f
--- /dev/null
+++ b/ldclient/ldclient-provider-phpbb/src/main/java/org/apache/marmotta/ldclient/provider/phpbb/mapping/PHPBBDateMapper.java
@@ -0,0 +1,66 @@
+/**
+ * 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 org.apache.marmotta.ldclient.provider.phpbb.mapping;
+
+import at.newmedialab.sesame.commons.model.Namespaces;
+import at.newmedialab.sesame.commons.util.DateUtils;
+import org.apache.marmotta.ldclient.provider.html.mapping.CssTextLiteralMapper;
+import org.jsoup.nodes.Element;
+import org.openrdf.model.Value;
+import org.openrdf.model.ValueFactory;
+
+import java.util.Collections;
+import java.util.Date;
+import java.util.List;
+
+/**
+ * Add file description here!
+ * <p/>
+ * Author: Sebastian Schaffert
+ */
+public class PHPBBDateMapper extends CssTextLiteralMapper {
+
+    public PHPBBDateMapper(String xpath) {
+        super(xpath);
+    }
+
+
+
+    /**
+     * Take the selected value, process it according to the mapping definition, and create Sesame Values using the
+     * factory passed as argument.
+     *
+     * @param resourceUri
+     * @param el
+     * @param factory
+     * @return
+     */
+    @Override
+    public List<Value> map(String resourceUri, Element el, ValueFactory factory) {
+        String selectedValue = el.text();
+
+        while(!Character.isDigit(selectedValue.charAt(0)))  {
+            selectedValue = selectedValue.substring(1,selectedValue.length());
+        }
+        while (!Character.isDigit(selectedValue.charAt(selectedValue.length()-1))) {
+            selectedValue = selectedValue.substring(0,selectedValue.length()-1);
+        }
+
+        Date date = DateUtils.parseDate(selectedValue);
+
+        return Collections.singletonList((Value)factory.createLiteral(DateUtils.ISO8601FORMAT.format(date),factory.createURI(Namespaces.NS_XSD + "dateTime")));
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/c32963d5/ldclient/ldclient-provider-phpbb/src/main/java/org/apache/marmotta/ldclient/provider/phpbb/mapping/PHPBBForumHrefMapper.java
----------------------------------------------------------------------
diff --git a/ldclient/ldclient-provider-phpbb/src/main/java/org/apache/marmotta/ldclient/provider/phpbb/mapping/PHPBBForumHrefMapper.java b/ldclient/ldclient-provider-phpbb/src/main/java/org/apache/marmotta/ldclient/provider/phpbb/mapping/PHPBBForumHrefMapper.java
new file mode 100644
index 0000000..5e0eaa5
--- /dev/null
+++ b/ldclient/ldclient-provider-phpbb/src/main/java/org/apache/marmotta/ldclient/provider/phpbb/mapping/PHPBBForumHrefMapper.java
@@ -0,0 +1,56 @@
+/**
+ * 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 org.apache.marmotta.ldclient.provider.phpbb.mapping;
+
+import org.apache.http.NameValuePair;
+import org.apache.http.client.utils.URLEncodedUtils;
+import org.apache.marmotta.ldclient.provider.html.mapping.CssSelectorMapper;
+import org.jsoup.nodes.Element;
+import org.openrdf.model.Value;
+import org.openrdf.model.ValueFactory;
+
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+public class PHPBBForumHrefMapper extends CssSelectorMapper {
+
+    public PHPBBForumHrefMapper(String css) {
+        super(css);
+    }
+
+    @Override
+    public List<Value> map(String resourceUri, Element selectedValue, ValueFactory factory) {
+        String baseUriSite = resourceUri.substring(0, resourceUri.lastIndexOf('/'));
+        String baseUriTopic = baseUriSite + "/viewforum.php?";
+
+        try {
+            URI uri = new URI(selectedValue.absUrl("href"));
+            Map<String, String> params = new HashMap<String, String>();
+            for (NameValuePair p : URLEncodedUtils.parse(uri, "UTF-8")) {
+                params.put(p.getName(), p.getValue());
+            }
+
+            return Collections.singletonList((Value) factory.createURI(baseUriTopic + "f=" + params.get("f")));
+        } catch (URISyntaxException ex) {
+            throw new RuntimeException("invalid syntax for URI", ex);
+        }
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/c32963d5/ldclient/ldclient-provider-phpbb/src/main/java/org/apache/marmotta/ldclient/provider/phpbb/mapping/PHPBBPostIdMapper.java
----------------------------------------------------------------------
diff --git a/ldclient/ldclient-provider-phpbb/src/main/java/org/apache/marmotta/ldclient/provider/phpbb/mapping/PHPBBPostIdMapper.java b/ldclient/ldclient-provider-phpbb/src/main/java/org/apache/marmotta/ldclient/provider/phpbb/mapping/PHPBBPostIdMapper.java
new file mode 100644
index 0000000..fb7d3b3
--- /dev/null
+++ b/ldclient/ldclient-provider-phpbb/src/main/java/org/apache/marmotta/ldclient/provider/phpbb/mapping/PHPBBPostIdMapper.java
@@ -0,0 +1,64 @@
+/**
+ * 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 org.apache.marmotta.ldclient.provider.phpbb.mapping;
+
+import org.apache.marmotta.ldclient.provider.html.mapping.CssSelectorMapper;
+import org.jsoup.nodes.Element;
+import org.openrdf.model.Value;
+import org.openrdf.model.ValueFactory;
+
+import java.util.Collections;
+import java.util.List;
+
+/**
+ * Maps a PHPBB Post ID (starting with p...., e.g. p105946, to a PHPBB URI, e.g.
+ * http://www.carving-ski.de/phpBB/viewtopic.php?p=105946
+ * <p/>
+ * Author: Sebastian Schaffert
+ */
+public class PHPBBPostIdMapper extends CssSelectorMapper {
+
+    public PHPBBPostIdMapper(String css) {
+        super(css);
+    }
+
+    /**
+     * Take the selected value, process it according to the mapping definition, and create Sesame Values using the
+     * factory passed as argument.
+     *
+     *
+     * @param resourceUri
+     * @param element
+     * @param factory
+     * @return
+     */
+    @Override
+    public List<Value> map(String resourceUri, Element element, ValueFactory factory) {
+        String selectedValue = element.attr("name");
+        String baseUri;
+        if(resourceUri.indexOf('?') >= 0) {
+            baseUri = resourceUri.substring(0,resourceUri.indexOf('?'));
+        } else {
+            baseUri = resourceUri;
+        }
+
+        if(!selectedValue.startsWith("p")) throw new RuntimeException("invalid value for PHPBB Post ID; must start with p... but was "+selectedValue);
+        else
+            return Collections.singletonList(
+                    (Value)factory.createURI(baseUri + "?p=" + selectedValue.substring(1))
+                    );
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/c32963d5/ldclient/ldclient-provider-phpbb/src/main/java/org/apache/marmotta/ldclient/provider/phpbb/mapping/PHPBBTopicHrefMapper.java
----------------------------------------------------------------------
diff --git a/ldclient/ldclient-provider-phpbb/src/main/java/org/apache/marmotta/ldclient/provider/phpbb/mapping/PHPBBTopicHrefMapper.java b/ldclient/ldclient-provider-phpbb/src/main/java/org/apache/marmotta/ldclient/provider/phpbb/mapping/PHPBBTopicHrefMapper.java
new file mode 100644
index 0000000..ac76cd8
--- /dev/null
+++ b/ldclient/ldclient-provider-phpbb/src/main/java/org/apache/marmotta/ldclient/provider/phpbb/mapping/PHPBBTopicHrefMapper.java
@@ -0,0 +1,73 @@
+/**
+ * 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 org.apache.marmotta.ldclient.provider.phpbb.mapping;
+
+import org.apache.http.NameValuePair;
+import org.apache.http.client.utils.URLEncodedUtils;
+import org.apache.marmotta.ldclient.provider.html.mapping.CssSelectorMapper;
+import org.jsoup.nodes.Element;
+import org.openrdf.model.Value;
+import org.openrdf.model.ValueFactory;
+
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * Maps the relative HREF specification in viewforum.php to an absolute URL by parsing the topic id from the t=...
+ * parameter of the href request.
+ *
+ * Sample href: ./viewtopic.php?f=81&amp;t=7428
+ * <p/>
+ * Author: Sebastian Schaffert
+ */
+public class PHPBBTopicHrefMapper extends CssSelectorMapper {
+
+
+    public PHPBBTopicHrefMapper(String css) {
+        super(css);
+    }
+
+    /**
+     * Take the selected value, process it according to the mapping definition, and create Sesame Values using the
+     * factory passed as argument.
+     *
+     * @param resourceUri
+     * @param selectedValue
+     * @param factory
+     * @return
+     */
+    @Override
+    public List<Value> map(String resourceUri, Element selectedValue, ValueFactory factory) {
+        String baseUriSite = resourceUri.substring(0,resourceUri.lastIndexOf('/'));
+        String baseUriTopic = baseUriSite + "/viewtopic.php?";
+
+        try {
+            URI uri = new URI(selectedValue.absUrl("href"));
+            Map<String,String> params = new HashMap<String, String>();
+            for(NameValuePair p : URLEncodedUtils.parse(uri, "UTF-8")) {
+                params.put(p.getName(),p.getValue());
+            }
+
+            return Collections.singletonList((Value)factory.createURI(baseUriTopic + "t=" + params.get("t")));
+        } catch (URISyntaxException ex) {
+            throw new RuntimeException("invalid syntax for URI",ex);
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/c32963d5/ldclient/ldclient-provider-phpbb/src/main/resources/META-INF/services/org.apache.marmotta.ldclient.api.provider.DataProvider
----------------------------------------------------------------------
diff --git a/ldclient/ldclient-provider-phpbb/src/main/resources/META-INF/services/org.apache.marmotta.ldclient.api.provider.DataProvider b/ldclient/ldclient-provider-phpbb/src/main/resources/META-INF/services/org.apache.marmotta.ldclient.api.provider.DataProvider
new file mode 100644
index 0000000..cd6714e
--- /dev/null
+++ b/ldclient/ldclient-provider-phpbb/src/main/resources/META-INF/services/org.apache.marmotta.ldclient.api.provider.DataProvider
@@ -0,0 +1,3 @@
+org.apache.marmotta.ldclient.provider.phpbb.PHPBBForumProvider
+org.apache.marmotta.ldclient.provider.phpbb.PHPBBPostProvider
+org.apache.marmotta.ldclient.provider.phpbb.PHPBBTopicProvider
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/c32963d5/ldclient/ldclient-provider-rdf/.classpath
----------------------------------------------------------------------
diff --git a/ldclient/ldclient-provider-rdf/.classpath b/ldclient/ldclient-provider-rdf/.classpath
new file mode 100644
index 0000000..bf96ac0
--- /dev/null
+++ b/ldclient/ldclient-provider-rdf/.classpath
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+	<classpathentry kind="src" output="target/classes" path="src/main/java"/>
+	<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources"/>
+	<classpathentry kind="src" output="target/test-classes" path="src/test/java"/>
+	<classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources"/>
+	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
+	<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
+		<attributes>
+			<attribute name="org.eclipse.jst.component.nondependency" value=""/>
+		</attributes>
+	</classpathentry>
+	<classpathentry kind="output" path="target/classes"/>
+</classpath>

http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/c32963d5/ldclient/ldclient-provider-rdf/.project
----------------------------------------------------------------------
diff --git a/ldclient/ldclient-provider-rdf/.project b/ldclient/ldclient-provider-rdf/.project
new file mode 100644
index 0000000..c9098ce
--- /dev/null
+++ b/ldclient/ldclient-provider-rdf/.project
@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>ldclient-provider-rdf</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>org.eclipse.wst.common.project.facet.core.builder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.jdt.core.javabuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.m2e.core.maven2Builder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.wst.validation.validationbuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.zeroturnaround.eclipse.rebelXmlBuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>org.eclipse.jem.workbench.JavaEMFNature</nature>
+		<nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature>
+		<nature>org.eclipse.jdt.core.javanature</nature>
+		<nature>org.eclipse.m2e.core.maven2Nature</nature>
+		<nature>org.eclipse.wst.common.project.facet.core.nature</nature>
+		<nature>org.zeroturnaround.eclipse.jrebelNature</nature>
+	</natures>
+</projectDescription>

http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/c32963d5/ldclient/ldclient-provider-rdf/.settings/org.eclipse.core.resources.prefs
----------------------------------------------------------------------
diff --git a/ldclient/ldclient-provider-rdf/.settings/org.eclipse.core.resources.prefs b/ldclient/ldclient-provider-rdf/.settings/org.eclipse.core.resources.prefs
new file mode 100644
index 0000000..dc1b414
--- /dev/null
+++ b/ldclient/ldclient-provider-rdf/.settings/org.eclipse.core.resources.prefs
@@ -0,0 +1,5 @@
+eclipse.preferences.version=1
+encoding//src/main/java=UTF-8
+encoding//src/main/resources=UTF-8
+encoding//src/test/java=UTF-8
+encoding//src/test/resources=UTF-8

http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/c32963d5/ldclient/ldclient-provider-rdf/.settings/org.eclipse.jdt.core.prefs
----------------------------------------------------------------------
diff --git a/ldclient/ldclient-provider-rdf/.settings/org.eclipse.jdt.core.prefs b/ldclient/ldclient-provider-rdf/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 0000000..69c31cd
--- /dev/null
+++ b/ldclient/ldclient-provider-rdf/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,8 @@
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
+org.eclipse.jdt.core.compiler.compliance=1.6
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
+org.eclipse.jdt.core.compiler.source=1.6

http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/c32963d5/ldclient/ldclient-provider-rdf/.settings/org.eclipse.m2e.core.prefs
----------------------------------------------------------------------
diff --git a/ldclient/ldclient-provider-rdf/.settings/org.eclipse.m2e.core.prefs b/ldclient/ldclient-provider-rdf/.settings/org.eclipse.m2e.core.prefs
new file mode 100644
index 0000000..f897a7f
--- /dev/null
+++ b/ldclient/ldclient-provider-rdf/.settings/org.eclipse.m2e.core.prefs
@@ -0,0 +1,4 @@
+activeProfiles=
+eclipse.preferences.version=1
+resolveWorkspaceProjects=true
+version=1

http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/c32963d5/ldclient/ldclient-provider-rdf/.settings/org.eclipse.wst.common.component
----------------------------------------------------------------------
diff --git a/ldclient/ldclient-provider-rdf/.settings/org.eclipse.wst.common.component b/ldclient/ldclient-provider-rdf/.settings/org.eclipse.wst.common.component
new file mode 100644
index 0000000..6c9aa4d
--- /dev/null
+++ b/ldclient/ldclient-provider-rdf/.settings/org.eclipse.wst.common.component
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project-modules id="moduleCoreId" project-version="1.5.0">
+    <wb-module deploy-name="ldclient-provider-rdf">
+        <wb-resource deploy-path="/" source-path="/src/main/java"/>
+        <wb-resource deploy-path="/" source-path="/src/main/resources"/>
+    </wb-module>
+</project-modules>

http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/c32963d5/ldclient/ldclient-provider-rdf/.settings/org.eclipse.wst.common.project.facet.core.xml
----------------------------------------------------------------------
diff --git a/ldclient/ldclient-provider-rdf/.settings/org.eclipse.wst.common.project.facet.core.xml b/ldclient/ldclient-provider-rdf/.settings/org.eclipse.wst.common.project.facet.core.xml
new file mode 100644
index 0000000..c78d932
--- /dev/null
+++ b/ldclient/ldclient-provider-rdf/.settings/org.eclipse.wst.common.project.facet.core.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<faceted-project>
+  <installed facet="java" version="1.6"/>
+  <installed facet="jst.utility" version="1.0"/>
+</faceted-project>

http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/c32963d5/ldclient/ldclient-provider-rdf/pom.xml
----------------------------------------------------------------------
diff --git a/ldclient/ldclient-provider-rdf/pom.xml b/ldclient/ldclient-provider-rdf/pom.xml
new file mode 100644
index 0000000..796e45b
--- /dev/null
+++ b/ldclient/ldclient-provider-rdf/pom.xml
@@ -0,0 +1,92 @@
+<?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.
+  -->
+
+<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>at.newmedialab.lmf</groupId>
+        <artifactId>ldclient-parent</artifactId>
+        <version>3.0.0-SNAPSHOT</version>
+        <relativePath>../</relativePath>
+    </parent>
+
+    <artifactId>ldclient-provider-rdf</artifactId>
+    <name>LDClient Provider: RDF Resource Access</name>
+
+    <description>
+        Implements access to RDF-based Linked Data Resources in different formats,
+        including RDF/XML, N3, TURTLE, and JSON-LD.
+    </description>
+
+    <dependencies>
+        <dependency>
+            <groupId>at.newmedialab.lmf</groupId>
+            <artifactId>ldclient-api</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>at.newmedialab.lmf</groupId>
+            <artifactId>ldclient-core</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>org.openrdf.sesame</groupId>
+            <artifactId>sesame-rio-rdfxml</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.openrdf.sesame</groupId>
+            <artifactId>sesame-rio-turtle</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.openrdf.sesame</groupId>
+            <artifactId>sesame-rio-n3</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>at.newmedialab.sesame</groupId>
+            <artifactId>sesame-tools-rio-jsonld</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>at.newmedialab.sesame</groupId>
+            <artifactId>sesame-tools-rio-rdfjson</artifactId>
+        </dependency>
+
+
+
+        <dependency>
+            <groupId>junit</groupId>
+            <artifactId>junit</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+        	<groupId>at.newmedialab.lmf</groupId>
+        	<artifactId>ldclient-core</artifactId>
+        	<type>test-jar</type>
+        	<scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>commons-io</groupId>
+            <artifactId>commons-io</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.openrdf.sesame</groupId>
+            <artifactId>sesame-queryparser-sparql</artifactId>
+            <scope>test</scope>
+        </dependency>
+
+    </dependencies>
+</project>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/c32963d5/ldclient/ldclient-provider-rdf/src/main/java/org/apache/marmotta/ldclient/endpoint/rdf/LinkedDataEndpoint.java
----------------------------------------------------------------------
diff --git a/ldclient/ldclient-provider-rdf/src/main/java/org/apache/marmotta/ldclient/endpoint/rdf/LinkedDataEndpoint.java b/ldclient/ldclient-provider-rdf/src/main/java/org/apache/marmotta/ldclient/endpoint/rdf/LinkedDataEndpoint.java
new file mode 100644
index 0000000..e364ece
--- /dev/null
+++ b/ldclient/ldclient-provider-rdf/src/main/java/org/apache/marmotta/ldclient/endpoint/rdf/LinkedDataEndpoint.java
@@ -0,0 +1,39 @@
+/**
+ * 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 org.apache.marmotta.ldclient.endpoint.rdf;
+
+import org.apache.marmotta.commons.http.ContentType;
+import org.apache.marmotta.ldclient.api.endpoint.Endpoint;
+
+/**
+ * A specialised default endpoint configuration for Linked Data endpoints. It will auto-register with lowest priority
+ * for any http URI.
+ * <p/>
+ * Author: Sebastian Schaffert
+ */
+public class LinkedDataEndpoint extends Endpoint {
+
+    public LinkedDataEndpoint() {
+        super("Linked Data", "Linked Data", "http://.*", null, 86400L);
+        setPriority(PRIORITY_LOW);
+        addContentType(new ContentType("application", "rdf+xml", 0.8));
+        addContentType(new ContentType("text", "turtle", 1.0));
+        addContentType(new ContentType("text", "n3", 0.8));
+        addContentType(new ContentType("text", "rdf+n3", 0.8));
+        addContentType(new ContentType("application", "ld+json", 0.5));
+        addContentType(new ContentType("application","rdf+json",0.8));
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/c32963d5/ldclient/ldclient-provider-rdf/src/main/java/org/apache/marmotta/ldclient/endpoint/rdf/SPARQLEndpoint.java
----------------------------------------------------------------------
diff --git a/ldclient/ldclient-provider-rdf/src/main/java/org/apache/marmotta/ldclient/endpoint/rdf/SPARQLEndpoint.java b/ldclient/ldclient-provider-rdf/src/main/java/org/apache/marmotta/ldclient/endpoint/rdf/SPARQLEndpoint.java
new file mode 100644
index 0000000..2b60657
--- /dev/null
+++ b/ldclient/ldclient-provider-rdf/src/main/java/org/apache/marmotta/ldclient/endpoint/rdf/SPARQLEndpoint.java
@@ -0,0 +1,42 @@
+/**
+ * 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 org.apache.marmotta.ldclient.endpoint.rdf;
+
+import org.apache.marmotta.ldclient.api.endpoint.Endpoint;
+import org.apache.marmotta.ldclient.provider.rdf.SPARQLProvider;
+
+/**
+ * Create an endpoint configuration for a SPARQL endpoint using the {@link SPARQLProvider}.
+ * <p/>
+ * Author: Sebastian Schaffert (sschaffert@apache.org)
+ */
+public class SPARQLEndpoint extends Endpoint {
+
+    /**
+     * Create an endpoint configuration for a SPARQL endpoint.
+     *
+     * @param name a name for the endpoint definition    (e.g. DBPedia SPARQL)
+     * @param endpointUrl the URL of the SPARQL endpoint (e.g. http://dbpedia.org/sparql)
+     * @param resourcePattern the regex pattern for resources that should be handled by this endpoint
+     */
+    public SPARQLEndpoint(String name, String endpointUrl, String resourcePattern) {
+        super(name, SPARQLProvider.PROVIDER_NAME,resourcePattern,buildEndpointUrl(endpointUrl),86400L);
+    }
+
+    private static String buildEndpointUrl(String base) {
+        return base + "?query={query}&format={contenttype}";
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/c32963d5/ldclient/ldclient-provider-rdf/src/main/java/org/apache/marmotta/ldclient/endpoint/rdf/StanbolEndpoint.java
----------------------------------------------------------------------
diff --git a/ldclient/ldclient-provider-rdf/src/main/java/org/apache/marmotta/ldclient/endpoint/rdf/StanbolEndpoint.java b/ldclient/ldclient-provider-rdf/src/main/java/org/apache/marmotta/ldclient/endpoint/rdf/StanbolEndpoint.java
new file mode 100644
index 0000000..3a5d085
--- /dev/null
+++ b/ldclient/ldclient-provider-rdf/src/main/java/org/apache/marmotta/ldclient/endpoint/rdf/StanbolEndpoint.java
@@ -0,0 +1,37 @@
+/**
+ * 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 org.apache.marmotta.ldclient.endpoint.rdf;
+
+import org.apache.marmotta.commons.http.ContentType;
+import org.apache.marmotta.ldclient.api.endpoint.Endpoint;
+import org.apache.marmotta.ldclient.provider.rdf.CacheProvider;
+
+/**
+ * Configure an endpoint to a stanbol installation used for caching entities.
+ * <p/>
+ * Author: Sebastian Schaffert (sschaffert@apache.org)
+ */
+public class StanbolEndpoint extends Endpoint {
+
+    public StanbolEndpoint(String name, String endpointUrl, String resourcePattern) {
+        super(name, CacheProvider.PROVIDER_NAME,resourcePattern,buildEndpointUrl(endpointUrl),86400L);
+        addContentType(new ContentType("text","turtle"));
+    }
+
+    private static String buildEndpointUrl(String base) {
+        return base + "entity?id={uri}";
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/c32963d5/ldclient/ldclient-provider-rdf/src/main/java/org/apache/marmotta/ldclient/provider/rdf/AbstractRDFProvider.java
----------------------------------------------------------------------
diff --git a/ldclient/ldclient-provider-rdf/src/main/java/org/apache/marmotta/ldclient/provider/rdf/AbstractRDFProvider.java b/ldclient/ldclient-provider-rdf/src/main/java/org/apache/marmotta/ldclient/provider/rdf/AbstractRDFProvider.java
new file mode 100644
index 0000000..4a0c245
--- /dev/null
+++ b/ldclient/ldclient-provider-rdf/src/main/java/org/apache/marmotta/ldclient/provider/rdf/AbstractRDFProvider.java
@@ -0,0 +1,119 @@
+/**
+ * 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 org.apache.marmotta.ldclient.provider.rdf;
+
+import org.apache.marmotta.ldclient.exception.DataRetrievalException;
+import org.apache.marmotta.ldclient.services.provider.AbstractHttpProvider;
+import org.openrdf.model.Resource;
+import org.openrdf.model.Value;
+import org.openrdf.repository.Repository;
+import org.openrdf.repository.RepositoryConnection;
+import org.openrdf.repository.RepositoryException;
+import org.openrdf.repository.event.InterceptingRepositoryConnection;
+import org.openrdf.repository.event.base.InterceptingRepositoryConnectionWrapper;
+import org.openrdf.repository.event.base.RepositoryConnectionInterceptorAdapter;
+import org.openrdf.rio.RDFFormat;
+import org.openrdf.rio.RDFParseException;
+import org.openrdf.rio.RDFParserRegistry;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.Collections;
+import java.util.List;
+
+/**
+ * Abstract implementation for RDF-aware data providers.
+ * <p/>
+ * Author: Sebastian Schaffert
+ */
+public abstract class AbstractRDFProvider extends AbstractHttpProvider {
+
+    /**
+     * Return the list of mime types accepted by this data provider.
+     *
+     * @return
+     */
+    @Override
+    public String[] listMimeTypes() {
+        return new String[] {
+                "application/rdf+xml",
+                "text/rdf+n3; q=0.8",
+                "text/turtle; q=0.6"
+        };
+    }
+
+    /**
+     * Parse the HTTP response entity returned by the web service call and return its contents as a Sesame RDF
+     * repository. The content type returned by the web service is passed as argument to help the implementation
+     * decide how to parse the data.
+     *
+     *
+     *
+     *
+     * @param resourceUri
+     * @param in          input stream as returned by the remote webservice
+     * @param contentType content type as returned in the HTTP headers of the remote webservice
+     * @return an RDF repository containing an RDF representation of the dataset located at the remote resource.
+     * @throws java.io.IOException in case an error occurs while reading the input stream
+     */
+    @Override
+    public List<String> parseResponse(final String resourceUri, String requestUrl, Repository triples, InputStream in, String contentType) throws DataRetrievalException {
+        RDFFormat format = RDFParserRegistry.getInstance().getFileFormatForMIMEType(contentType, RDFFormat.RDFXML);
+
+        try {
+            InterceptingRepositoryConnection con =
+                    new InterceptingRepositoryConnectionWrapper(triples,triples.getConnection());
+
+            con.addRepositoryConnectionInterceptor(new RepositoryConnectionInterceptorAdapter() {
+                @Override
+                public boolean add(RepositoryConnection conn, Resource s, org.openrdf.model.URI p, Value o, Resource... contexts) {
+                    if(s instanceof org.openrdf.model.URI) {
+                        // if s is a URI and subject a KiWiUriResource, return true if they are different
+                        return !s.stringValue().equals(resourceUri);
+                    } else {
+                        // in all other cases, return true to filter out the triple
+                        return true;
+                    }
+                };
+
+                @Override
+                public boolean remove(RepositoryConnection conn, Resource s, org.openrdf.model.URI p, Value o, Resource... contexts) {
+                    if(s instanceof org.openrdf.model.URI) {
+                        // if s is a URI and subject a KiWiUriResource, return true if they are different
+                        return !s.stringValue().equals(resourceUri);
+                    } else {
+                        // in all other cases, return true to filter out the triple
+                        return true;
+                    }
+                }
+            });
+
+
+
+            con.add(in, resourceUri,format);
+            con.commit();
+            con.close();
+
+            return Collections.emptyList();
+        } catch (RepositoryException e) {
+            throw new DataRetrievalException("error while initializing temporary RDF store",e);
+        } catch (RDFParseException e) {
+            throw new DataRetrievalException("parse error while trying to parse remote RDF content",e);
+        } catch (IOException e) {
+            throw new DataRetrievalException("I/O error while trying to read remote RDF content",e);
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/c32963d5/ldclient/ldclient-provider-rdf/src/main/java/org/apache/marmotta/ldclient/provider/rdf/CacheProvider.java
----------------------------------------------------------------------
diff --git a/ldclient/ldclient-provider-rdf/src/main/java/org/apache/marmotta/ldclient/provider/rdf/CacheProvider.java b/ldclient/ldclient-provider-rdf/src/main/java/org/apache/marmotta/ldclient/provider/rdf/CacheProvider.java
new file mode 100644
index 0000000..ac8dc7d
--- /dev/null
+++ b/ldclient/ldclient-provider-rdf/src/main/java/org/apache/marmotta/ldclient/provider/rdf/CacheProvider.java
@@ -0,0 +1,68 @@
+/**
+ * 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 org.apache.marmotta.ldclient.provider.rdf;
+
+import com.google.common.base.Preconditions;
+import org.apache.marmotta.ldclient.api.endpoint.Endpoint;
+
+import java.io.UnsupportedEncodingException;
+import java.net.URLEncoder;
+import java.util.Collections;
+import java.util.List;
+
+/**
+ * A data provider supporting retrieval from Linked Data caches, i.e. services that offer to retrieve a copy of a
+ * resource like the Sindice Live Cache or Apache Stanbol Entity Hub. The concrete details of the service definition
+ * are passed in the Endpoint configuration of the buildRequestUrl method.
+ * <p/>
+ * Author: Sebastian Schaffert
+ */
+public class CacheProvider extends AbstractRDFProvider {
+
+    public static final String PROVIDER_NAME = "LD Cache";
+
+    /**
+     * Return the name of this data provider. To be used e.g. in the configuration and in log messages.
+     *
+     * @return
+     */
+    @Override
+    public String getName() {
+        return PROVIDER_NAME;
+    }
+
+    /**
+     * Build the URL to use to call the webservice in order to retrieve the data for the resource passed as argument.
+     * In many cases, this will just return the URI of the resource (e.g. Linked Data), but there might be data providers
+     * that use different means for accessing the data for a resource, e.g. SPARQL or a Cache.
+     *
+     *
+     *
+     * @param resourceUri
+     * @param endpoint endpoint configuration for the data provider (optional)
+     * @return
+     */
+    @Override
+    public List<String> buildRequestUrl(String resourceUri, Endpoint endpoint) {
+        Preconditions.checkNotNull(resourceUri);
+        Preconditions.checkNotNull(endpoint);
+        try {
+            return Collections.singletonList(endpoint.getEndpointUrl().replace("{uri}", URLEncoder.encode(resourceUri, "UTF-8")));
+        } catch (UnsupportedEncodingException e) {
+            throw new RuntimeException("encoding UTF-8 not supported; the Java environment is severely broken");
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/c32963d5/ldclient/ldclient-provider-rdf/src/main/java/org/apache/marmotta/ldclient/provider/rdf/LinkedDataProvider.java
----------------------------------------------------------------------
diff --git a/ldclient/ldclient-provider-rdf/src/main/java/org/apache/marmotta/ldclient/provider/rdf/LinkedDataProvider.java b/ldclient/ldclient-provider-rdf/src/main/java/org/apache/marmotta/ldclient/provider/rdf/LinkedDataProvider.java
new file mode 100644
index 0000000..0224dd5
--- /dev/null
+++ b/ldclient/ldclient-provider-rdf/src/main/java/org/apache/marmotta/ldclient/provider/rdf/LinkedDataProvider.java
@@ -0,0 +1,58 @@
+/**
+ * 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 org.apache.marmotta.ldclient.provider.rdf;
+
+import com.google.common.base.Preconditions;
+import org.apache.marmotta.ldclient.api.endpoint.Endpoint;
+
+import java.util.Collections;
+import java.util.List;
+
+/**
+ * Linked Data implementation of a data provider. Allows retrieval of resources using Linked Data standards.
+ * <p/>
+ * Author: Sebastian Schaffert
+ */
+public class LinkedDataProvider extends AbstractRDFProvider {
+
+    public static final String PROVIDER_NAME = "Linked Data";
+
+    /**
+     * Return the name of this data provider. To be used e.g. in the configuration and in log messages.
+     *
+     * @return
+     */
+    @Override
+    public String getName() {
+        return PROVIDER_NAME;
+    }
+
+    /**
+     * Build the URL to use to call the webservice in order to retrieve the data for the resource passed as argument.
+     * In many cases, this will just return the URI of the resource (e.g. Linked Data), but there might be data providers
+     * that use different means for accessing the data for a resource, e.g. SPARQL or a Cache.
+     *
+     *
+     *
+     * @param resourceUri
+     * @return
+     */
+    @Override
+    public List<String> buildRequestUrl(String resourceUri, Endpoint endpoint) {
+        Preconditions.checkNotNull(resourceUri);
+        return Collections.singletonList(resourceUri);
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/c32963d5/ldclient/ldclient-provider-rdf/src/main/java/org/apache/marmotta/ldclient/provider/rdf/RegexUriProvider.java
----------------------------------------------------------------------
diff --git a/ldclient/ldclient-provider-rdf/src/main/java/org/apache/marmotta/ldclient/provider/rdf/RegexUriProvider.java b/ldclient/ldclient-provider-rdf/src/main/java/org/apache/marmotta/ldclient/provider/rdf/RegexUriProvider.java
new file mode 100644
index 0000000..87c6440
--- /dev/null
+++ b/ldclient/ldclient-provider-rdf/src/main/java/org/apache/marmotta/ldclient/provider/rdf/RegexUriProvider.java
@@ -0,0 +1,44 @@
+/**
+ * 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 org.apache.marmotta.ldclient.provider.rdf;
+
+import com.google.common.base.Preconditions;
+import org.apache.marmotta.ldclient.api.endpoint.Endpoint;
+import org.apache.marmotta.ldclient.exception.DataRetrievalException;
+
+import java.util.Collections;
+import java.util.List;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+public class RegexUriProvider extends AbstractRDFProvider {
+
+    @Override
+    public String getName() {
+        return "RegexUri";
+    }
+
+    @Override
+    protected List<String> buildRequestUrl(String resourceUri, Endpoint endpoint) throws DataRetrievalException {
+        Preconditions.checkNotNull(resourceUri);
+        Preconditions.checkNotNull(endpoint);
+
+        final Pattern p = Preconditions.checkNotNull(endpoint.getUriPatternCompiled());
+        final Matcher matcher = p.matcher(resourceUri);
+        return Collections.singletonList(matcher.replaceAll(endpoint.getEndpointUrl()));
+    }
+
+}