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

git commit: minor bug fixes

Updated Branches:
  refs/heads/develop 889f80209 -> f154eaa9f


minor bug fixes


Project: http://git-wip-us.apache.org/repos/asf/incubator-marmotta/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-marmotta/commit/f154eaa9
Tree: http://git-wip-us.apache.org/repos/asf/incubator-marmotta/tree/f154eaa9
Diff: http://git-wip-us.apache.org/repos/asf/incubator-marmotta/diff/f154eaa9

Branch: refs/heads/develop
Commit: f154eaa9f87767ff6df0ea7caa5fc6360e9fc5a8
Parents: 889f802
Author: Sebastian Schaffert <ss...@apache.org>
Authored: Thu Jul 4 17:56:58 2013 +0200
Committer: Sebastian Schaffert <ss...@apache.org>
Committed: Thu Jul 4 17:56:58 2013 +0200

----------------------------------------------------------------------
 .../sesame/repository/ResourceUtils.java        | 62 +-------------------
 .../marmotta/kiwi/test/H2ConcurrencyTest.java   |  2 +-
 .../kiwi/test/MySQLConcurrencyTest.java         |  2 +-
 .../kiwi/test/PostgreSQLConcurrencyTest.java    |  2 +-
 4 files changed, 4 insertions(+), 64 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/f154eaa9/commons/marmotta-commons/src/main/java/org/apache/marmotta/commons/sesame/repository/ResourceUtils.java
