You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@marmotta.apache.org by an...@apache.org on 2013/10/01 01:48:04 UTC

[12/51] [partial] Revert "Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/incubator-marmotta"

http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/4aa87dbe/libraries/ldcache/ldcache-backend-kiwi/src/main/java/org/apache/marmotta/ldcache/backend/kiwi/persistence/LDCachingKiWiPersistenceConnection.java
----------------------------------------------------------------------
diff --git a/libraries/ldcache/ldcache-backend-kiwi/src/main/java/org/apache/marmotta/ldcache/backend/kiwi/persistence/LDCachingKiWiPersistenceConnection.java b/libraries/ldcache/ldcache-backend-kiwi/src/main/java/org/apache/marmotta/ldcache/backend/kiwi/persistence/LDCachingKiWiPersistenceConnection.java
index 63e4063..aba5c2f 100644
--- a/libraries/ldcache/ldcache-backend-kiwi/src/main/java/org/apache/marmotta/ldcache/backend/kiwi/persistence/LDCachingKiWiPersistenceConnection.java
+++ b/libraries/ldcache/ldcache-backend-kiwi/src/main/java/org/apache/marmotta/ldcache/backend/kiwi/persistence/LDCachingKiWiPersistenceConnection.java
@@ -85,7 +85,6 @@ public class LDCachingKiWiPersistenceConnection  {
         entry.setExpiryDate(new Date(row.getTimestamp("expires_at").getTime()));
         entry.setUpdateCount(row.getInt("update_count"));
         entry.setResource((URI) connection.loadNodeById(row.getLong("resource_id")));
-        entry.setTripleCount(row.getInt("triple_count"));
 
         entryIdCache.put(new Element(id,entry));
         entryResourceCache.put(new Element(entry.getResource().stringValue(),entry));
@@ -146,16 +145,12 @@ public class LDCachingKiWiPersistenceConnection  {
             kEntry.setLastRetrieved(entry.getLastRetrieved());
             kEntry.setUpdateCount(entry.getUpdateCount());
             kEntry.setResource(entry.getResource());
-            kEntry.setTripleCount(entry.getTripleCount());
         }
 
         if(! (entry.getResource() instanceof KiWiResource) || ((KiWiResource) entry.getResource()).getId() == null) {
             throw new IllegalStateException("the resource contained in the cache entry is not a KiWiResource!");
         }
 
-        // needed before the entry can be inserted
-        connection.flushBatch();
-
         kEntry.setId(connection.getNextSequence("seq.ldcache"));
 
         PreparedStatement insertEntry = connection.getPreparedStatement("store.entry");
@@ -164,7 +159,6 @@ public class LDCachingKiWiPersistenceConnection  {
         insertEntry.setTimestamp(3,new Timestamp(kEntry.getExpiryDate().getTime()));
         insertEntry.setLong(4,((KiWiNode)kEntry.getResource()).getId());
         insertEntry.setInt(5, kEntry.getUpdateCount());
-        insertEntry.setInt(6, kEntry.getTripleCount());
         insertEntry.executeUpdate();
 
         log.debug("persisted ld-cache entry with id {}", kEntry.getId());
@@ -332,7 +326,7 @@ public class LDCachingKiWiPersistenceConnection  {
      * @throws java.sql.SQLException
      */
     public void storeNode(KiWiNode node) throws SQLException {
-        connection.storeNode(node, false);
+        connection.storeNode(node);
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/4aa87dbe/libraries/ldcache/ldcache-backend-kiwi/src/main/resources/org/apache/marmotta/kiwi/persistence/h2/create_ldcache_tables.sql
----------------------------------------------------------------------
diff --git a/libraries/ldcache/ldcache-backend-kiwi/src/main/resources/org/apache/marmotta/kiwi/persistence/h2/create_ldcache_tables.sql b/libraries/ldcache/ldcache-backend-kiwi/src/main/resources/org/apache/marmotta/kiwi/persistence/h2/create_ldcache_tables.sql
index 08b2276..05a4b7c 100644
--- a/libraries/ldcache/ldcache-backend-kiwi/src/main/resources/org/apache/marmotta/kiwi/persistence/h2/create_ldcache_tables.sql
+++ b/libraries/ldcache/ldcache-backend-kiwi/src/main/resources/org/apache/marmotta/kiwi/persistence/h2/create_ldcache_tables.sql
@@ -20,7 +20,6 @@ CREATE TABLE ldcache_entries (
   expires_at   timestamp  NOT NULL,
   resource_id  bigint     NOT NULL REFERENCES nodes(id),
   update_count int        NOT NULL DEFAULT 0,
-  triple_count int        NOT NULL DEFAULT 0,
   PRIMARY KEY(id)
 );
 

http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/4aa87dbe/libraries/ldcache/ldcache-backend-kiwi/src/main/resources/org/apache/marmotta/kiwi/persistence/h2/statements.properties
----------------------------------------------------------------------
diff --git a/libraries/ldcache/ldcache-backend-kiwi/src/main/resources/org/apache/marmotta/kiwi/persistence/h2/statements.properties b/libraries/ldcache/ldcache-backend-kiwi/src/main/resources/org/apache/marmotta/kiwi/persistence/h2/statements.properties
index e8af848..8abd8c1 100644
--- a/libraries/ldcache/ldcache-backend-kiwi/src/main/resources/org/apache/marmotta/kiwi/persistence/h2/statements.properties
+++ b/libraries/ldcache/ldcache-backend-kiwi/src/main/resources/org/apache/marmotta/kiwi/persistence/h2/statements.properties
@@ -19,13 +19,13 @@
 # get sequence numbers
 seq.ldcache           = SELECT nextval('seq_ldcache')
 
-load.entry_by_id      = SELECT id,retrieved_at,expires_at,resource_id,update_count,triple_count FROM ldcache_entries WHERE id = ?
-load.entry_by_uri     = SELECT E.id,retrieved_at,expires_at,resource_id,update_count,triple_count FROM ldcache_entries E, nodes N WHERE e.resource_id = N.id AND N.ntype = 'uri' and N.svalue = ?
+load.entry_by_id      = SELECT id,retrieved_at,expires_at,resource_id,update_count FROM ldcache_entries WHERE id = ?
+load.entry_by_uri     = SELECT E.id,retrieved_at,expires_at,resource_id,update_count FROM ldcache_entries E, nodes N WHERE e.resource_id = N.id AND N.ntype = 'uri' and N.svalue = ?
 
 # store ldcache entry information
-store.entry           = INSERT INTO ldcache_entries (id,retrieved_at,expires_at,resource_id,update_count,triple_count) VALUES (?,?,?,?,?,?)
+store.entry           = INSERT INTO ldcache_entries (id,retrieved_at,expires_at,resource_id,update_count) VALUES (?,?,?,?,?)
 delete.entry          = DELETE FROM ldcache_entries WHERE id = ?
 delete.entry_by_uri   = DELETE FROM ldcache_entries WHERE resource_id IN (SELECT id FROM nodes WHERE ntype='uri' AND svalue = ?)
 
-query.entries_expired = SELECT id,retrieved_at,expires_at,resource_id,update_count,triple_count FROM ldcache_entries WHERE expires_at < now() ORDER BY retrieved_at ASC
-query.entries_all     = SELECT id,retrieved_at,expires_at,resource_id,update_count,triple_count FROM ldcache_entries ORDER BY retrieved_at ASC
+query.entries_expired = SELECT id,retrieved_at,expires_at,resource_id,update_count FROM ldcache_entries WHERE expires_at < now() ORDER BY retrieved_at ASC
+query.entries_all     = SELECT id,retrieved_at,expires_at,resource_id,update_count FROM ldcache_entries ORDER BY retrieved_at ASC

http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/4aa87dbe/libraries/ldcache/ldcache-backend-kiwi/src/main/resources/org/apache/marmotta/kiwi/persistence/h2/upgrade_ldcache_001_002.sql
----------------------------------------------------------------------
diff --git a/libraries/ldcache/ldcache-backend-kiwi/src/main/resources/org/apache/marmotta/kiwi/persistence/h2/upgrade_ldcache_001_002.sql b/libraries/ldcache/ldcache-backend-kiwi/src/main/resources/org/apache/marmotta/kiwi/persistence/h2/upgrade_ldcache_001_002.sql
deleted file mode 100644
index d9b9966..0000000
--- a/libraries/ldcache/ldcache-backend-kiwi/src/main/resources/org/apache/marmotta/kiwi/persistence/h2/upgrade_ldcache_001_002.sql
+++ /dev/null
@@ -1,19 +0,0 @@
--- Licensed to the Apache Software Foundation (ASF) under one or more
--- contributor license agreements.  See the NOTICE file distributed with
--- this work for additional information regarding copyright ownership.
--- The ASF licenses this file to You under the Apache License, Version 2.0
--- (the "License"); you may not use this file except in compliance with
--- the License.  You may obtain a copy of the License at
---
---      http://www.apache.org/licenses/LICENSE-2.0
---
--- Unless required by applicable law or agreed to in writing, software
--- distributed under the License is distributed on an "AS IS" BASIS,
--- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
--- See the License for the specific language governing permissions and
--- limitations under the License.
-
-ALTER TABLE ldcache_entries ADD COLUMN triple_count int NOT NULL DEFAULT 0;
-UPDATE
-  ldcache_entries
-SET triple_count = (SELECT count(*) as numTriples FROM triples WHERE subject = ldcache_entries.resource_id and deleted = false)
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/4aa87dbe/libraries/ldcache/ldcache-backend-kiwi/src/main/resources/org/apache/marmotta/kiwi/persistence/mysql/create_ldcache_tables.sql
----------------------------------------------------------------------
diff --git a/libraries/ldcache/ldcache-backend-kiwi/src/main/resources/org/apache/marmotta/kiwi/persistence/mysql/create_ldcache_tables.sql b/libraries/ldcache/ldcache-backend-kiwi/src/main/resources/org/apache/marmotta/kiwi/persistence/mysql/create_ldcache_tables.sql
index b1717af..c9d6e3b 100644
--- a/libraries/ldcache/ldcache-backend-kiwi/src/main/resources/org/apache/marmotta/kiwi/persistence/mysql/create_ldcache_tables.sql
+++ b/libraries/ldcache/ldcache-backend-kiwi/src/main/resources/org/apache/marmotta/kiwi/persistence/mysql/create_ldcache_tables.sql
@@ -21,7 +21,6 @@ CREATE TABLE ldcache_entries (
   expires_at   timestamp  NOT NULL,
   resource_id  bigint     NOT NULL REFERENCES nodes(id),
   update_count int        NOT NULL DEFAULT 0,
-  triple_count int        NOT NULL DEFAULT 0,
   PRIMARY KEY(id)
 );
 

http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/4aa87dbe/libraries/ldcache/ldcache-backend-kiwi/src/main/resources/org/apache/marmotta/kiwi/persistence/mysql/statements.properties
----------------------------------------------------------------------
diff --git a/libraries/ldcache/ldcache-backend-kiwi/src/main/resources/org/apache/marmotta/kiwi/persistence/mysql/statements.properties b/libraries/ldcache/ldcache-backend-kiwi/src/main/resources/org/apache/marmotta/kiwi/persistence/mysql/statements.properties
index 95faac7..6a0ee54 100644
--- a/libraries/ldcache/ldcache-backend-kiwi/src/main/resources/org/apache/marmotta/kiwi/persistence/mysql/statements.properties
+++ b/libraries/ldcache/ldcache-backend-kiwi/src/main/resources/org/apache/marmotta/kiwi/persistence/mysql/statements.properties
@@ -19,15 +19,14 @@
 # get sequence numbers
 seq.ldcache.prep         = UPDATE seq_ldcache SET id=LAST_INSERT_ID(id+1);
 seq.ldcache              = SELECT LAST_INSERT_ID();
-seq.ldcache.set          = UPDATE seq_ldcache SET id=?;
 
-load.entry_by_id      = SELECT id,retrieved_at,expires_at,resource_id,update_count,triple_count FROM ldcache_entries WHERE id = ?
-load.entry_by_uri     = SELECT E.id,retrieved_at,expires_at,resource_id,update_count,triple_count FROM ldcache_entries E, nodes N WHERE e.resource_id = N.id AND N.ntype = 'uri' and N.svalue = ?
+load.entry_by_id      = SELECT id,retrieved_at,expires_at,resource_id,update_count FROM ldcache_entries WHERE id = ?
+load.entry_by_uri     = SELECT E.id,retrieved_at,expires_at,resource_id,update_count FROM ldcache_entries E, nodes N WHERE e.resource_id = N.id AND N.ntype = 'uri' and N.svalue = ?
 
 # store ldcache entry information
-store.entry           = INSERT INTO ldcache_entries (id,retrieved_at,expires_at,resource_id,update_count,triple_count) VALUES (?,?,?,?,?,?)
+store.entry           = INSERT INTO ldcache_entries (id,retrieved_at,expires_at,resource_id,update_count) VALUES (?,?,?,?,?)
 delete.entry          = DELETE FROM ldcache_entries WHERE id = ?
 delete.entry_by_uri   = DELETE FROM ldcache_entries WHERE resource_id IN (SELECT id FROM nodes WHERE ntype='uri' AND svalue = ?)
 
-query.entries_expired = SELECT id,retrieved_at,expires_at,resource_id,update_count,triple_count FROM ldcache_entries WHERE expires_at < now() ORDER BY retrieved_at ASC
-query.entries_all     = SELECT id,retrieved_at,expires_at,resource_id,update_count,triple_count FROM ldcache_entries ORDER BY retrieved_at ASC
+query.entries_expired = SELECT id,retrieved_at,expires_at,resource_id,update_count FROM ldcache_entries WHERE expires_at < now() ORDER BY retrieved_at ASC
+query.entries_all     = SELECT id,retrieved_at,expires_at,resource_id,update_count FROM ldcache_entries ORDER BY retrieved_at ASC

http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/4aa87dbe/libraries/ldcache/ldcache-backend-kiwi/src/main/resources/org/apache/marmotta/kiwi/persistence/mysql/upgrade_ldcache_001_002.sql
----------------------------------------------------------------------
diff --git a/libraries/ldcache/ldcache-backend-kiwi/src/main/resources/org/apache/marmotta/kiwi/persistence/mysql/upgrade_ldcache_001_002.sql b/libraries/ldcache/ldcache-backend-kiwi/src/main/resources/org/apache/marmotta/kiwi/persistence/mysql/upgrade_ldcache_001_002.sql
deleted file mode 100644
index d9b9966..0000000
--- a/libraries/ldcache/ldcache-backend-kiwi/src/main/resources/org/apache/marmotta/kiwi/persistence/mysql/upgrade_ldcache_001_002.sql
+++ /dev/null
@@ -1,19 +0,0 @@
--- Licensed to the Apache Software Foundation (ASF) under one or more
--- contributor license agreements.  See the NOTICE file distributed with
--- this work for additional information regarding copyright ownership.
--- The ASF licenses this file to You under the Apache License, Version 2.0
--- (the "License"); you may not use this file except in compliance with
--- the License.  You may obtain a copy of the License at
---
---      http://www.apache.org/licenses/LICENSE-2.0
---
--- Unless required by applicable law or agreed to in writing, software
--- distributed under the License is distributed on an "AS IS" BASIS,
--- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
--- See the License for the specific language governing permissions and
--- limitations under the License.
-
-ALTER TABLE ldcache_entries ADD COLUMN triple_count int NOT NULL DEFAULT 0;
-UPDATE
-  ldcache_entries
-SET triple_count = (SELECT count(*) as numTriples FROM triples WHERE subject = ldcache_entries.resource_id and deleted = false)
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/4aa87dbe/libraries/ldcache/ldcache-backend-kiwi/src/main/resources/org/apache/marmotta/kiwi/persistence/pgsql/create_ldcache_tables.sql
----------------------------------------------------------------------
diff --git a/libraries/ldcache/ldcache-backend-kiwi/src/main/resources/org/apache/marmotta/kiwi/persistence/pgsql/create_ldcache_tables.sql b/libraries/ldcache/ldcache-backend-kiwi/src/main/resources/org/apache/marmotta/kiwi/persistence/pgsql/create_ldcache_tables.sql
index 08b2276..05a4b7c 100644
--- a/libraries/ldcache/ldcache-backend-kiwi/src/main/resources/org/apache/marmotta/kiwi/persistence/pgsql/create_ldcache_tables.sql
+++ b/libraries/ldcache/ldcache-backend-kiwi/src/main/resources/org/apache/marmotta/kiwi/persistence/pgsql/create_ldcache_tables.sql
@@ -20,7 +20,6 @@ CREATE TABLE ldcache_entries (
   expires_at   timestamp  NOT NULL,
   resource_id  bigint     NOT NULL REFERENCES nodes(id),
   update_count int        NOT NULL DEFAULT 0,
-  triple_count int        NOT NULL DEFAULT 0,
   PRIMARY KEY(id)
 );
 

http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/4aa87dbe/libraries/ldcache/ldcache-backend-kiwi/src/main/resources/org/apache/marmotta/kiwi/persistence/pgsql/statements.properties
----------------------------------------------------------------------
diff --git a/libraries/ldcache/ldcache-backend-kiwi/src/main/resources/org/apache/marmotta/kiwi/persistence/pgsql/statements.properties b/libraries/ldcache/ldcache-backend-kiwi/src/main/resources/org/apache/marmotta/kiwi/persistence/pgsql/statements.properties
index d6cbb1f..8abd8c1 100644
--- a/libraries/ldcache/ldcache-backend-kiwi/src/main/resources/org/apache/marmotta/kiwi/persistence/pgsql/statements.properties
+++ b/libraries/ldcache/ldcache-backend-kiwi/src/main/resources/org/apache/marmotta/kiwi/persistence/pgsql/statements.properties
@@ -18,15 +18,14 @@
 
 # get sequence numbers
 seq.ldcache           = SELECT nextval('seq_ldcache')
-seq.ldcache.set       = SELECT setval('seq_ldcache',?)
 
-load.entry_by_id      = SELECT id,retrieved_at,expires_at,resource_id,update_count,triple_count FROM ldcache_entries WHERE id = ?
-load.entry_by_uri     = SELECT E.id,retrieved_at,expires_at,resource_id,update_count,triple_count FROM ldcache_entries E, nodes N WHERE e.resource_id = N.id AND N.ntype = 'uri' and N.svalue = ?
+load.entry_by_id      = SELECT id,retrieved_at,expires_at,resource_id,update_count FROM ldcache_entries WHERE id = ?
+load.entry_by_uri     = SELECT E.id,retrieved_at,expires_at,resource_id,update_count FROM ldcache_entries E, nodes N WHERE e.resource_id = N.id AND N.ntype = 'uri' and N.svalue = ?
 
 # store ldcache entry information
-store.entry           = INSERT INTO ldcache_entries (id,retrieved_at,expires_at,resource_id,update_count,triple_count) VALUES (?,?,?,?,?,?)
+store.entry           = INSERT INTO ldcache_entries (id,retrieved_at,expires_at,resource_id,update_count) VALUES (?,?,?,?,?)
 delete.entry          = DELETE FROM ldcache_entries WHERE id = ?
 delete.entry_by_uri   = DELETE FROM ldcache_entries WHERE resource_id IN (SELECT id FROM nodes WHERE ntype='uri' AND svalue = ?)
 
-query.entries_expired = SELECT id,retrieved_at,expires_at,resource_id,update_count,triple_count FROM ldcache_entries WHERE expires_at < now() ORDER BY retrieved_at ASC
-query.entries_all     = SELECT id,retrieved_at,expires_at,resource_id,update_count,triple_count FROM ldcache_entries ORDER BY retrieved_at ASC
+query.entries_expired = SELECT id,retrieved_at,expires_at,resource_id,update_count FROM ldcache_entries WHERE expires_at < now() ORDER BY retrieved_at ASC
+query.entries_all     = SELECT id,retrieved_at,expires_at,resource_id,update_count FROM ldcache_entries ORDER BY retrieved_at ASC

http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/4aa87dbe/libraries/ldcache/ldcache-backend-kiwi/src/main/resources/org/apache/marmotta/kiwi/persistence/pgsql/upgrade_ldcache_001_002.sql
----------------------------------------------------------------------
diff --git a/libraries/ldcache/ldcache-backend-kiwi/src/main/resources/org/apache/marmotta/kiwi/persistence/pgsql/upgrade_ldcache_001_002.sql b/libraries/ldcache/ldcache-backend-kiwi/src/main/resources/org/apache/marmotta/kiwi/persistence/pgsql/upgrade_ldcache_001_002.sql
deleted file mode 100644
index d9b9966..0000000
--- a/libraries/ldcache/ldcache-backend-kiwi/src/main/resources/org/apache/marmotta/kiwi/persistence/pgsql/upgrade_ldcache_001_002.sql
+++ /dev/null
@@ -1,19 +0,0 @@
--- Licensed to the Apache Software Foundation (ASF) under one or more
--- contributor license agreements.  See the NOTICE file distributed with
--- this work for additional information regarding copyright ownership.
--- The ASF licenses this file to You under the Apache License, Version 2.0
--- (the "License"); you may not use this file except in compliance with
--- the License.  You may obtain a copy of the License at
---
---      http://www.apache.org/licenses/LICENSE-2.0
---
--- Unless required by applicable law or agreed to in writing, software
--- distributed under the License is distributed on an "AS IS" BASIS,
--- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
--- See the License for the specific language governing permissions and
--- limitations under the License.
-
-ALTER TABLE ldcache_entries ADD COLUMN triple_count int NOT NULL DEFAULT 0;
-UPDATE
-  ldcache_entries
-SET triple_count = (SELECT count(*) as numTriples FROM triples WHERE subject = ldcache_entries.resource_id and deleted = false)
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/4aa87dbe/libraries/ldcache/ldcache-backend-kiwi/src/test/java/org/apache/marmotta/ldcache/backend/kiwi/test/LDCacheBackendTest.java
----------------------------------------------------------------------
diff --git a/libraries/ldcache/ldcache-backend-kiwi/src/test/java/org/apache/marmotta/ldcache/backend/kiwi/test/LDCacheBackendTest.java b/libraries/ldcache/ldcache-backend-kiwi/src/test/java/org/apache/marmotta/ldcache/backend/kiwi/test/LDCacheBackendTest.java
index e0ab3e8..bfd12c9 100644
--- a/libraries/ldcache/ldcache-backend-kiwi/src/test/java/org/apache/marmotta/ldcache/backend/kiwi/test/LDCacheBackendTest.java
+++ b/libraries/ldcache/ldcache-backend-kiwi/src/test/java/org/apache/marmotta/ldcache/backend/kiwi/test/LDCacheBackendTest.java
@@ -18,7 +18,7 @@
 package org.apache.marmotta.ldcache.backend.kiwi.test;
 
 import info.aduna.iteration.CloseableIteration;
-import org.apache.commons.lang3.RandomStringUtils;
+import org.apache.commons.lang.RandomStringUtils;
 import org.apache.marmotta.kiwi.persistence.KiWiDialect;
 import org.apache.marmotta.kiwi.persistence.h2.H2Dialect;
 import org.apache.marmotta.kiwi.persistence.mysql.MySQLDialect;
@@ -249,12 +249,9 @@ public class LDCacheBackendTest {
             entry1.setLastRetrieved(new Date());
             entry1.setUpdateCount(1);
             entry1.setResource(subject1);
-            entry1.setTripleCount(1);
             con.addCacheEntry(subject1, entry1);
             con.commit();
 
-            Assert.assertTrue(backend.isCached(subject1.stringValue()));
-            Assert.assertFalse(backend.isCached(subject2.stringValue()));
             Assert.assertEquals(1,asList(backend.listCacheEntries()).size());
             Assert.assertEquals(0,asList(backend.listExpiredEntries()).size());
 
@@ -264,13 +261,10 @@ public class LDCacheBackendTest {
             entry2.setLastRetrieved(new Date());
             entry2.setUpdateCount(1);
             entry2.setResource(subject2);
-            entry2.setTripleCount(1);
             con.addCacheEntry(subject2,entry2);
 
             con.commit();
 
-            Assert.assertTrue(backend.isCached(subject1.stringValue()));
-            Assert.assertTrue(backend.isCached(subject2.stringValue()));
             Assert.assertEquals(2,asList(backend.listCacheEntries()).size());
             Assert.assertEquals(1,asList(backend.listExpiredEntries()).size());
 
@@ -278,8 +272,6 @@ public class LDCacheBackendTest {
             con.removeCacheEntry(subject1);
             con.commit();
 
-            Assert.assertFalse(backend.isCached(subject1.stringValue()));
-            Assert.assertTrue(backend.isCached(subject2.stringValue()));
             Assert.assertEquals(1,asList(backend.listCacheEntries()).size());
             Assert.assertEquals(1,asList(backend.listExpiredEntries()).size());
         } catch(RepositoryException ex) {

http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/4aa87dbe/libraries/ldcache/ldcache-backend-kiwi/src/test/java/org/apache/marmotta/ldcache/backend/kiwi/test/LDCachePersistenceTest.java
----------------------------------------------------------------------
diff --git a/libraries/ldcache/ldcache-backend-kiwi/src/test/java/org/apache/marmotta/ldcache/backend/kiwi/test/LDCachePersistenceTest.java b/libraries/ldcache/ldcache-backend-kiwi/src/test/java/org/apache/marmotta/ldcache/backend/kiwi/test/LDCachePersistenceTest.java
index d066405..c25f166 100644
--- a/libraries/ldcache/ldcache-backend-kiwi/src/test/java/org/apache/marmotta/ldcache/backend/kiwi/test/LDCachePersistenceTest.java
+++ b/libraries/ldcache/ldcache-backend-kiwi/src/test/java/org/apache/marmotta/ldcache/backend/kiwi/test/LDCachePersistenceTest.java
@@ -18,7 +18,7 @@
 package org.apache.marmotta.ldcache.backend.kiwi.test;
 
 import info.aduna.iteration.CloseableIteration;
-import org.apache.commons.lang3.RandomStringUtils;
+import org.apache.commons.lang.RandomStringUtils;
 import org.apache.marmotta.kiwi.model.rdf.KiWiUriResource;
 import org.apache.marmotta.kiwi.persistence.KiWiDialect;
 import org.apache.marmotta.kiwi.persistence.KiWiPersistence;
@@ -136,7 +136,6 @@ public class LDCachePersistenceTest {
     @Before
     public void initDatabase() throws SQLException {
         persistence = new KiWiPersistence("test",jdbcUrl,jdbcUser,jdbcPass,dialect);
-        persistence.initialise();
         persistence.initDatabase();
 
         vpersistence = new LDCachingKiWiPersistence(persistence);
@@ -171,7 +170,7 @@ public class LDCachePersistenceTest {
         LDCachingKiWiPersistenceConnection connection = vpersistence.getConnection();
         try {
             Assert.assertThat(connection.getDatabaseTables(), hasItems("ldcache_entries"));
-            Assert.assertEquals(2, connection.getDatabaseVersion());
+            Assert.assertEquals(1, connection.getDatabaseVersion());
 
             connection.commit();
         } finally {
@@ -194,7 +193,6 @@ public class LDCachePersistenceTest {
             entry1.setLastRetrieved(new Date());
             entry1.setUpdateCount(1);
             entry1.setResource(subject1);
-            entry1.setTripleCount(1);
             connection.storeCacheEntry(entry1);
 
             connection.commit();
@@ -207,7 +205,6 @@ public class LDCachePersistenceTest {
             entry2.setLastRetrieved(new Date());
             entry2.setUpdateCount(1);
             entry2.setResource(subject2);
-            entry2.setTripleCount(1);
             connection.storeCacheEntry(entry2);
 
             connection.commit();
@@ -255,7 +252,6 @@ public class LDCachePersistenceTest {
             entry1.setLastRetrieved(new Date());
             entry1.setUpdateCount(1);
             entry1.setResource(subject1);
-            entry1.setTripleCount(1);
             connection.storeCacheEntry(entry1);
 
             KiWiCacheEntry entry2 = new KiWiCacheEntry();
@@ -263,7 +259,6 @@ public class LDCachePersistenceTest {
             entry2.setLastRetrieved(new Date());
             entry2.setUpdateCount(1);
             entry2.setResource(subject2);
-            entry2.setTripleCount(1);
             connection.storeCacheEntry(entry2);
 
             connection.commit();

http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/4aa87dbe/libraries/ldcache/ldcache-backend-mapdb/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/ldcache/ldcache-backend-mapdb/pom.xml b/libraries/ldcache/ldcache-backend-mapdb/pom.xml
index 2b66c90..ea83c15 100644
--- a/libraries/ldcache/ldcache-backend-mapdb/pom.xml
+++ b/libraries/ldcache/ldcache-backend-mapdb/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.1.0-incubating-SNAPSHOT</version>
+        <version>3.0.0-incubating-SNAPSHOT</version>
         <relativePath>../../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/4aa87dbe/libraries/ldcache/ldcache-core/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/ldcache/ldcache-core/pom.xml b/libraries/ldcache/ldcache-core/pom.xml
index 7499cc7..801f422 100644
--- a/libraries/ldcache/ldcache-core/pom.xml
+++ b/libraries/ldcache/ldcache-core/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0-incubating-SNAPSHOT</version>
+        <version>3.1.0-incubating-SNAPSHOT</version>
         <relativePath>../../../parent</relativePath>
     </parent>
 
@@ -29,27 +29,6 @@
     <name>LDCache: Core Library</name>
 
     <build>
-        <pluginManagement>
-            <plugins>
-                <plugin> <!-- generate JRebel Configuration -->
-                    <groupId>org.zeroturnaround</groupId>
-                    <artifactId>jrebel-maven-plugin</artifactId>
-                    <executions>
-                        <execution>
-                            <id>generate-rebel-xml</id>
-                            <phase>process-resources</phase>
-                            <goals>
-                                <goal>generate</goal>
-                            </goals>
-                        </execution>
-                    </executions>
-                    <configuration>
-                        <relativePath>../../../</relativePath>
-                        <rootPath>$${rebel.root}</rootPath>
-                    </configuration>
-                </plugin>
-            </plugins>
-        </pluginManagement>
         <plugins>
             <plugin>
                 <groupId>org.apache.maven.plugins</groupId>
@@ -98,8 +77,8 @@
             <artifactId>marmotta-commons</artifactId>
         </dependency>
         <dependency>
-            <groupId>org.apache.commons</groupId>
-            <artifactId>commons-lang3</artifactId>
+            <groupId>commons-lang</groupId>
+            <artifactId>commons-lang</artifactId>
         </dependency>
 
         <!-- LDClient -->
@@ -173,7 +152,7 @@
             <scope>test</scope>
         </dependency>
         <dependency>
-            <groupId>org.postgresql</groupId>
+            <groupId>org.jumpmind.symmetric.jdbc</groupId>
             <artifactId>postgresql</artifactId>
             <scope>test</scope>
         </dependency>

http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/4aa87dbe/libraries/ldcache/ldcache-core/src/main/java/org/apache/marmotta/ldcache/services/LDCache.java
----------------------------------------------------------------------
diff --git a/libraries/ldcache/ldcache-core/src/main/java/org/apache/marmotta/ldcache/services/LDCache.java b/libraries/ldcache/ldcache-core/src/main/java/org/apache/marmotta/ldcache/services/LDCache.java
index d28a571..89ee13b 100644
--- a/libraries/ldcache/ldcache-core/src/main/java/org/apache/marmotta/ldcache/services/LDCache.java
+++ b/libraries/ldcache/ldcache-core/src/main/java/org/apache/marmotta/ldcache/services/LDCache.java
@@ -18,7 +18,6 @@
 package org.apache.marmotta.ldcache.services;
 
 import info.aduna.iteration.CloseableIteration;
-import org.apache.marmotta.commons.locking.ObjectLocks;
 import org.apache.marmotta.ldcache.api.LDCachingBackend;
 import org.apache.marmotta.ldcache.api.LDCachingConnection;
 import org.apache.marmotta.ldcache.api.LDCachingService;
@@ -28,6 +27,7 @@ import org.apache.marmotta.ldclient.api.ldclient.LDClientService;
 import org.apache.marmotta.ldclient.exception.DataRetrievalException;
 import org.apache.marmotta.ldclient.model.ClientResponse;
 import org.apache.marmotta.ldclient.services.ldclient.LDClient;
+import org.openrdf.model.Resource;
 import org.openrdf.model.Statement;
 import org.openrdf.model.URI;
 import org.openrdf.repository.RepositoryConnection;
@@ -37,6 +37,8 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 import java.util.Date;
+import java.util.HashMap;
+import java.util.concurrent.locks.ReentrantLock;
 import java.util.concurrent.locks.ReentrantReadWriteLock;
 
 /**
@@ -52,7 +54,7 @@ public class LDCache implements LDCachingService {
 
 
     // lock a resource while refreshing it so that not several threads trigger a refresh at the same time
-    private ObjectLocks resourceLocks;
+    private HashMap<Resource,ReentrantLock> resourceLocks;
 
     private LDClientService  ldclient;
 
@@ -71,7 +73,7 @@ public class LDCache implements LDCachingService {
     public LDCache(CacheConfiguration config, LDCachingBackend backend) {
         log.info("Linked Data Caching Service initialising ...");
 
-        this.resourceLocks = new ObjectLocks();
+        this.resourceLocks = new HashMap<Resource, ReentrantLock>();
         this.backend  = backend;
         this.ldclient = new LDClient(config.getClientConfiguration());
         this.config   = config;
@@ -125,31 +127,6 @@ public class LDCache implements LDCachingService {
         return backend.listExpiredEntries();
     }
 
-
-    /**
-     * Return true if the resource is a cached resource.
-     *
-     * @param resourceUri
-     * @return
-     * @throws RepositoryException
-     */
-    public boolean isCached(String resourceUri) throws RepositoryException {
-        // if there is no cache entry, then return false in any case
-        if(!backend.isCached(resourceUri)) {
-            return false;
-        } else {
-            // else list all cached triples - if there are none, the resource is not cached (e.g. blacklist or no LD resource)
-            RepositoryConnection con = backend.getCacheConnection(resourceUri);
-            try {
-                con.begin();
-                return con.hasStatement(con.getValueFactory().createURI(resourceUri), null, null, false);
-            } finally {
-                con.commit();
-                con.close();
-            }
-        }
-    }
-
     /**
      * Manually expire the caching information for the given resource. The resource will be
      * re-retrieved upon the next access.
@@ -205,7 +182,7 @@ public class LDCache implements LDCachingService {
      */
     @Override
     public void refreshResource(URI resource, boolean forceRefresh) {
-        resourceLocks.lock(resource.stringValue());
+        final ReentrantLock lock = lockResource(resource);
         try {
             LDCachingConnection cacheConnection = backend.getCacheConnection(resource.stringValue());
             CacheEntry entry = null;
@@ -248,7 +225,7 @@ public class LDCache implements LDCachingService {
 
                         cacheConnection1.remove(subject, null, null);
 
-                        int count = 0;
+
                         RepositoryResult<Statement> triples = respConnection.getStatements(null,null,null,true);
                         while(triples.hasNext()) {
                             Statement triple = triples.next();
@@ -257,7 +234,6 @@ public class LDCache implements LDCachingService {
                             } catch (RuntimeException ex) {
                                 log.warn("not adding triple {}: an exception occurred ({})",triple,ex.getMessage());
                             }
-                            count++;
                         }
                         triples.close();
                         respConnection.close();
@@ -271,7 +247,6 @@ public class LDCache implements LDCachingService {
                         } else {
                             newEntry.setUpdateCount(1);
                         }
-                        newEntry.setTripleCount(count);
 
                         cacheConnection1.removeCacheEntry(resource);
                         cacheConnection1.addCacheEntry(resource, newEntry);
@@ -295,7 +270,6 @@ public class LDCache implements LDCachingService {
                 } else {
                     newEntry.setUpdateCount(1);
                 }
-                newEntry.setTripleCount(0);
 
                 LDCachingConnection cacheConnection2 = backend.getCacheConnection(resource.stringValue());
                 cacheConnection2.begin();
@@ -319,7 +293,7 @@ public class LDCache implements LDCachingService {
         } catch (RepositoryException e) {
             log.error("repository exception while obtaining cache connection",e);
         } finally {
-            resourceLocks.unlock(resource.stringValue());
+            unlockResource(resource, lock);
         }
 
     }
@@ -416,4 +390,38 @@ public class LDCache implements LDCachingService {
     public LDClientService getLDClient() {
         return ldclient;
     }
+
+    private ReentrantLock lockResource(final URI resource) {
+        ReentrantLock lock;
+        synchronized (resourceLocks) {
+            lock = resourceLocks.get(resource);
+            if(lock == null) {
+                lock = new ReentrantLock();
+                resourceLocks.put(resource,lock);
+            }
+        }
+        lock.lock();
+        return lock;
+    }
+
+    private void unlockResource(final URI resource, final ReentrantLock lock) {
+        synchronized (resourceLocks) {
+            // lock = resourceLocks.get(resource);
+            if (lock != null) {
+                if (!lock.hasQueuedThreads()) {
+                    resourceLocks.remove(resource);
+                }
+            }
+        }
+        if (lock != null) {
+            try {
+                lock.unlock();
+            } catch (IllegalMonitorStateException e) {
+                log.error("Could not release lock for {} (Thread: {}, Lock: {})", resource, Thread.currentThread().getName(), lock.toString() );
+                throw e;
+            }
+
+        }
+    }
+
 }

http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/4aa87dbe/libraries/ldcache/ldcache-core/src/test/java/org/apache/marmotta/ldcache/services/test/LDCacheKiWiTest.java
----------------------------------------------------------------------
diff --git a/libraries/ldcache/ldcache-core/src/test/java/org/apache/marmotta/ldcache/services/test/LDCacheKiWiTest.java b/libraries/ldcache/ldcache-core/src/test/java/org/apache/marmotta/ldcache/services/test/LDCacheKiWiTest.java
index b22b600..be5d789 100644
--- a/libraries/ldcache/ldcache-core/src/test/java/org/apache/marmotta/ldcache/services/test/LDCacheKiWiTest.java
+++ b/libraries/ldcache/ldcache-core/src/test/java/org/apache/marmotta/ldcache/services/test/LDCacheKiWiTest.java
@@ -274,11 +274,6 @@ public class LDCacheKiWiTest {
                 Thread.sleep(1000);
             } catch (InterruptedException e) {
             }
-        } else {
-            try {
-                Thread.sleep(100);
-            } catch (InterruptedException e) {
-            }
         }
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/4aa87dbe/libraries/ldcache/ldcache-core/src/test/java/org/apache/marmotta/ldcache/services/test/dummy/DummyProvider.java
----------------------------------------------------------------------
diff --git a/libraries/ldcache/ldcache-core/src/test/java/org/apache/marmotta/ldcache/services/test/dummy/DummyProvider.java b/libraries/ldcache/ldcache-core/src/test/java/org/apache/marmotta/ldcache/services/test/dummy/DummyProvider.java
index 4b6f92a..ca1b451 100644
--- a/libraries/ldcache/ldcache-core/src/test/java/org/apache/marmotta/ldcache/services/test/dummy/DummyProvider.java
+++ b/libraries/ldcache/ldcache-core/src/test/java/org/apache/marmotta/ldcache/services/test/dummy/DummyProvider.java
@@ -69,7 +69,7 @@ public class DummyProvider implements DataProvider {
                 con.close();
             }
 
-            ClientResponse response = new ClientResponse(200, triples);
+            ClientResponse response = new ClientResponse(triples);
 
             return response;
         } catch (RepositoryException e) {

http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/4aa87dbe/libraries/ldcache/ldcache-sail-generic/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/ldcache/ldcache-sail-generic/pom.xml b/libraries/ldcache/ldcache-sail-generic/pom.xml
index b43d08c..6e72dbd 100644
--- a/libraries/ldcache/ldcache-sail-generic/pom.xml
+++ b/libraries/ldcache/ldcache-sail-generic/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0-incubating-SNAPSHOT</version>
+        <version>3.1.0-incubating-SNAPSHOT</version>
         <relativePath>../../../parent</relativePath>
     </parent>
 
@@ -33,30 +33,6 @@
         on demand when needed. Can be wrapped around other Sesame SAILs.
     </description>
 
-    <build>
-        <pluginManagement>
-            <plugins>
-                <plugin> <!-- generate JRebel Configuration -->
-                    <groupId>org.zeroturnaround</groupId>
-                    <artifactId>jrebel-maven-plugin</artifactId>
-                    <executions>
-                        <execution>
-                            <id>generate-rebel-xml</id>
-                            <phase>process-resources</phase>
-                            <goals>
-                                <goal>generate</goal>
-                            </goals>
-                        </execution>
-                    </executions>
-                    <configuration>
-                        <relativePath>../../../</relativePath>
-                        <rootPath>$${rebel.root}</rootPath>
-                    </configuration>
-                </plugin>
-            </plugins>
-        </pluginManagement>
-    </build>
-
     <dependencies>
         <dependency>
             <groupId>org.openrdf.sesame</groupId>

http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/4aa87dbe/libraries/ldcache/ldcache-sail-generic/src/test/java/org/apache/marmotta/ldcache/sail/test/dummy/DummyProvider.java
----------------------------------------------------------------------
diff --git a/libraries/ldcache/ldcache-sail-generic/src/test/java/org/apache/marmotta/ldcache/sail/test/dummy/DummyProvider.java b/libraries/ldcache/ldcache-sail-generic/src/test/java/org/apache/marmotta/ldcache/sail/test/dummy/DummyProvider.java
index 15f3d81..cd58e55 100644
--- a/libraries/ldcache/ldcache-sail-generic/src/test/java/org/apache/marmotta/ldcache/sail/test/dummy/DummyProvider.java
+++ b/libraries/ldcache/ldcache-sail-generic/src/test/java/org/apache/marmotta/ldcache/sail/test/dummy/DummyProvider.java
@@ -69,7 +69,7 @@ public class DummyProvider implements DataProvider {
                 con.close();
             }
 
-            ClientResponse response = new ClientResponse(200, triples);
+            ClientResponse response = new ClientResponse(triples);
 
             return response;
         } catch (RepositoryException e) {

http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/4aa87dbe/libraries/ldcache/ldcache-sail-kiwi/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/ldcache/ldcache-sail-kiwi/pom.xml b/libraries/ldcache/ldcache-sail-kiwi/pom.xml
index 428fe07..6a875af 100644
--- a/libraries/ldcache/ldcache-sail-kiwi/pom.xml
+++ b/libraries/ldcache/ldcache-sail-kiwi/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0-incubating-SNAPSHOT</version>
+        <version>3.1.0-incubating-SNAPSHOT</version>
         <relativePath>../../../parent</relativePath>
     </parent>
 
@@ -35,27 +35,6 @@
 
 
     <build>
-        <pluginManagement>
-            <plugins>
-                <plugin> <!-- generate JRebel Configuration -->
-                    <groupId>org.zeroturnaround</groupId>
-                    <artifactId>jrebel-maven-plugin</artifactId>
-                    <executions>
-                        <execution>
-                            <id>generate-rebel-xml</id>
-                            <phase>process-resources</phase>
-                            <goals>
-                                <goal>generate</goal>
-                            </goals>
-                        </execution>
-                    </executions>
-                    <configuration>
-                        <relativePath>../../../</relativePath>
-                        <rootPath>$${rebel.root}</rootPath>
-                    </configuration>
-                </plugin>
-            </plugins>
-        </pluginManagement>
         <plugins>
             <plugin>
                 <groupId>org.apache.maven.plugins</groupId>
@@ -120,8 +99,8 @@
             <artifactId>sesame-filter</artifactId>
         </dependency>
         <dependency>
-            <groupId>org.apache.commons</groupId>
-            <artifactId>commons-lang3</artifactId>
+            <groupId>commons-lang</groupId>
+            <artifactId>commons-lang</artifactId>
         </dependency>
 
         <!-- LDClient -->
@@ -194,7 +173,7 @@
             <scope>test</scope>
         </dependency>
         <dependency>
-            <groupId>org.postgresql</groupId>
+            <groupId>org.jumpmind.symmetric.jdbc</groupId>
             <artifactId>postgresql</artifactId>
             <scope>test</scope>
         </dependency>

http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/4aa87dbe/libraries/ldcache/ldcache-sail-kiwi/src/test/java/org/apache/marmotta/ldcache/sail/test/KiWiLinkedDataSailOfflineTest.java
----------------------------------------------------------------------
diff --git a/libraries/ldcache/ldcache-sail-kiwi/src/test/java/org/apache/marmotta/ldcache/sail/test/KiWiLinkedDataSailOfflineTest.java b/libraries/ldcache/ldcache-sail-kiwi/src/test/java/org/apache/marmotta/ldcache/sail/test/KiWiLinkedDataSailOfflineTest.java
index 8b2de31..20501b4 100644
--- a/libraries/ldcache/ldcache-sail-kiwi/src/test/java/org/apache/marmotta/ldcache/sail/test/KiWiLinkedDataSailOfflineTest.java
+++ b/libraries/ldcache/ldcache-sail-kiwi/src/test/java/org/apache/marmotta/ldcache/sail/test/KiWiLinkedDataSailOfflineTest.java
@@ -47,7 +47,6 @@ import java.util.ArrayList;
 import java.util.List;
 
 import static org.hamcrest.CoreMatchers.allOf;
-import static org.hamcrest.CoreMatchers.hasItems;
 import static org.hamcrest.Matchers.hasProperty;
 import static org.hamcrest.Matchers.hasToString;
 
@@ -183,9 +182,9 @@ public class KiWiLinkedDataSailOfflineTest {
             List<Statement> list1 = asList(con.getStatements(con.getValueFactory().createURI(uri1), null, null, true));
 
             Assert.assertEquals(3,list1.size());
-            Assert.assertThat(list1, CoreMatchers.<Statement>hasItems(
-                    hasProperty("object", hasToString("\"Value 1\"^^xsd:string")),
-                    hasProperty("object", hasToString("\"Value X\"^^xsd:string"))
+            Assert.assertThat(list1, allOf(
+                    CoreMatchers.<Statement>hasItem(hasProperty("object", hasToString("\"Value 1\"^^xsd:string"))),
+                    CoreMatchers.<Statement>hasItem(hasProperty("object", hasToString("\"Value X\"^^xsd:string")))
             ));
 
 

http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/4aa87dbe/libraries/ldcache/ldcache-sail-kiwi/src/test/java/org/apache/marmotta/ldcache/sail/test/dummy/DummyProvider.java
----------------------------------------------------------------------
diff --git a/libraries/ldcache/ldcache-sail-kiwi/src/test/java/org/apache/marmotta/ldcache/sail/test/dummy/DummyProvider.java b/libraries/ldcache/ldcache-sail-kiwi/src/test/java/org/apache/marmotta/ldcache/sail/test/dummy/DummyProvider.java
index 15f3d81..cd58e55 100644
--- a/libraries/ldcache/ldcache-sail-kiwi/src/test/java/org/apache/marmotta/ldcache/sail/test/dummy/DummyProvider.java
+++ b/libraries/ldcache/ldcache-sail-kiwi/src/test/java/org/apache/marmotta/ldcache/sail/test/dummy/DummyProvider.java
@@ -69,7 +69,7 @@ public class DummyProvider implements DataProvider {
                 con.close();
             }
 
-            ClientResponse response = new ClientResponse(200, triples);
+            ClientResponse response = new ClientResponse(triples);
 
             return response;
         } catch (RepositoryException e) {

http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/4aa87dbe/libraries/ldcache/ldcache-sail-kiwi/src/test/resources/org/apache/marmotta/ldcache/sail/test/dummy/resource1.ttl
----------------------------------------------------------------------
diff --git a/libraries/ldcache/ldcache-sail-kiwi/src/test/resources/org/apache/marmotta/ldcache/sail/test/dummy/resource1.ttl b/libraries/ldcache/ldcache-sail-kiwi/src/test/resources/org/apache/marmotta/ldcache/sail/test/dummy/resource1.ttl
index 6d9e0cd..1e6b487 100644
--- a/libraries/ldcache/ldcache-sail-kiwi/src/test/resources/org/apache/marmotta/ldcache/sail/test/dummy/resource1.ttl
+++ b/libraries/ldcache/ldcache-sail-kiwi/src/test/resources/org/apache/marmotta/ldcache/sail/test/dummy/resource1.ttl
@@ -16,6 +16,6 @@
 # limitations under the License.
 #
 @prefix ex: <http://remote/> .
-ex:resource1 ex:property1 "Value 1"^^xsd:string ;
+ex:resource1 ex:property1 "Value 1" ;
              ex:property2 ex:resource2 ;
-             ex:property3 "Value X"^^xsd:string .
\ No newline at end of file
+             ex:property3 "Value X" .
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/4aa87dbe/libraries/ldcache/ldcache-sail-kiwi/src/test/resources/org/apache/marmotta/ldcache/sail/test/dummy/resource2.ttl
----------------------------------------------------------------------
diff --git a/libraries/ldcache/ldcache-sail-kiwi/src/test/resources/org/apache/marmotta/ldcache/sail/test/dummy/resource2.ttl b/libraries/ldcache/ldcache-sail-kiwi/src/test/resources/org/apache/marmotta/ldcache/sail/test/dummy/resource2.ttl
index b91edff..56e2544 100644
--- a/libraries/ldcache/ldcache-sail-kiwi/src/test/resources/org/apache/marmotta/ldcache/sail/test/dummy/resource2.ttl
+++ b/libraries/ldcache/ldcache-sail-kiwi/src/test/resources/org/apache/marmotta/ldcache/sail/test/dummy/resource2.ttl
@@ -16,5 +16,5 @@
 # limitations under the License.
 #
 @prefix ex: <http://remote/> .
-ex:resource2 ex:property1 "Value 2"^^xsd:string ;
+ex:resource2 ex:property1 "Value 2" ;
              ex:property2 ex:resource3 .
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/4aa87dbe/libraries/ldcache/ldcache-sail-kiwi/src/test/resources/org/apache/marmotta/ldcache/sail/test/dummy/resource3.ttl
----------------------------------------------------------------------
diff --git a/libraries/ldcache/ldcache-sail-kiwi/src/test/resources/org/apache/marmotta/ldcache/sail/test/dummy/resource3.ttl b/libraries/ldcache/ldcache-sail-kiwi/src/test/resources/org/apache/marmotta/ldcache/sail/test/dummy/resource3.ttl
index 2e4ab86..7d16a7d 100644
--- a/libraries/ldcache/ldcache-sail-kiwi/src/test/resources/org/apache/marmotta/ldcache/sail/test/dummy/resource3.ttl
+++ b/libraries/ldcache/ldcache-sail-kiwi/src/test/resources/org/apache/marmotta/ldcache/sail/test/dummy/resource3.ttl
@@ -16,5 +16,5 @@
 # limitations under the License.
 #
 @prefix ex: <http://remote/> .
-ex:resource3 ex:property1 "Value 3"^^xsd:string ;
-             ex:property3 "Value 4"^^xsd:string .
\ No newline at end of file
+ex:resource3 ex:property1 "Value 3" ;
+             ex:property3 "Value 4" .
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/4aa87dbe/libraries/ldcache/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/ldcache/pom.xml b/libraries/ldcache/pom.xml
index d8de48e..b7d126d 100644
--- a/libraries/ldcache/pom.xml
+++ b/libraries/ldcache/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0-incubating-SNAPSHOT</version>
+        <version>3.1.0-incubating-SNAPSHOT</version>
         <relativePath>../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/4aa87dbe/libraries/ldclient/ldclient-api/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/ldclient/ldclient-api/pom.xml b/libraries/ldclient/ldclient-api/pom.xml
index 250f7fd..fc5786f 100644
--- a/libraries/ldclient/ldclient-api/pom.xml
+++ b/libraries/ldclient/ldclient-api/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0-incubating-SNAPSHOT</version>
+        <version>3.1.0-incubating-SNAPSHOT</version>
         <relativePath>../../../parent</relativePath>
     </parent>
 
@@ -59,8 +59,8 @@
             <artifactId>sesame-sail-memory</artifactId>
         </dependency>
         <dependency>
-            <groupId>org.apache.commons</groupId>
-            <artifactId>commons-lang3</artifactId>
+            <groupId>commons-lang</groupId>
+            <artifactId>commons-lang</artifactId>
         </dependency>
         <dependency>
             <groupId>org.apache.httpcomponents</groupId>

http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/4aa87dbe/libraries/ldclient/ldclient-api/src/main/java/org/apache/marmotta/ldclient/api/endpoint/Endpoint.java
----------------------------------------------------------------------
diff --git a/libraries/ldclient/ldclient-api/src/main/java/org/apache/marmotta/ldclient/api/endpoint/Endpoint.java b/libraries/ldclient/ldclient-api/src/main/java/org/apache/marmotta/ldclient/api/endpoint/Endpoint.java
index 16759d8..d4b77a3 100644
--- a/libraries/ldclient/ldclient-api/src/main/java/org/apache/marmotta/ldclient/api/endpoint/Endpoint.java
+++ b/libraries/ldclient/ldclient-api/src/main/java/org/apache/marmotta/ldclient/api/endpoint/Endpoint.java
@@ -139,18 +139,17 @@ public class Endpoint implements Comparable<Endpoint> {
     private Map<String,String> properties;
 
     public Endpoint() {
-        this.active = true;
-        this.contentTypes = new HashSet<ContentType>();
-        this.properties = new HashMap<String, String>();    	
     }
 
     public Endpoint(String name, String type, String uriPattern, String endpointUrl, Long defaultExpiry) {
-    	this();
         this.name = name;
         this.type = type;
         this.uriPattern = uriPattern;
         this.endpointUrl = endpointUrl;
+        this.contentTypes = new HashSet<ContentType>();
         this.defaultExpiry = defaultExpiry;
+        this.active = true;
+        this.properties = new HashMap<String, String>();
     }
 
     public Endpoint(String name, String type, String uriPattern, String endpointUrl, String contentType, Long defaultExpiry) {

http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/4aa87dbe/libraries/ldclient/ldclient-api/src/main/java/org/apache/marmotta/ldclient/model/ClientResponse.java
----------------------------------------------------------------------
diff --git a/libraries/ldclient/ldclient-api/src/main/java/org/apache/marmotta/ldclient/model/ClientResponse.java b/libraries/ldclient/ldclient-api/src/main/java/org/apache/marmotta/ldclient/model/ClientResponse.java
index 70ebf48..bf3c29f 100644
--- a/libraries/ldclient/ldclient-api/src/main/java/org/apache/marmotta/ldclient/model/ClientResponse.java
+++ b/libraries/ldclient/ldclient-api/src/main/java/org/apache/marmotta/ldclient/model/ClientResponse.java
@@ -17,7 +17,7 @@
  */
 package org.apache.marmotta.ldclient.model;
 
-import org.apache.commons.lang3.time.DateUtils;
+import org.apache.commons.lang.time.DateUtils;
 import org.openrdf.repository.Repository;
 
 import java.util.Date;
@@ -30,27 +30,15 @@ import java.util.Date;
  */
 public class ClientResponse {
 
-	private static final int DEFAULT_HTTP_CODE = 200;
-	
     private static final int DEFAULT_EXPIRATION_IN_DAYS = 7;
 
-    /**
-     * The HTTP status code returned by the client
-     */
-    private int httpStatus;
-
     private Repository triples;
 
     private Date expires;
-    
-    public ClientResponse(Repository triples) {
-    	this(DEFAULT_HTTP_CODE, triples);
-    }
 
-    public ClientResponse(int httpStatus, Repository triples) {
+    public ClientResponse(Repository triples) {
         this.triples = triples;
         this.expires = DateUtils.addDays(new Date(), DEFAULT_EXPIRATION_IN_DAYS);
-        this.httpStatus = httpStatus;
     }
 
     public Repository getTriples() {
@@ -69,11 +57,4 @@ public class ClientResponse {
         this.expires = new Date(expires.getTime());
     }
 
-    public int getHttpStatus() {
-        return httpStatus;
-    }
-
-    public void setHttpStatus(int httpStatus) {
-        this.httpStatus = httpStatus;
-    }
 }

http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/4aa87dbe/libraries/ldclient/ldclient-core/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/ldclient/ldclient-core/pom.xml b/libraries/ldclient/ldclient-core/pom.xml
index 93e5f65..6e80e58 100644
--- a/libraries/ldclient/ldclient-core/pom.xml
+++ b/libraries/ldclient/ldclient-core/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0-incubating-SNAPSHOT</version>
+        <version>3.1.0-incubating-SNAPSHOT</version>
         <relativePath>../../../parent</relativePath>
     </parent>
 
@@ -73,8 +73,8 @@
             <artifactId>marmotta-commons</artifactId>
         </dependency>
         <dependency>
-            <groupId>org.apache.commons</groupId>
-            <artifactId>commons-lang3</artifactId>
+            <groupId>commons-lang</groupId>
+            <artifactId>commons-lang</artifactId>
         </dependency>
 
         <!-- logging -->

http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/4aa87dbe/libraries/ldclient/ldclient-core/src/main/java/org/apache/marmotta/ldclient/services/ldclient/LDClient.java
----------------------------------------------------------------------
diff --git a/libraries/ldclient/ldclient-core/src/main/java/org/apache/marmotta/ldclient/services/ldclient/LDClient.java b/libraries/ldclient/ldclient-core/src/main/java/org/apache/marmotta/ldclient/services/ldclient/LDClient.java
index 13f2421..7fe6a9c 100644
--- a/libraries/ldclient/ldclient-core/src/main/java/org/apache/marmotta/ldclient/services/ldclient/LDClient.java
+++ b/libraries/ldclient/ldclient-core/src/main/java/org/apache/marmotta/ldclient/services/ldclient/LDClient.java
@@ -17,6 +17,7 @@
  */
 package org.apache.marmotta.ldclient.services.ldclient;
 
+import org.apache.commons.lang.NotImplementedException;
 import org.apache.http.Header;
 import org.apache.http.HttpRequest;
 import org.apache.http.HttpResponse;
@@ -160,7 +161,7 @@ public final class LDClient implements LDClientService {
                 return false;
             }
         } else {
-            throw new UnsupportedOperationException("protocol not supportted");
+            throw new NotImplementedException("protocol not supportted");
         }
         
         /*

http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/4aa87dbe/libraries/ldclient/ldclient-core/src/main/java/org/apache/marmotta/ldclient/services/provider/AbstractHttpProvider.java
----------------------------------------------------------------------
diff --git a/libraries/ldclient/ldclient-core/src/main/java/org/apache/marmotta/ldclient/services/provider/AbstractHttpProvider.java b/libraries/ldclient/ldclient-core/src/main/java/org/apache/marmotta/ldclient/services/provider/AbstractHttpProvider.java
index ef89751..175baa5 100644
--- a/libraries/ldclient/ldclient-core/src/main/java/org/apache/marmotta/ldclient/services/provider/AbstractHttpProvider.java
+++ b/libraries/ldclient/ldclient-core/src/main/java/org/apache/marmotta/ldclient/services/provider/AbstractHttpProvider.java
@@ -60,7 +60,6 @@ import static org.apache.marmotta.commons.http.LMFHttpUtils.parseContentType;
  */
 public abstract class AbstractHttpProvider implements DataProvider {
 
-    public static final int RETRY_AFTER = 60;
     private static Logger log = LoggerFactory.getLogger(AbstractHttpProvider.class);
 
     /**
@@ -176,7 +175,7 @@ public abstract class AbstractHttpProvider implements DataProvider {
                 con.close();
             }
 
-            ClientResponse result = new ClientResponse(handler.httpStatus, handler.triples);
+            ClientResponse result = new ClientResponse(handler.triples);
             result.setExpires(expiresDate);
             return result;
         } catch (RepositoryException e) {
@@ -229,8 +228,6 @@ public abstract class AbstractHttpProvider implements DataProvider {
 
         private final String resource;
 
-        private int httpStatus;
-
         public ResponseHandler(String resource, Endpoint endpoint) throws RepositoryException {
             this.resource = resource;
             this.endpoint = endpoint;
@@ -247,15 +244,13 @@ public abstract class AbstractHttpProvider implements DataProvider {
             	final HttpEntity entity = response.getEntity();
             	if (entity == null)
             		throw new IOException("no content returned by Linked Data resource " + resource);
-
+            	
 	            if (!isValidContentType(entity.getContentType().getValue().split(";")[0], endpoint)) {
 	                // FIXME: here was get.abort()
 	            	throw new IOException("invalid content returned by Linked Data resource " + resource + ": "
 	            			+ entity.getContentType().getValue());
 	            }
 
-                this.httpStatus = response.getStatusLine().getStatusCode();
-
                 if (entity != null) {
                     String parseContentType = "application/rdf+xml";
                     if (endpoint != null && "SPARQL".equals(endpoint.getType())) {
@@ -287,23 +282,8 @@ public abstract class AbstractHttpProvider implements DataProvider {
                     } finally {
                         in.close();
                     }
-                }
+                } 
                 EntityUtils.consume(entity);
-            } else if(response.getStatusLine().getStatusCode() == 500 || response.getStatusLine().getStatusCode() == 503  || response.getStatusLine().getStatusCode() == 504) {
-                this.httpStatus = response.getStatusLine().getStatusCode();
-
-                Header retry = response.getFirstHeader("Retry-After");
-                if(retry != null) {
-                    try {
-                        int duration = Integer.parseInt(retry.getValue());
-                        expiresDate = new Date(System.currentTimeMillis() + duration*1000);
-                    } catch(NumberFormatException ex) {
-                        log.debug("error parsing Retry-After: header");
-                    }
-                } else {
-                    expiresDate = new Date(System.currentTimeMillis() + RETRY_AFTER *1000);
-                }
-
             } else {
                 log.error("the HTTP request failed (status: {})", response.getStatusLine());
                 throw new ClientProtocolException("the HTTP request failed (status: " + response.getStatusLine() + ")");

http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/4aa87dbe/libraries/ldclient/ldclient-core/src/main/java/org/apache/marmotta/ldclient/services/provider/BlockingProvider.java
----------------------------------------------------------------------
diff --git a/libraries/ldclient/ldclient-core/src/main/java/org/apache/marmotta/ldclient/services/provider/BlockingProvider.java b/libraries/ldclient/ldclient-core/src/main/java/org/apache/marmotta/ldclient/services/provider/BlockingProvider.java
index ae75d59..feec3f4 100644
--- a/libraries/ldclient/ldclient-core/src/main/java/org/apache/marmotta/ldclient/services/provider/BlockingProvider.java
+++ b/libraries/ldclient/ldclient-core/src/main/java/org/apache/marmotta/ldclient/services/provider/BlockingProvider.java
@@ -87,7 +87,7 @@ public class BlockingProvider implements DataProvider {
         long defaultExpires = client.getClientConfiguration().getDefaultExpiry();
         Date expiresDate = new Date(System.currentTimeMillis() + defaultExpires * 1000);
 
-        ClientResponse result = new ClientResponse(200, empty_repository);
+        ClientResponse result = new ClientResponse(empty_repository);
         result.setExpires(expiresDate);
         return result;
     }

http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/4aa87dbe/libraries/ldclient/ldclient-core/src/test/java/org/apache/marmotta/ldclient/test/TestLDClientTest.java
----------------------------------------------------------------------
diff --git a/libraries/ldclient/ldclient-core/src/test/java/org/apache/marmotta/ldclient/test/TestLDClientTest.java b/libraries/ldclient/ldclient-core/src/test/java/org/apache/marmotta/ldclient/test/TestLDClientTest.java
index 4570c08..2cf0a4f 100644
--- a/libraries/ldclient/ldclient-core/src/test/java/org/apache/marmotta/ldclient/test/TestLDClientTest.java
+++ b/libraries/ldclient/ldclient-core/src/test/java/org/apache/marmotta/ldclient/test/TestLDClientTest.java
@@ -30,8 +30,6 @@ import org.junit.runner.Description;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import java.net.URI;
-
 public class TestLDClientTest {
 
     private TestLDClient client;
@@ -69,7 +67,7 @@ public class TestLDClientTest {
 
     @Test(expected = DataRetrievalException.class)
     public void testLocalhostInvalidPort() throws Exception {
-        client.retrieveResource("http://127.1.2.3:66000/");
+        client.retrieveResource("http://127.1.2.3:-1/");
         Assert.fail();
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/4aa87dbe/libraries/ldclient/ldclient-provider-facebook/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/ldclient/ldclient-provider-facebook/pom.xml b/libraries/ldclient/ldclient-provider-facebook/pom.xml
index 17f40b5..7b044f3 100644
--- a/libraries/ldclient/ldclient-provider-facebook/pom.xml
+++ b/libraries/ldclient/ldclient-provider-facebook/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0-incubating-SNAPSHOT</version>
+        <version>3.1.0-incubating-SNAPSHOT</version>
         <relativePath>../../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/4aa87dbe/libraries/ldclient/ldclient-provider-facebook/src/main/java/org/apache/marmotta/ldclient/provider/facebook/FacebookGraphProvider.java
----------------------------------------------------------------------
diff --git a/libraries/ldclient/ldclient-provider-facebook/src/main/java/org/apache/marmotta/ldclient/provider/facebook/FacebookGraphProvider.java b/libraries/ldclient/ldclient-provider-facebook/src/main/java/org/apache/marmotta/ldclient/provider/facebook/FacebookGraphProvider.java
index e9d606a..c7fb128 100644
--- a/libraries/ldclient/ldclient-provider-facebook/src/main/java/org/apache/marmotta/ldclient/provider/facebook/FacebookGraphProvider.java
+++ b/libraries/ldclient/ldclient-provider-facebook/src/main/java/org/apache/marmotta/ldclient/provider/facebook/FacebookGraphProvider.java
@@ -22,9 +22,12 @@ import org.apache.http.HttpEntity;
 import org.apache.http.HttpResponse;
 import org.apache.http.client.ClientProtocolException;
 import org.apache.http.client.methods.HttpGet;
+import org.apache.http.client.utils.URIUtils;
 import org.apache.http.impl.cookie.DateParseException;
 import org.apache.http.impl.cookie.DateUtils;
 import org.apache.http.util.EntityUtils;
+import org.apache.marmotta.commons.collections.CollectionUtils;
+import org.apache.marmotta.commons.http.ContentType;
 import org.apache.marmotta.commons.http.UriUtil;
 import org.apache.marmotta.commons.vocabulary.DCTERMS;
 import org.apache.marmotta.commons.vocabulary.FOAF;
@@ -34,6 +37,7 @@ import org.apache.marmotta.ldclient.api.ldclient.LDClientService;
 import org.apache.marmotta.ldclient.api.provider.DataProvider;
 import org.apache.marmotta.ldclient.exception.DataRetrievalException;
 import org.apache.marmotta.ldclient.model.ClientResponse;
+import org.apache.marmotta.ldclient.services.provider.AbstractHttpProvider;
 import org.codehaus.jackson.JsonParseException;
 import org.codehaus.jackson.map.JsonMappingException;
 import org.codehaus.jackson.map.ObjectMapper;
@@ -56,6 +60,8 @@ import java.util.*;
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
 
+import static org.apache.marmotta.commons.http.LMFHttpUtils.parseContentType;
+
 /**
  * A provider that accesses objects exposed by the Facebook Graph API (in JSON format). The provider will map the
  * properties of Facebook Objects to RDF and tries choosing the most appropriate RDF types and vocabularies. The base
@@ -70,7 +76,6 @@ public class FacebookGraphProvider implements DataProvider {
 
 
     private static final Pattern pattern = Pattern.compile("http://www\\.facebook\\.com/([^/]+/)*([^/]+)");
-    public static final int RETRY_AFTER = 60;
 
     private static Logger log = LoggerFactory.getLogger(FacebookGraphProvider.class);
 
@@ -401,7 +406,7 @@ public class FacebookGraphProvider implements DataProvider {
                 con.close();
             }
 
-            ClientResponse result = new ClientResponse(200, handler.triples);
+            ClientResponse result = new ClientResponse(handler.triples);
             result.setExpires(expiresDate);
             return result;
         } catch (RepositoryException e) {
@@ -434,8 +439,6 @@ public class FacebookGraphProvider implements DataProvider {
 
         private final String resource;
 
-        private int httpStatus;
-
         // language tag to use for literals
         public String language;
 
@@ -456,7 +459,6 @@ public class FacebookGraphProvider implements DataProvider {
                 if (entity == null)
                     throw new IOException("no content returned by Linked Data resource " + resource);
 
-                this.httpStatus = response.getStatusLine().getStatusCode();
 
                 if (entity != null) {
                     InputStream in = entity.getContent();
@@ -484,21 +486,6 @@ public class FacebookGraphProvider implements DataProvider {
                     }
                 }
                 EntityUtils.consume(entity);
-            } else if(response.getStatusLine().getStatusCode() == 500 || response.getStatusLine().getStatusCode() == 503  || response.getStatusLine().getStatusCode() == 504) {
-                this.httpStatus = response.getStatusLine().getStatusCode();
-
-                Header retry = response.getFirstHeader("Retry-After");
-                if(retry != null) {
-                    try {
-                        int duration = Integer.parseInt(retry.getValue());
-                        expiresDate = new Date(System.currentTimeMillis() + duration*1000);
-                    } catch(NumberFormatException ex) {
-                        log.debug("error parsing Retry-After: header");
-                    }
-                } else {
-                    expiresDate = new Date(System.currentTimeMillis() + RETRY_AFTER *1000);
-                }
-
             } else {
                 log.error("the HTTP request failed (status: {})", response.getStatusLine());
                 throw new ClientProtocolException("the HTTP request failed (status: " + response.getStatusLine() + ")");

http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/4aa87dbe/libraries/ldclient/ldclient-provider-html/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/ldclient/ldclient-provider-html/pom.xml b/libraries/ldclient/ldclient-provider-html/pom.xml
index a78e4d5..efa9821 100644
--- a/libraries/ldclient/ldclient-provider-html/pom.xml
+++ b/libraries/ldclient/ldclient-provider-html/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0-incubating-SNAPSHOT</version>
+        <version>3.1.0-incubating-SNAPSHOT</version>
         <relativePath>../../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/4aa87dbe/libraries/ldclient/ldclient-provider-html/src/main/java/org/apache/marmotta/ldclient/provider/html/mapping/CssDateLiteralMapper.java
----------------------------------------------------------------------
diff --git a/libraries/ldclient/ldclient-provider-html/src/main/java/org/apache/marmotta/ldclient/provider/html/mapping/CssDateLiteralMapper.java b/libraries/ldclient/ldclient-provider-html/src/main/java/org/apache/marmotta/ldclient/provider/html/mapping/CssDateLiteralMapper.java
index 001fb80..bbc2b3b 100644
--- a/libraries/ldclient/ldclient-provider-html/src/main/java/org/apache/marmotta/ldclient/provider/html/mapping/CssDateLiteralMapper.java
+++ b/libraries/ldclient/ldclient-provider-html/src/main/java/org/apache/marmotta/ldclient/provider/html/mapping/CssDateLiteralMapper.java
@@ -62,7 +62,7 @@ public class CssDateLiteralMapper extends CssTextLiteralMapper {
 
     @Override
     public List<Value> map(String resourceUri, Element elem, ValueFactory factory) {
-        final String value = cleanValue(elem.text());
+        final String value = elem.text().trim();
         Date date = parseDate(value);
 
         final String dateString;

http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/4aa87dbe/libraries/ldclient/ldclient-provider-html/src/main/java/org/apache/marmotta/ldclient/provider/html/mapping/CssLiteralAttrMapper.java
----------------------------------------------------------------------
diff --git a/libraries/ldclient/ldclient-provider-html/src/main/java/org/apache/marmotta/ldclient/provider/html/mapping/CssLiteralAttrMapper.java b/libraries/ldclient/ldclient-provider-html/src/main/java/org/apache/marmotta/ldclient/provider/html/mapping/CssLiteralAttrMapper.java
index 5cf91af..29ded1d 100644
--- a/libraries/ldclient/ldclient-provider-html/src/main/java/org/apache/marmotta/ldclient/provider/html/mapping/CssLiteralAttrMapper.java
+++ b/libraries/ldclient/ldclient-provider-html/src/main/java/org/apache/marmotta/ldclient/provider/html/mapping/CssLiteralAttrMapper.java
@@ -18,7 +18,7 @@
 package org.apache.marmotta.ldclient.provider.html.mapping;
 
 import org.apache.marmotta.commons.sesame.model.Namespaces;
-import org.apache.commons.lang3.StringUtils;
+import org.apache.commons.lang.StringUtils;
 import org.jsoup.nodes.Element;
 import org.openrdf.model.Value;
 import org.openrdf.model.ValueFactory;

http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/4aa87dbe/libraries/ldclient/ldclient-provider-html/src/main/java/org/apache/marmotta/ldclient/provider/html/mapping/CssTextLiteralMapper.java
----------------------------------------------------------------------
diff --git a/libraries/ldclient/ldclient-provider-html/src/main/java/org/apache/marmotta/ldclient/provider/html/mapping/CssTextLiteralMapper.java b/libraries/ldclient/ldclient-provider-html/src/main/java/org/apache/marmotta/ldclient/provider/html/mapping/CssTextLiteralMapper.java
index e3e9ac4..886307c 100644
--- a/libraries/ldclient/ldclient-provider-html/src/main/java/org/apache/marmotta/ldclient/provider/html/mapping/CssTextLiteralMapper.java
+++ b/libraries/ldclient/ldclient-provider-html/src/main/java/org/apache/marmotta/ldclient/provider/html/mapping/CssTextLiteralMapper.java
@@ -17,7 +17,7 @@
  */
 package org.apache.marmotta.ldclient.provider.html.mapping;
 
-import org.apache.commons.lang3.StringUtils;
+import org.apache.commons.lang.StringUtils;
 import org.apache.marmotta.commons.sesame.model.Namespaces;
 import org.jsoup.nodes.Element;
 import org.openrdf.model.Value;

http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/4aa87dbe/libraries/ldclient/ldclient-provider-ldap/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/ldclient/ldclient-provider-ldap/pom.xml b/libraries/ldclient/ldclient-provider-ldap/pom.xml
index 6d0b934..4736c8f 100644
--- a/libraries/ldclient/ldclient-provider-ldap/pom.xml
+++ b/libraries/ldclient/ldclient-provider-ldap/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0-incubating-SNAPSHOT</version>
+        <version>3.1.0-incubating-SNAPSHOT</version>
         <relativePath>../../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/4aa87dbe/libraries/ldclient/ldclient-provider-ldap/src/main/java/org/apache/marmotta/ldclient/provider/ldap/LdapFoafProvider.java
----------------------------------------------------------------------
diff --git a/libraries/ldclient/ldclient-provider-ldap/src/main/java/org/apache/marmotta/ldclient/provider/ldap/LdapFoafProvider.java b/libraries/ldclient/ldclient-provider-ldap/src/main/java/org/apache/marmotta/ldclient/provider/ldap/LdapFoafProvider.java
index 3873391..e0ade1b 100644
--- a/libraries/ldclient/ldclient-provider-ldap/src/main/java/org/apache/marmotta/ldclient/provider/ldap/LdapFoafProvider.java
+++ b/libraries/ldclient/ldclient-provider-ldap/src/main/java/org/apache/marmotta/ldclient/provider/ldap/LdapFoafProvider.java
@@ -184,7 +184,7 @@ public class LdapFoafProvider implements DataProvider {
 
                 }
 
-                final ClientResponse resp = new ClientResponse(200, rep);
+                final ClientResponse resp = new ClientResponse(rep);
                 resp.setExpires(new Date());
                 return resp;
 

http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/4aa87dbe/libraries/ldclient/ldclient-provider-mediawiki/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/ldclient/ldclient-provider-mediawiki/pom.xml b/libraries/ldclient/ldclient-provider-mediawiki/pom.xml
index 08e8437..a97c354 100644
--- a/libraries/ldclient/ldclient-provider-mediawiki/pom.xml
+++ b/libraries/ldclient/ldclient-provider-mediawiki/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0-incubating-SNAPSHOT</version>
+        <version>3.1.0-incubating-SNAPSHOT</version>
         <relativePath>../../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/4aa87dbe/libraries/ldclient/ldclient-provider-mediawiki/src/main/java/org/apache/marmotta/ldclient/provider/mediawiki/MediawikiProvider.java
----------------------------------------------------------------------
diff --git a/libraries/ldclient/ldclient-provider-mediawiki/src/main/java/org/apache/marmotta/ldclient/provider/mediawiki/MediawikiProvider.java b/libraries/ldclient/ldclient-provider-mediawiki/src/main/java/org/apache/marmotta/ldclient/provider/mediawiki/MediawikiProvider.java
index 7c23d37..d9e4a06 100644
--- a/libraries/ldclient/ldclient-provider-mediawiki/src/main/java/org/apache/marmotta/ldclient/provider/mediawiki/MediawikiProvider.java
+++ b/libraries/ldclient/ldclient-provider-mediawiki/src/main/java/org/apache/marmotta/ldclient/provider/mediawiki/MediawikiProvider.java
@@ -72,7 +72,7 @@ public class MediawikiProvider extends AbstractHttpProvider {
     private static Logger        log                  = LoggerFactory.getLogger(MediawikiProvider.class);
 
     private static final Pattern COLON_PREFIX_PATTERN = Pattern.compile("^[^:]*:");
-    private static final Pattern REDIRECT_PATTERN     = Pattern.compile("^#REDIRECT\\s*\\[\\[([^#\\]]*)(#.*)?\\]\\]",
+    private static final Pattern REDIRECT_PATTERN     = Pattern.compile("^#REDIRECT\\s+\\[\\[([^#\\]]*)(#.*)?\\]\\]",
             Pattern.CASE_INSENSITIVE);
     private static final int     MAX_TITLES_PER_QUERY = 50;
 

http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/4aa87dbe/libraries/ldclient/ldclient-provider-phpbb/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/ldclient/ldclient-provider-phpbb/pom.xml b/libraries/ldclient/ldclient-provider-phpbb/pom.xml
index 9a09b52..c67862f 100644
--- a/libraries/ldclient/ldclient-provider-phpbb/pom.xml
+++ b/libraries/ldclient/ldclient-provider-phpbb/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0-incubating-SNAPSHOT</version>
+        <version>3.1.0-incubating-SNAPSHOT</version>
         <relativePath>../../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/4aa87dbe/libraries/ldclient/ldclient-provider-rdf/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/ldclient/ldclient-provider-rdf/pom.xml b/libraries/ldclient/ldclient-provider-rdf/pom.xml
index 5b6df79..3f81d0b 100644
--- a/libraries/ldclient/ldclient-provider-rdf/pom.xml
+++ b/libraries/ldclient/ldclient-provider-rdf/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0-incubating-SNAPSHOT</version>
+        <version>3.1.0-incubating-SNAPSHOT</version>
         <relativePath>../../../parent</relativePath>
     </parent>
 
@@ -45,10 +45,6 @@
 
         <dependency>
             <groupId>org.openrdf.sesame</groupId>
-            <artifactId>sesame-rio-rdfjson</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.openrdf.sesame</groupId>
             <artifactId>sesame-rio-rdfxml</artifactId>
         </dependency>
         <dependency>
@@ -60,8 +56,12 @@
             <artifactId>sesame-rio-n3</artifactId>
         </dependency>
         <dependency>
-            <groupId>com.github.jsonld-java</groupId>
-            <artifactId>jsonld-java-sesame</artifactId>
+            <groupId>org.apache.marmotta</groupId>
+            <artifactId>sesame-tools-rio-jsonld</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.marmotta</groupId>
+            <artifactId>sesame-tools-rio-rdfjson</artifactId>
         </dependency>
 
 

http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/4aa87dbe/libraries/ldclient/ldclient-provider-rdf/src/main/java/org/apache/marmotta/ldclient/provider/rdf/SPARQLProvider.java
----------------------------------------------------------------------
diff --git a/libraries/ldclient/ldclient-provider-rdf/src/main/java/org/apache/marmotta/ldclient/provider/rdf/SPARQLProvider.java b/libraries/ldclient/ldclient-provider-rdf/src/main/java/org/apache/marmotta/ldclient/provider/rdf/SPARQLProvider.java
index cc39f14..929b59e 100644
--- a/libraries/ldclient/ldclient-provider-rdf/src/main/java/org/apache/marmotta/ldclient/provider/rdf/SPARQLProvider.java
+++ b/libraries/ldclient/ldclient-provider-rdf/src/main/java/org/apache/marmotta/ldclient/provider/rdf/SPARQLProvider.java
@@ -24,7 +24,6 @@ import org.apache.marmotta.ldclient.services.provider.AbstractHttpProvider;
 import org.openrdf.model.URI;
 import org.openrdf.model.Value;
 import org.openrdf.query.BindingSet;
-import org.openrdf.query.QueryResultHandlerException;
 import org.openrdf.query.TupleQueryResultHandler;
 import org.openrdf.query.TupleQueryResultHandlerException;
 import org.openrdf.query.resultio.QueryResultIO;
@@ -152,14 +151,9 @@ public class SPARQLProvider extends AbstractHttpProvider {
                         public void endQueryResult() throws TupleQueryResultHandlerException   {
                             try {
                                 con.commit();
+                                con.close();
                             } catch (RepositoryException e) {
-                                throw new TupleQueryResultHandlerException("error while committing repository connection",e);
-                            } finally {
-                                try {
-                                    con.close();
-                                } catch(RepositoryException e) {
-                                    throw new TupleQueryResultHandlerException("error while closing repository connection",e);
-                                }
+                                throw new TupleQueryResultHandlerException("error while closing repository connection",e);
                             }
                         }
 
@@ -179,19 +173,6 @@ public class SPARQLProvider extends AbstractHttpProvider {
                                 throw new TupleQueryResultHandlerException("error while adding triple to repository connection",e);
                             }
                         }
-
-						@Override
-						public void handleBoolean(boolean bool	) throws QueryResultHandlerException {
-							// TODO Auto-generated method stub
-							
-						}
-
-						@Override
-						public void handleLinks(List<String> links) throws QueryResultHandlerException {
-							// TODO Auto-generated method stub
-							
-						}
-						
                     },
                     triples.getValueFactory());
 

http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/4aa87dbe/libraries/ldclient/ldclient-provider-rdf/src/test/java/org/apache/marmotta/ldclient/test/rdf/TestStanbolProvider.java
----------------------------------------------------------------------
diff --git a/libraries/ldclient/ldclient-provider-rdf/src/test/java/org/apache/marmotta/ldclient/test/rdf/TestStanbolProvider.java b/libraries/ldclient/ldclient-provider-rdf/src/test/java/org/apache/marmotta/ldclient/test/rdf/TestStanbolProvider.java
index 9df1cd7..11a83a4 100644
--- a/libraries/ldclient/ldclient-provider-rdf/src/test/java/org/apache/marmotta/ldclient/test/rdf/TestStanbolProvider.java
+++ b/libraries/ldclient/ldclient-provider-rdf/src/test/java/org/apache/marmotta/ldclient/test/rdf/TestStanbolProvider.java
@@ -25,7 +25,6 @@ import org.apache.marmotta.ldclient.model.ClientResponse;
 import org.apache.marmotta.ldclient.services.ldclient.LDClient;
 import org.apache.marmotta.ldclient.test.helper.TestLDClient;
 import org.junit.Assert;
-import org.junit.Assume;
 import org.junit.Test;
 import org.openrdf.query.BooleanQuery;
 import org.openrdf.query.QueryLanguage;
@@ -54,8 +53,6 @@ public class TestStanbolProvider {
 
         LDClientService ldclient = new TestLDClient(new LDClient(config));
 
-        Assume.assumeTrue(ldclient.ping("http://dev.iks-project.eu:8080/"));
-
         String uriBerlin = "http://dbpedia.org/resource/Berlin";
         ClientResponse respBerlin = ldclient.retrieveResource(uriBerlin);
 

http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/4aa87dbe/libraries/ldclient/ldclient-provider-rdfa/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/ldclient/ldclient-provider-rdfa/pom.xml b/libraries/ldclient/ldclient-provider-rdfa/pom.xml
index 247df46..eb1e264 100644
--- a/libraries/ldclient/ldclient-provider-rdfa/pom.xml
+++ b/libraries/ldclient/ldclient-provider-rdfa/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0-incubating-SNAPSHOT</version>
+        <version>3.1.0-incubating-SNAPSHOT</version>
         <relativePath>../../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/4aa87dbe/libraries/ldclient/ldclient-provider-vimeo/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/ldclient/ldclient-provider-vimeo/pom.xml b/libraries/ldclient/ldclient-provider-vimeo/pom.xml
index f2fc4d7..541bd79 100644
--- a/libraries/ldclient/ldclient-provider-vimeo/pom.xml
+++ b/libraries/ldclient/ldclient-provider-vimeo/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0-incubating-SNAPSHOT</version>
+        <version>3.1.0-incubating-SNAPSHOT</version>
         <relativePath>../../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/4aa87dbe/libraries/ldclient/ldclient-provider-xml/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/ldclient/ldclient-provider-xml/pom.xml b/libraries/ldclient/ldclient-provider-xml/pom.xml
index 5d8deae..0ff9206 100644
--- a/libraries/ldclient/ldclient-provider-xml/pom.xml
+++ b/libraries/ldclient/ldclient-provider-xml/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0-incubating-SNAPSHOT</version>
+        <version>3.1.0-incubating-SNAPSHOT</version>
         <relativePath>../../../parent</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/4aa87dbe/libraries/ldclient/ldclient-provider-youtube/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/ldclient/ldclient-provider-youtube/pom.xml b/libraries/ldclient/ldclient-provider-youtube/pom.xml
index 1a79aa4..062ce27 100644
--- a/libraries/ldclient/ldclient-provider-youtube/pom.xml
+++ b/libraries/ldclient/ldclient-provider-youtube/pom.xml
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.apache.marmotta</groupId>
         <artifactId>marmotta-parent</artifactId>
-        <version>3.2.0-incubating-SNAPSHOT</version>
+        <version>3.1.0-incubating-SNAPSHOT</version>
         <relativePath>../../../parent</relativePath>
     </parent>