----------------------------------------------------------------------
diff --git a/commons/marmotta-commons/src/main/java/org/apache/marmotta/commons/sesame/repository/ResourceUtils.java b/commons/marmotta-commons/src/main/java/org/apache/marmotta/commons/sesame/repository/ResourceUtils.java
index 14c0138..ad1bb12 100644
--- a/commons/marmotta-commons/src/main/java/org/apache/marmotta/commons/sesame/repository/ResourceUtils.java
+++ b/commons/marmotta-commons/src/main/java/org/apache/marmotta/commons/sesame/repository/ResourceUtils.java
@@ -177,12 +177,7 @@ public class ResourceUtils {
 	 */
     public static boolean existsStatement(RepositoryConnection conn, Resource subj, URI pred, Value object, Resource ctx) {
     	try {
-    		RepositoryResult<Statement> stmts = conn.getStatements(subj, pred, object, true, ctx);
-    		try {
-    			return stmts.hasNext();
-    		} finally {
-    			stmts.close();
-    		}
+            return conn.hasStatement(subj,pred,object,true,ctx);
     	} catch (RepositoryException e) {
     		log.error(e.getMessage());
     		return false;
@@ -294,36 +289,6 @@ public class ResourceUtils {
     }
 
     /**
-     * List all resources that have a specific property set to the given value
-     *
-     * @param propertyUri
-     * @param value  the literal value to query for
-     * @return
-     */
-    public static Iterable<Resource> listResourcesByProperty(final RepositoryConnection con, String propertyUri, String value) {
-        return listResourcesByProperty(con,propertyUri,value,null);
-    }
-
-    /**
-     * List all resources that have a specific property set to the given value and context
-     *
-     * @param propertyUri
-     * @param value  the literal value to query for
-     * @return
-     */
-    public static Iterable<Resource> listResourcesByProperty(final RepositoryConnection con, String propertyUri, String value, URI context) {
-        URI property = getUriResource(con,propertyUri);
-        Value object = con.getValueFactory().createLiteral(value);
-
-        if(property != null) {
-            return listResourcesInternal(con,property,object,context);
-        } else {
-            return Collections.emptySet();
-        }
-
-    }
-
-    /**
      * List resources with the given prefix
      *
      * @param prefix the prefix
@@ -538,31 +503,6 @@ public class ResourceUtils {
 
     /**
      * Generic method to query for literal values related to this resource with the property
-     * identified by "propLabel" (SeRQL/SPARQL short or long notation) and the given locale. Just for the given space !!
-     *
-     * @param propLabel label of the property; either RDF short form (e.g. "foaf:mbox") or long form (e.g. <http://xmlns.com/foaf/0.1/mbox>)
-     * @return
-     *
-     */
-    public static Iterable<String> getProperties(RepositoryConnection con, Resource r, String propLabel, URI context) throws RepositoryException {
-        return getProperties(con, r, propLabel, null, context);
-    }
-
-    /**
-     * Generic method to query for literal values related to this resource with the property
-     * identified by "propLabel" (SeRQL/SPARQL short or long notation) and the given locale.
-     *
-     * @param propLabel label of the property; either RDF short form (e.g. "foaf:mbox") or long
-     *                  form (e.g. <http://xmlns.com/foaf/0.1/mbox>)
-     * @param loc
-     * @return
-     */
-    public static Iterable<String> getProperties(RepositoryConnection con, Resource r, String propLabel, Locale loc) throws RepositoryException {
-        return getProperties(con, r, propLabel, loc, null);
-    }
-
-    /**
-     * Generic method to query for literal values related to this resource with the property
      * identified by "propLabel" (SeRQL/SPARQL short or long notation) and the given locale.
      * Just for the given space !!
      *

http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/f154eaa9/libraries/kiwi/kiwi-triplestore/src/test/java/org/apache/marmotta/kiwi/test/H2ConcurrencyTest.java
----------------------------------------------------------------------
diff --git a/libraries/kiwi/kiwi-triplestore/src/test/java/org/apache/marmotta/kiwi/test/H2ConcurrencyTest.java b/libraries/kiwi/kiwi-triplestore/src/test/java/org/apache/marmotta/kiwi/test/H2ConcurrencyTest.java
index a51dbc0..e01be58 100644
--- a/libraries/kiwi/kiwi-triplestore/src/test/java/org/apache/marmotta/kiwi/test/H2ConcurrencyTest.java
+++ b/libraries/kiwi/kiwi-triplestore/src/test/java/org/apache/marmotta/kiwi/test/H2ConcurrencyTest.java
@@ -127,7 +127,7 @@ public class H2ConcurrencyTest {
     }
 
     final Logger logger =
-            LoggerFactory.getLogger(RepositoryTest.class);
+            LoggerFactory.getLogger(H2ConcurrencyTest.class);
 
 
     long tripleCount = 0;

http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/f154eaa9/libraries/kiwi/kiwi-triplestore/src/test/java/org/apache/marmotta/kiwi/test/MySQLConcurrencyTest.java
----------------------------------------------------------------------
diff --git a/libraries/kiwi/kiwi-triplestore/src/test/java/org/apache/marmotta/kiwi/test/MySQLConcurrencyTest.java b/libraries/kiwi/kiwi-triplestore/src/test/java/org/apache/marmotta/kiwi/test/MySQLConcurrencyTest.java
index eaaef88..1b0ebcc 100644
--- a/libraries/kiwi/kiwi-triplestore/src/test/java/org/apache/marmotta/kiwi/test/MySQLConcurrencyTest.java
+++ b/libraries/kiwi/kiwi-triplestore/src/test/java/org/apache/marmotta/kiwi/test/MySQLConcurrencyTest.java
@@ -126,7 +126,7 @@ public class MySQLConcurrencyTest {
     }
 
     final Logger logger =
-            LoggerFactory.getLogger(RepositoryTest.class);
+            LoggerFactory.getLogger(MySQLConcurrencyTest.class);
 
 
     long tripleCount = 0;

http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/f154eaa9/libraries/kiwi/kiwi-triplestore/src/test/java/org/apache/marmotta/kiwi/test/PostgreSQLConcurrencyTest.java
----------------------------------------------------------------------
diff --git a/libraries/kiwi/kiwi-triplestore/src/test/java/org/apache/marmotta/kiwi/test/PostgreSQLConcurrencyTest.java b/libraries/kiwi/kiwi-triplestore/src/test/java/org/apache/marmotta/kiwi/test/PostgreSQLConcurrencyTest.java
index 9e1683b..ef16598 100644
--- a/libraries/kiwi/kiwi-triplestore/src/test/java/org/apache/marmotta/kiwi/test/PostgreSQLConcurrencyTest.java
+++ b/libraries/kiwi/kiwi-triplestore/src/test/java/org/apache/marmotta/kiwi/test/PostgreSQLConcurrencyTest.java
@@ -126,7 +126,7 @@ public class PostgreSQLConcurrencyTest {
     }
 
     final Logger logger =
-            LoggerFactory.getLogger(RepositoryTest.class);
+            LoggerFactory.getLogger(PostgreSQLConcurrencyTest.class);
 
 
     long tripleCount = 0;