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:34 UTC
[42/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/commons/sesame-tools-facading/src/main/java/org/apache/marmotta/commons/sesame/facading/impl/FacadingImpl.java
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-facading/src/main/java/org/apache/marmotta/commons/sesame/facading/impl/FacadingImpl.java b/commons/sesame-tools-facading/src/main/java/org/apache/marmotta/commons/sesame/facading/impl/FacadingImpl.java
index 8cfba98..e10cd13 100644
--- a/commons/sesame-tools-facading/src/main/java/org/apache/marmotta/commons/sesame/facading/impl/FacadingImpl.java
+++ b/commons/sesame-tools-facading/src/main/java/org/apache/marmotta/commons/sesame/facading/impl/FacadingImpl.java
@@ -27,6 +27,7 @@ import org.apache.marmotta.commons.sesame.facading.annotations.RDFType;
import org.apache.marmotta.commons.sesame.facading.api.Facading;
import org.apache.marmotta.commons.sesame.facading.model.Facade;
import org.apache.marmotta.commons.sesame.facading.util.FacadeUtils;
+import org.apache.marmotta.commons.sesame.model.Namespaces;
import org.openrdf.model.Resource;
import org.openrdf.model.URI;
import org.openrdf.repository.RepositoryConnection;
@@ -37,19 +38,18 @@ import org.slf4j.LoggerFactory;
/**
* Offers methods for loading and proxying Facades. A {@link Facade} is an interface that defines a
- * Java object with convenient Java methods around a {@link Resource} and makes it possible to use RDF
+ * Java object with convenient Java methods around a KiWiResource and makes it possible to use RDF
* properties like Java Bean properties from inside Java.
* <p/>
- * The facading service is to provide access on a higher level than raw RDF resources.
+ * The facading service is used by many other services, e.g. ContentItemService and TaggingService,
+ * to provide access on a higher level than raw RDF resources.
+ *
+ *
* <p/>
- * @author Sebastian Schaffert <ss...@apache.org>
- * @author Jakob Frank <ja...@apache.org>
+ * User: Sebastian Schaffert
*/
public class FacadingImpl implements Facading {
- private static final URI RDF_TYPE = org.openrdf.model.vocabulary.RDF.TYPE;
-
-
private static Logger log = LoggerFactory.getLogger(FacadingImpl.class);
@@ -61,13 +61,13 @@ public class FacadingImpl implements Facading {
}
/**
- * Create an instance of {@code C} that facades the resource given as argument using the {@link RDF} annotations provided
- * to the getter or setter methods of {@code C} to map to properties of the resource in the triple store.
+ * Create an instance of C that facades the resource given as argument using the {@link RDF} annotations provided
+ * to the getter or setter methods of Cto map to properties of the resource in the triple store.
*
*
* @param r the resource to facade
* @param type the facade type as a class
- * @return a facading proxy of type {@code C}
+ * @return
*/
@Override
public <C extends Facade> C createFacade(Resource r, Class<C> type) {
@@ -76,65 +76,57 @@ public class FacadingImpl implements Facading {
if(FacadeUtils.isFacadeAnnotationPresent(type, RDFContext.class)) {
String s_context = FacadeUtils.getFacadeAnnotation(type,RDFContext.class).value();
context = connection.getValueFactory().createURI(s_context);
- log.debug("applying context {} for facade {} of {}", context, type.getSimpleName(), r);
}
return createFacade(r, type, context);
}
/**
- * Create an instance of {@code C} that facades the resource given as argument using the {@link RDF} annotations provided
- * to the getter or setter methods of {@code C} to map to properties of the resource in the triple store.
+ * Create an instance of C that facades the resource given as argument using the {@link RDF} annotations provided
+ * to the getter or setter methods of Cto map to properties of the resource in the triple store.
* Additionally, it puts the facade into the given context, a present {@link RDFContext} annotation is ignored.
* This is useful if the {@link RDFContext} annotation for Facades is not applicable,
* e.g. if the context is dynamically generated.
+
+ *
*
* @param r the resource to facade
* @param type the facade type as a class
* @param context the context of the facade
- * @return a facading proxy of type {@code C}
+ * @return
*/
@Override
public <C extends Facade> C createFacade(Resource r, Class<C> type, URI context) {
if(r == null) {
- log.trace("null facade for null resouce");
return null;
- } else
+ } else if(type.isInterface()) {
// if the interface is a Facade, we execute the query and then
// create an invocation handler for each result to create proxy objects
- if(type.isInterface() && FacadeUtils.isFacade(type)) {
+ if(FacadeUtils.isFacade(type)) {
try {
// support @RDFType annotation in facade
- if(FacadeUtils.isFacadeAnnotationPresent(type, RDFType.class)) {
- if (!connection.isOpen()) { throw new IllegalStateException("the connection is already closed, cannot access triple-store."); }
- if (!connection.isActive()) { throw new IllegalStateException("no active transaction, cannot access triple-store."); }
-
- String[] a_type = FacadeUtils.getFacadeAnnotation(type, RDFType.class).value();
+ if(FacadeUtils.isFacadeAnnotationPresent(type,RDFType.class)) {
+ String[] a_type = FacadeUtils.getFacadeAnnotation(type,RDFType.class).value();
for(String s_type : a_type) {
- final URI r_type = connection.getValueFactory().createURI(s_type);
- connection.add(r, RDF_TYPE, r_type, context);
- log.trace("added type {} to {} because of RDFType-Annotation", r_type, r);
- if(!connection.hasStatement(r, RDF_TYPE, r_type,true,context)) {
- log.error("error adding type for facade!");
- }
+ URI r_type = connection.getValueFactory().createURI(s_type);
+ URI p_type = connection.getValueFactory().createURI(Namespaces.NS_RDF + "type");
+ connection.add(r, p_type, r_type, context);
}
}
- FacadingInvocationHandler handler = new FacadingInvocationHandler(r, context, type, this, connection);
- if (log.isDebugEnabled()) {
- if (context != null) {
- log.debug("New Facading: {} delegating to {} (@{})", type.getSimpleName(), r, context);
- } else {
- log.debug("New Facading: {} delegating to {}", type.getSimpleName(), r);
- }
- }
- return type.cast(Proxy.newProxyInstance(type.getClassLoader(), new Class[]{type}, handler));
+ FacadingInvocationHandler handler = new FacadingInvocationHandler(r,context,type,this,connection);
+ return type.cast(Proxy.newProxyInstance(type.getClassLoader(),
+ new Class[]{type},
+ handler));
} catch (RepositoryException e) {
- log.error("error while accessing triple store", e);
+ log.error("error while accessing triple store",e);
return null;
}
} else {
throw new IllegalArgumentException("interface passed as parameter is not a Facade (" + type.getCanonicalName() + ")");
}
+ } else {
+ throw new IllegalArgumentException("interface passed as parameter is not a Facade (" + type.getCanonicalName() + ")");
+ }
}
/**
@@ -153,7 +145,6 @@ public class FacadingImpl implements Facading {
if(FacadeUtils.isFacadeAnnotationPresent(type, RDFContext.class)) {
String s_context = FacadeUtils.getFacadeAnnotation(type,RDFContext.class).value();
context = connection.getValueFactory().createURI(s_context);
- log.debug("applying context {} for facade {} of {}", context, type.getSimpleName(), list);
}
return createFacade(list, type, context);
}
@@ -170,12 +161,11 @@ public class FacadingImpl implements Facading {
*/
@Override
public <C extends Facade> Collection<C> createFacade(Collection<? extends Resource> list, Class<C> type, URI context) {
- log.trace("createFacadeList: creating {} facade over {} content items",type.getName(),list.size());
+ log.debug("createFacadeList: creating {} facade over {} content items",type.getName(),list.size());
LinkedList<C> result = new LinkedList<C>();
if(type.isAnnotationPresent(RDFFilter.class)) {
try {
- if (!connection.isOpen()) { throw new IllegalStateException("the connection is already closed, cannot access triple-store."); }
- if (!connection.isActive()) { throw new IllegalStateException("no active transaction, cannot access triple-store."); }
+ final URI p_type = connection.getValueFactory().createURI(Namespaces.NS_RDF + "type");
// if the RDFType annotation is present, filter out content items that are of the wrong type
LinkedList<URI> acceptable_types = new LinkedList<URI>();
@@ -191,9 +181,9 @@ public class FacadingImpl implements Facading {
for(Resource item : list) {
boolean accept = acceptable_types.size() == 0; // true for empty filter
for(URI rdf_type : acceptable_types) {
- if(connection.hasStatement(item, RDF_TYPE, rdf_type, true)) {
+ if(connection.hasStatement(item, p_type, rdf_type, true)) {
accept = true;
- log.trace("accepting resource {} because type matches ({})",item.toString(),rdf_type.stringValue());
+ log.debug("accepting resource #0 because type matches (#1)",item.toString(),rdf_type.stringValue());
break;
}
}
@@ -201,7 +191,7 @@ public class FacadingImpl implements Facading {
result.add(createFacade(item,type,context));
}
}
- log.debug("createFacadeList: filtered {} content items because they did not match the necessary criteria",list.size()-result.size());
+ log.debug("createFacadeList: filtered #0 content items because they did not match the necessary criteria",list.size()-result.size());
} catch (RepositoryException ex) {
log.error("error while accessing RDF repository",ex);
}
@@ -258,27 +248,18 @@ public class FacadingImpl implements Facading {
public <C extends Facade> boolean isFacadeable(Resource r, Class<C> type, URI context) {
if (FacadeUtils.isFacadeAnnotationPresent(type, RDFType.class)) {
try {
- if (!connection.isOpen()) { throw new IllegalStateException("the connection is already closed, cannot access triple store."); }
- if (!connection.isActive()) { throw new IllegalStateException("no active transaction, cannot access triple-store."); }
+ final URI p_type = connection.getValueFactory().createURI(Namespaces.NS_RDF + "type");
String[] rdfTypes = FacadeUtils.getFacadeAnnotation(type, RDFType.class).value();
boolean facadeable = true;
for (String s_type : rdfTypes) {
- if(context != null) {
- facadeable &= connection.hasStatement(r, RDF_TYPE, connection.getValueFactory().createURI(s_type), true, context);
- } else {
- facadeable &= connection.hasStatement(r, RDF_TYPE, connection.getValueFactory().createURI(s_type), true);
- }
+ facadeable &= connection.hasStatement(r, p_type, connection.getValueFactory().createURI(s_type), true, context);
}
// also check for @RDFFilter
if (FacadeUtils.isFacadeAnnotationPresent(type, RDFFilter.class)) {
String[] filterTypes = FacadeUtils.getFacadeAnnotation(type, RDFFilter.class).value();
for (String s_type : filterTypes) {
- if(context != null) {
- facadeable &= connection.hasStatement(r, RDF_TYPE, connection.getValueFactory().createURI(s_type), true, context);
- } else {
- facadeable &= connection.hasStatement(r, RDF_TYPE, connection.getValueFactory().createURI(s_type), true);
- }
+ facadeable &= connection.hasStatement(r, p_type, connection.getValueFactory().createURI(s_type), true, context);
}
}
return facadeable;
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/4aa87dbe/commons/sesame-tools-facading/src/main/java/org/apache/marmotta/commons/sesame/facading/impl/FacadingInvocationHandler.java
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-facading/src/main/java/org/apache/marmotta/commons/sesame/facading/impl/FacadingInvocationHandler.java b/commons/sesame-tools-facading/src/main/java/org/apache/marmotta/commons/sesame/facading/impl/FacadingInvocationHandler.java
index fb70791..fb3fbcd 100644
--- a/commons/sesame-tools-facading/src/main/java/org/apache/marmotta/commons/sesame/facading/impl/FacadingInvocationHandler.java
+++ b/commons/sesame-tools-facading/src/main/java/org/apache/marmotta/commons/sesame/facading/impl/FacadingInvocationHandler.java
@@ -49,8 +49,7 @@ import java.util.*;
* implementation as parameter. Interfaces that make use of this invocation handler need to extend
* the {@link Facade} interface.
*
- * @author Sebastian Schaffert <ss...@apache.org>
- * @author Jakob Frank <ja...@apache.org>
+ * @author Sebastian Schaffert
*/
class FacadingInvocationHandler implements InvocationHandler {
@@ -58,7 +57,7 @@ class FacadingInvocationHandler implements InvocationHandler {
GET(false, 0, "get"),
SET(true, 1, "set"),
ADD(true, 1, "add"),
- DEL(true, 0, "del", "delete", "remove", "rm"),
+ DEL(true, 0, "del", "delete", "remove"),
HAS(false, 0, "has", "is");
@@ -130,7 +129,7 @@ class FacadingInvocationHandler implements InvocationHandler {
private final HashMap<String, Object> fieldCache;
- private final Logger log;
+ private Logger log = LoggerFactory.getLogger(FacadingInvocationHandler.class);
/**
* Indicates if the cache is used, by default is false.
@@ -138,7 +137,6 @@ class FacadingInvocationHandler implements InvocationHandler {
private boolean useCache;
public FacadingInvocationHandler(Resource item, URI context, Class<? extends Facade> facade, Facading facadingService, RepositoryConnection connection) {
- this.log = LoggerFactory.getLogger(facade.getName() + "!" + this.getClass().getSimpleName() + "@" + item.stringValue());
this.delegate = item;
this.facadingService = facadingService;
this.declaredFacade = facade;
@@ -226,8 +224,7 @@ class FacadingInvocationHandler implements InvocationHandler {
*/
@Override
public Object invoke(Object proxy, Method method, Object[] args) throws InstantiationException, IllegalAccessException, RepositoryException {
- if (!connection.isOpen()) { throw new IllegalAccessException("the connection is already closed, cannot access proxy methods."); }
- if (!connection.isActive()) { throw new IllegalAccessException("no active transaction, cannot access triple-store."); }
+ if (!connection.isOpen()) { throw new IllegalAccessException("the connection is already closed, cannot access proxy methods"); }
// handle default methods:
if (FacadingInvocationHelper.checkMethodSig(method, "hashCode")) {
@@ -473,16 +470,13 @@ class FacadingInvocationHandler implements InvocationHandler {
connection.remove((Resource) null, prop, delegate, context);
} else if (!predicate.isInverse() && loc != null) {
final RepositoryResult<Statement> statements = connection.getStatements(delegate, prop, null, false, context);
- try {
- while (statements.hasNext()) {
- final Statement s = statements.next();
- if (FacadingInvocationHelper.checkLocale(loc, s.getObject())) {
- connection.remove(s);
- }
+ while (statements.hasNext()) {
+ final Statement s = statements.next();
+ if (FacadingInvocationHelper.checkLocale(loc, s.getObject())) {
+ connection.remove(s);
}
- } finally {
- statements.close();
}
+ statements.close();
} else if (predicate.isInverse() && loc != null) { throw new IllegalArgumentException("A combination of @RDFInverse and a Literal is not possible");
}
}
@@ -618,7 +612,7 @@ class FacadingInvocationHandler implements InvocationHandler {
final Collection<Object> result = FacadingInvocationHelper.createCollection(collectionType, Collections.<Object> emptyList());
final URI property = connection.getValueFactory().createURI(rdf_property);
- for (final String s : getProperties(entity, property, loc, context)) {
+ for (final String s : getProperties(entity, property, null, null)) {
result.add(FacadeUtils.transformToBaseType(s, tCls));
}
@@ -649,6 +643,7 @@ class FacadingInvocationHandler implements InvocationHandler {
URI property = connection.getValueFactory().createURI(rdf_property);
RepositoryResult<Statement> triples = connection.getStatements(entity, property, null, false);
+
try {
if (triples.hasNext()) {
Statement triple = triples.next();
@@ -681,6 +676,7 @@ class FacadingInvocationHandler implements InvocationHandler {
URI property = connection.getValueFactory().createURI(rdf_property);
RepositoryResult<Statement> triples = connection.getStatements(null, property, entity, false);
+
try {
if (triples.hasNext()) {
Statement triple = triples.next();
@@ -709,20 +705,19 @@ class FacadingInvocationHandler implements InvocationHandler {
*
*/
private <C> Set<C> queryOutgoingAll(Resource entity, String rdf_property, Class<C> returnType) throws RepositoryException {
- final URI property = connection.getValueFactory().createURI(rdf_property);
+ URI property = connection.getValueFactory().createURI(rdf_property);
- final Set<C> dupSet = new LinkedHashSet<C>();
- final RepositoryResult<Statement> triples = connection.getStatements(entity, property, null, false);
- try {
- while (triples.hasNext()) {
- Statement triple = triples.next();
- if (returnType.isInstance(triple.getObject())) {
- dupSet.add(returnType.cast(triple.getObject()));
- }
+ RepositoryResult<Statement> triples = connection.getStatements(entity, property, null, false);
+
+ Set<C> dupSet = new LinkedHashSet<C>();
+
+ while (triples.hasNext()) {
+ Statement triple = triples.next();
+ if (returnType.isInstance(triple.getObject())) {
+ dupSet.add(returnType.cast(triple.getObject()));
}
- } finally {
- triples.close();
}
+ triples.close();
return dupSet;
@@ -735,20 +730,20 @@ class FacadingInvocationHandler implements InvocationHandler {
*
*/
private <C> Set<C> queryIncomingAll(Resource entity, String rdf_property, Class<C> returnType) throws RepositoryException {
- final URI property = connection.getValueFactory().createURI(rdf_property);
- final Set<C> dupSet = new LinkedHashSet<C>();
- final RepositoryResult<Statement> triples = connection.getStatements(null, property, entity, false);
- try {
- while (triples.hasNext()) {
- Statement triple = triples.next();
- if (returnType.isInstance(triple.getSubject())) {
- dupSet.add(returnType.cast(triple.getSubject()));
- }
+ URI property = connection.getValueFactory().createURI(rdf_property);
+
+ RepositoryResult<Statement> triples = connection.getStatements(null, property, entity, false);
+
+ Set<C> dupSet = new LinkedHashSet<C>();
+
+ while (triples.hasNext()) {
+ Statement triple = triples.next();
+ if (returnType.isInstance(triple.getSubject())) {
+ dupSet.add(returnType.cast(triple.getSubject()));
}
- } finally {
- triples.close();
}
+ triples.close();
return dupSet;
}
@@ -774,25 +769,23 @@ class FacadingInvocationHandler implements InvocationHandler {
}
private Set<String> getProperties(Resource entity, URI property, Locale loc, URI context) throws RepositoryException {
- final String lang = loc == null ? null : loc.getLanguage().toLowerCase();
+ String lang = loc == null ? null : loc.getLanguage().toLowerCase();
- final Set<String> values = new HashSet<String>();
- final RepositoryResult<Statement> candidates = connection.getStatements(entity, property, null, false, context);
- try {
- while (candidates.hasNext()) {
- Statement triple = candidates.next();
+ RepositoryResult<Statement> candidates = connection.getStatements(entity, property, null, false, context);
- if (triple.getObject() instanceof Literal) {
- Literal l = (Literal) triple.getObject();
+ Set<String> values = new HashSet<String>();
+ while (candidates.hasNext()) {
+ Statement triple = candidates.next();
- if (lang == null || lang.equals(l.getLanguage())) {
- values.add(l.stringValue());
- }
+ if (triple.getObject() instanceof Literal) {
+ Literal l = (Literal) triple.getObject();
+
+ if (lang == null || lang.equals(l.getLanguage())) {
+ values.add(l.stringValue());
}
}
- } finally {
- candidates.close();
}
+ candidates.close();
return values;
}
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/4aa87dbe/commons/sesame-tools-facading/src/main/java/org/apache/marmotta/commons/sesame/facading/util/FacadeUtils.java
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-facading/src/main/java/org/apache/marmotta/commons/sesame/facading/util/FacadeUtils.java b/commons/sesame-tools-facading/src/main/java/org/apache/marmotta/commons/sesame/facading/util/FacadeUtils.java
index 3c29da5..f5bf702 100644
--- a/commons/sesame-tools-facading/src/main/java/org/apache/marmotta/commons/sesame/facading/util/FacadeUtils.java
+++ b/commons/sesame-tools-facading/src/main/java/org/apache/marmotta/commons/sesame/facading/util/FacadeUtils.java
@@ -17,7 +17,6 @@
package org.apache.marmotta.commons.sesame.facading.util;
-import org.apache.commons.lang3.LocaleUtils;
import org.apache.marmotta.commons.sesame.facading.model.Facade;
import org.apache.marmotta.commons.util.DateUtils;
import org.openrdf.model.Resource;
@@ -296,50 +295,40 @@ public class FacadeUtils {
* @return
* @throws IllegalArgumentException
*/
- @SuppressWarnings("unchecked")
public static <T> T transformToBaseType(String value, Class<T> returnType) throws IllegalArgumentException {
// transformation to appropriate primitive type
- /*
- * README: the "dirty" cast: "(T) x" instead of "returnType.cast(x)" is required since
- * .cast does not work for primitive types (int, double, float, etc...).
- * Somehow it results in a ClassCastException
- */
if(Integer.class.equals(returnType) || int.class.equals(returnType)) {
if(value == null) {
- return (T)(Integer)(0);
+ return returnType.cast(0);
}
- return (T)(Integer.decode(value));
+ return returnType.cast(Integer.parseInt(value));
} else if(Long.class.equals(returnType) || long.class.equals(returnType)) {
if(value == null) {
- return (T)(Long)(0L);
+ return returnType.cast(0L);
}
- return (T)(Long.decode(value));
+ return returnType.cast(Long.parseLong(value));
} else if(Double.class.equals(returnType) || double.class.equals(returnType)) {
if(value == null) {
- return (T)(Double)(0.0);
+ return returnType.cast(0.0);
}
- return (T)(Double.valueOf(value));
+ return returnType.cast(Double.parseDouble(value));
} else if(Float.class.equals(returnType) || float.class.equals(returnType)) {
if(value == null) {
- return (T)(Float)(0.0F);
+ return returnType.cast(0.0F);
}
- return (T)(Float.valueOf(value));
+ return returnType.cast(Float.parseFloat(value));
} else if(Byte.class.equals(returnType) || byte.class.equals(returnType)) {
if(value == null) {
- return (T)(Byte)((byte) 0);
+ return returnType.cast((byte) 0);
}
- return (T)(Byte.decode(value));
+ return returnType.cast(Byte.parseByte(value));
} else if(Boolean.class.equals(returnType) || boolean.class.equals(returnType)) {
- return (T)(Boolean.valueOf(value));
+ return returnType.cast(Boolean.parseBoolean(value));
} else if(Character.class.equals(returnType) || char.class.equals(returnType)) {
if(value == null) {
- if (Character.class.equals(returnType)){
- return null;
- } else {
- return (T) new Character((char) 0);
- }
+ return null;
} else if(value.length() > 0) {
- return (T)(Character)(value.charAt(0));
+ return returnType.cast(value.charAt(0));
} else {
return null;
}
@@ -347,7 +336,7 @@ public class FacadeUtils {
if(value == null) {
return null;
} else {
- return returnType.cast(LocaleUtils.toLocale(value));
+ return returnType.cast(new Locale(value));
}
} else if (Date.class.equals(returnType)) {
if(value == null) {
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/4aa87dbe/commons/sesame-tools-facading/src/test/java/org/apache/marmotta/commons/sesame/facading/AbstractFacadingTest.java
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-facading/src/test/java/org/apache/marmotta/commons/sesame/facading/AbstractFacadingTest.java b/commons/sesame-tools-facading/src/test/java/org/apache/marmotta/commons/sesame/facading/AbstractFacadingTest.java
index befedc2..04762b4 100644
--- a/commons/sesame-tools-facading/src/test/java/org/apache/marmotta/commons/sesame/facading/AbstractFacadingTest.java
+++ b/commons/sesame-tools-facading/src/test/java/org/apache/marmotta/commons/sesame/facading/AbstractFacadingTest.java
@@ -14,19 +14,17 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
package org.apache.marmotta.commons.sesame.facading;
-import java.io.IOException;
-
-import org.apache.marmotta.kiwi.persistence.h2.H2Dialect;
-import org.apache.marmotta.kiwi.sail.KiWiStore;
import org.junit.After;
import org.junit.Before;
import org.openrdf.repository.Repository;
import org.openrdf.repository.RepositoryException;
import org.openrdf.repository.sail.SailRepository;
import org.openrdf.rio.RDFParseException;
+import org.openrdf.sail.memory.MemoryStore;
+
+import java.io.IOException;
public abstract class AbstractFacadingTest {
@@ -34,13 +32,7 @@ public abstract class AbstractFacadingTest {
@Before
public void setup() throws RepositoryException, IOException, RDFParseException {
- // jdbc:h2:mem;MVCC=true;DB_CLOSE_ON_EXIT=FALSE;DB_CLOSE_DELAY=10
- repositoryRDF = new SailRepository(
- new KiWiStore(
- "kiwiTest",
- "jdbc:h2:mem:facading;MVCC=true;DB_CLOSE_ON_EXIT=TRUE;DB_CLOSE_DELAY=10",
- "", "", new H2Dialect(),
- "http://example.com/ctx/default", "http://example.com/ctx/inferred"));
+ repositoryRDF = new SailRepository(new MemoryStore());
repositoryRDF.initialize();
}
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/4aa87dbe/commons/sesame-tools-facading/src/test/java/org/apache/marmotta/commons/sesame/facading/builder/FacadingPredicateBuilderTest.java
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-facading/src/test/java/org/apache/marmotta/commons/sesame/facading/builder/FacadingPredicateBuilderTest.java b/commons/sesame-tools-facading/src/test/java/org/apache/marmotta/commons/sesame/facading/builder/FacadingPredicateBuilderTest.java
index 88e043b..c9515cb 100644
--- a/commons/sesame-tools-facading/src/test/java/org/apache/marmotta/commons/sesame/facading/builder/FacadingPredicateBuilderTest.java
+++ b/commons/sesame-tools-facading/src/test/java/org/apache/marmotta/commons/sesame/facading/builder/FacadingPredicateBuilderTest.java
@@ -14,7 +14,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
package org.apache.marmotta.commons.sesame.facading.builder;
import static org.hamcrest.CoreMatchers.allOf;
@@ -50,7 +49,6 @@ public class FacadingPredicateBuilderTest extends AbstractFacadingTest {
super.setup();
connection = repositoryRDF.getConnection();
- connection.begin();
facading = FacadingFactory.createFacading(connection);
}
@@ -92,7 +90,7 @@ public class FacadingPredicateBuilderTest extends AbstractFacadingTest {
@After
public void tearDown() throws RepositoryException {
if (connection != null) {
- connection.commit();
+ connection.rollback();
connection.close();
}
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/4aa87dbe/commons/sesame-tools-facading/src/test/java/org/apache/marmotta/commons/sesame/facading/builder/model/ExampleFacade.java
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-facading/src/test/java/org/apache/marmotta/commons/sesame/facading/builder/model/ExampleFacade.java b/commons/sesame-tools-facading/src/test/java/org/apache/marmotta/commons/sesame/facading/builder/model/ExampleFacade.java
index 632edce..186c9ba 100644
--- a/commons/sesame-tools-facading/src/test/java/org/apache/marmotta/commons/sesame/facading/builder/model/ExampleFacade.java
+++ b/commons/sesame-tools-facading/src/test/java/org/apache/marmotta/commons/sesame/facading/builder/model/ExampleFacade.java
@@ -14,7 +14,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
package org.apache.marmotta.commons.sesame.facading.builder.model;
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/4aa87dbe/commons/sesame-tools-facading/src/test/java/org/apache/marmotta/commons/sesame/facading/builder/model/ExamplePropBuilder.java
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-facading/src/test/java/org/apache/marmotta/commons/sesame/facading/builder/model/ExamplePropBuilder.java b/commons/sesame-tools-facading/src/test/java/org/apache/marmotta/commons/sesame/facading/builder/model/ExamplePropBuilder.java
index 89baca4..0caf2c7 100644
--- a/commons/sesame-tools-facading/src/test/java/org/apache/marmotta/commons/sesame/facading/builder/model/ExamplePropBuilder.java
+++ b/commons/sesame-tools-facading/src/test/java/org/apache/marmotta/commons/sesame/facading/builder/model/ExamplePropBuilder.java
@@ -14,7 +14,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
package org.apache.marmotta.commons.sesame.facading.builder.model;
import org.apache.marmotta.commons.sesame.facading.model.AbstractNamespacePropBuilder;
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/4aa87dbe/commons/sesame-tools-facading/src/test/java/org/apache/marmotta/commons/sesame/facading/collections/CollectionFacadingTest.java
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-facading/src/test/java/org/apache/marmotta/commons/sesame/facading/collections/CollectionFacadingTest.java b/commons/sesame-tools-facading/src/test/java/org/apache/marmotta/commons/sesame/facading/collections/CollectionFacadingTest.java
index bebe041..ef143dd 100644
--- a/commons/sesame-tools-facading/src/test/java/org/apache/marmotta/commons/sesame/facading/collections/CollectionFacadingTest.java
+++ b/commons/sesame-tools-facading/src/test/java/org/apache/marmotta/commons/sesame/facading/collections/CollectionFacadingTest.java
@@ -14,7 +14,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
package org.apache.marmotta.commons.sesame.facading.collections;
import static org.hamcrest.CoreMatchers.hasItems;
@@ -40,22 +39,20 @@ public class CollectionFacadingTest extends AbstractFacadingTest {
@Test
public void testCollectionFacading() throws RepositoryException {
+ final RepositoryConnection connection = repositoryRDF.getConnection();
final Random rnd = new Random();
final Date a, b, c, d, e, now;
- now = new Date(60000*(System.currentTimeMillis()/60000L));
-
+ now = new Date();
// Start 10Yrs back;
- final int tenYrsInMin = 10 * 365 * 24 * 60;
- a = new Date(now.getTime() - tenYrsInMin * 60000L);
- b = new Date(a.getTime() + rnd.nextInt(tenYrsInMin) * 60000L);
- c = new Date(a.getTime() + rnd.nextInt(tenYrsInMin) * 60000L);
- d = new Date(a.getTime() + rnd.nextInt(tenYrsInMin) * 60000L);
- e = new Date(a.getTime() + rnd.nextInt(tenYrsInMin) * 60000L);
+ final int tenYrsInSecs = 10 * 365 * 24 * 60 * 60;
+ a = new Date(now.getTime() - tenYrsInSecs * 1000L);
+ b = new Date(a.getTime() + rnd.nextInt(tenYrsInSecs) * 1000L);
+ c = new Date(a.getTime() + rnd.nextInt(tenYrsInSecs) * 1000L);
+ d = new Date(a.getTime() + rnd.nextInt(tenYrsInSecs) * 1000L);
+ e = new Date(a.getTime() + rnd.nextInt(tenYrsInSecs) * 1000L);
- final RepositoryConnection connection = repositoryRDF.getConnection();
try {
- connection.begin();
final Facading facading = FacadingFactory.createFacading(connection);
URI uri = connection.getValueFactory().createURI("http://www.example.com/rdf/test/collections");
@@ -73,8 +70,6 @@ public class CollectionFacadingTest extends AbstractFacadingTest {
facade.deleteDates();
Assert.assertEquals(facade.getDates().size(), 0);
-
- connection.commit();
} finally {
connection.close();
}
@@ -88,7 +83,6 @@ public class CollectionFacadingTest extends AbstractFacadingTest {
try {
final Facading facading = FacadingFactory.createFacading(connection);
- connection.begin();
URI uri = connection.getValueFactory().createURI("http://www.example.com/rdf/test/document");
CollectionFacade facade = facading.createFacade(uri, CollectionFacade.class);
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/4aa87dbe/commons/sesame-tools-facading/src/test/java/org/apache/marmotta/commons/sesame/facading/collections/model/CollectionFacade.java
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-facading/src/test/java/org/apache/marmotta/commons/sesame/facading/collections/model/CollectionFacade.java b/commons/sesame-tools-facading/src/test/java/org/apache/marmotta/commons/sesame/facading/collections/model/CollectionFacade.java
index 72fdf8a..5980e17 100644
--- a/commons/sesame-tools-facading/src/test/java/org/apache/marmotta/commons/sesame/facading/collections/model/CollectionFacade.java
+++ b/commons/sesame-tools-facading/src/test/java/org/apache/marmotta/commons/sesame/facading/collections/model/CollectionFacade.java
@@ -14,7 +14,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
package org.apache.marmotta.commons.sesame.facading.collections.model;
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/4aa87dbe/commons/sesame-tools-facading/src/test/java/org/apache/marmotta/commons/sesame/facading/concurrent/ConcurrentFacadingTest.java
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-facading/src/test/java/org/apache/marmotta/commons/sesame/facading/concurrent/ConcurrentFacadingTest.java b/commons/sesame-tools-facading/src/test/java/org/apache/marmotta/commons/sesame/facading/concurrent/ConcurrentFacadingTest.java
deleted file mode 100644
index 241f5f3..0000000
--- a/commons/sesame-tools-facading/src/test/java/org/apache/marmotta/commons/sesame/facading/concurrent/ConcurrentFacadingTest.java
+++ /dev/null
@@ -1,198 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.marmotta.commons.sesame.facading.concurrent;
-
-import java.util.ConcurrentModificationException;
-import java.util.UUID;
-
-import org.apache.marmotta.commons.sesame.facading.AbstractFacadingTest;
-import org.apache.marmotta.commons.sesame.facading.FacadingFactory;
-import org.apache.marmotta.commons.sesame.facading.api.Facading;
-import org.apache.marmotta.commons.sesame.facading.concurrent.model.FooFacade;
-import org.apache.marmotta.commons.sesame.facading.concurrent.model.TypeFacade;
-import org.apache.marmotta.commons.sesame.repository.ResourceUtils;
-import org.apache.marmotta.commons.vocabulary.DCTERMS;
-import org.junit.Assert;
-import org.junit.Before;
-import org.junit.Ignore;
-import org.junit.Test;
-import org.openrdf.model.URI;
-import org.openrdf.model.vocabulary.RDF;
-import org.openrdf.repository.RepositoryConnection;
-import org.openrdf.repository.RepositoryException;
-
-public class ConcurrentFacadingTest extends AbstractFacadingTest {
-
- private URI subject;
-
- @Before
- public void init() {
- subject = repositoryRDF.getValueFactory().createURI("http://example.com/rdf/" + UUID.randomUUID().toString());
- }
-
- @Test
- public void testParallelConnections() throws RepositoryException {
- final URI type = repositoryRDF.getValueFactory().createURI(DCTERMS.Agent.stringValue()+"#", UUID.randomUUID().toString());
- final RepositoryConnection cX = repositoryRDF.getConnection(),
- cO = repositoryRDF.getConnection();
- try {
- cX.begin();
- cO.begin();
-
- cX.add(subject, RDF.TYPE, type);
- Assert.assertTrue (cX.hasStatement(subject, RDF.TYPE, type, false));
- Assert.assertFalse(cO.hasStatement(subject, RDF.TYPE, type, false));
-
- cX.commit();
- Assert.assertTrue(cO.hasStatement(subject, RDF.TYPE, type, false));
-
- cO.commit();
- } finally {
- if (cX.isActive()) cX.rollback();
- if (cO.isActive()) cO.rollback();
- cX.close();
- cO.close();
- }
- }
-
- @Test
- @Ignore("currently fails for H2 database because of transaction locking")
- public void testParallelFacading() throws RepositoryException {
- final RepositoryConnection fc = repositoryRDF.getConnection();
- try {
- fc.begin();
- final Facading facading = FacadingFactory.createFacading(fc);
-
- final FooFacade ff = facading.createFacade(subject, FooFacade.class);
-
- Assert.assertNull(ff.getString());
- final String v = UUID.randomUUID().toString();
- ff.setString(v);
- Assert.assertEquals(v, ff.getString());
-
- final RepositoryConnection fc2 = repositoryRDF.getConnection();
- try {
- fc2.begin();
-
- final Facading f2 = FacadingFactory.createFacading(fc2);
- Assert.assertNull(f2.createFacade(subject, FooFacade.class).getString());
-
- fc2.commit();
- } finally {
- if (fc2.isActive()) fc2.rollback();
- fc2.close();
- }
-
- fc.commit();
-
- final RepositoryConnection fc3 = repositoryRDF.getConnection();
- try {
- fc3.begin();
-
- final Facading f3 = FacadingFactory.createFacading(fc3);
- Assert.assertEquals(v, f3.createFacade(subject, FooFacade.class).getString());
-
- fc3.commit();
- } finally {
- if (fc3.isActive()) fc3.rollback();
- fc3.close();
- }
- } finally {
- if (fc.isActive()) fc.rollback();
- fc.close();
- }
- }
-
- /**
- * Test for MARMOTTA-236
- * @throws RepositoryException
- */
- @Test
- public void testParallelFacadingType() throws RepositoryException {
- final RepositoryConnection mainCon = repositoryRDF.getConnection();
- try {
- mainCon.begin();
- Assert.assertFalse(ResourceUtils.hasType(mainCon, subject, TypeFacade.TYPE));
-
- final Facading facading = FacadingFactory.createFacading(mainCon);
- Assert.assertFalse(facading.isFacadeable(subject, TypeFacade.class));
- Assert.assertFalse(ResourceUtils.hasType(mainCon, subject, TypeFacade.TYPE));
-
-
- final TypeFacade ff = facading.createFacade(subject, TypeFacade.class);
- Assert.assertTrue(facading.isFacadeable(subject, TypeFacade.class));
- Assert.assertTrue(ResourceUtils.hasType(mainCon, subject, TypeFacade.TYPE));
-
- Assert.assertNull(ff.getTitle());
- final String v = UUID.randomUUID().toString();
- ff.setTitle(v);
- Assert.assertEquals(v, ff.getTitle());
- Assert.assertTrue(ResourceUtils.hasType(mainCon, subject, TypeFacade.TYPE));
- Assert.assertTrue(facading.isFacadeable(subject, TypeFacade.class));
-
- { // before-commit
- final RepositoryConnection subCon_1 = repositoryRDF.getConnection();
- try {
- subCon_1.begin();
- Assert.assertFalse(ResourceUtils.hasType(subCon_1, subject, TypeFacade.TYPE));
-
- final Facading f_1 = FacadingFactory.createFacading(subCon_1);
- Assert.assertFalse(f_1.isFacadeable(subject, TypeFacade.class));
-
- final TypeFacade tf_1 = f_1.createFacade(subject, TypeFacade.class);
- Assert.assertNull(tf_1.getTitle());
- Assert.assertTrue(f_1.isFacadeable(subject, TypeFacade.class));
- Assert.assertTrue(ResourceUtils.hasType(subCon_1, subject, TypeFacade.TYPE));
-
- subCon_1.rollback();
- } finally {
- if (subCon_1.isActive()) subCon_1.rollback();
- subCon_1.close();
- }
- }
-
- mainCon.commit();
-
- { // after-commit
- final RepositoryConnection subCon_2 = repositoryRDF.getConnection();
- try {
- subCon_2.begin();
- Assert.assertTrue(ResourceUtils.hasType(subCon_2, subject, TypeFacade.TYPE));
-
- final Facading f_2 = FacadingFactory.createFacading(subCon_2);
- Assert.assertTrue(f_2.isFacadeable(subject, TypeFacade.class));
-
- Assert.assertEquals(v, f_2.createFacade(subject, TypeFacade.class).getTitle());
- Assert.assertTrue(ResourceUtils.hasType(subCon_2, subject, TypeFacade.TYPE));
- Assert.assertTrue(f_2.isFacadeable(subject, TypeFacade.class));
-
- subCon_2.commit();
- } finally {
- if (subCon_2.isActive()) subCon_2.rollback();
- subCon_2.close();
- }
- }
- } catch (ConcurrentModificationException ex) {
- // do nothing, H2 locking
- } finally {
- if (mainCon.isActive()) mainCon.rollback();
- mainCon.close();
- }
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/4aa87dbe/commons/sesame-tools-facading/src/test/java/org/apache/marmotta/commons/sesame/facading/concurrent/model/FooFacade.java
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-facading/src/test/java/org/apache/marmotta/commons/sesame/facading/concurrent/model/FooFacade.java b/commons/sesame-tools-facading/src/test/java/org/apache/marmotta/commons/sesame/facading/concurrent/model/FooFacade.java
deleted file mode 100644
index 095f6fe..0000000
--- a/commons/sesame-tools-facading/src/test/java/org/apache/marmotta/commons/sesame/facading/concurrent/model/FooFacade.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.marmotta.commons.sesame.facading.concurrent.model;
-
-import org.apache.marmotta.commons.sesame.facading.annotations.RDF;
-import org.apache.marmotta.commons.sesame.facading.model.Facade;
-import org.openrdf.model.vocabulary.DCTERMS;
-
-public interface FooFacade extends Facade {
-
- @RDF(DCTERMS.NAMESPACE + "string")
- public void setString(String string);
- public String getString();
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/4aa87dbe/commons/sesame-tools-facading/src/test/java/org/apache/marmotta/commons/sesame/facading/concurrent/model/TypeFacade.java
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-facading/src/test/java/org/apache/marmotta/commons/sesame/facading/concurrent/model/TypeFacade.java b/commons/sesame-tools-facading/src/test/java/org/apache/marmotta/commons/sesame/facading/concurrent/model/TypeFacade.java
deleted file mode 100644
index d08404a..0000000
--- a/commons/sesame-tools-facading/src/test/java/org/apache/marmotta/commons/sesame/facading/concurrent/model/TypeFacade.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.marmotta.commons.sesame.facading.concurrent.model;
-
-import org.apache.marmotta.commons.sesame.facading.annotations.RDF;
-import org.apache.marmotta.commons.sesame.facading.annotations.RDFType;
-import org.apache.marmotta.commons.sesame.facading.model.Facade;
-
-@RDFType(TypeFacade.TYPE)
-public interface TypeFacade extends Facade {
-
- public static final String TITLE = "http://foo.bar/title";
- public static final String TYPE = "http://foo.bar/Type";
-
- @RDF(TITLE)
- String getTitle();
- void setTitle(String title);
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/4aa87dbe/commons/sesame-tools-facading/src/test/java/org/apache/marmotta/commons/sesame/facading/foaf/FacadingFoafTest.java
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-facading/src/test/java/org/apache/marmotta/commons/sesame/facading/foaf/FacadingFoafTest.java b/commons/sesame-tools-facading/src/test/java/org/apache/marmotta/commons/sesame/facading/foaf/FacadingFoafTest.java
index 9d1442e..646d3c1 100644
--- a/commons/sesame-tools-facading/src/test/java/org/apache/marmotta/commons/sesame/facading/foaf/FacadingFoafTest.java
+++ b/commons/sesame-tools-facading/src/test/java/org/apache/marmotta/commons/sesame/facading/foaf/FacadingFoafTest.java
@@ -14,7 +14,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
package org.apache.marmotta.commons.sesame.facading.foaf;
import static org.hamcrest.CoreMatchers.allOf;
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/4aa87dbe/commons/sesame-tools-facading/src/test/java/org/apache/marmotta/commons/sesame/facading/foaf/model/OnlineAccount.java
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-facading/src/test/java/org/apache/marmotta/commons/sesame/facading/foaf/model/OnlineAccount.java b/commons/sesame-tools-facading/src/test/java/org/apache/marmotta/commons/sesame/facading/foaf/model/OnlineAccount.java
index 12cd744..d1d316a 100644
--- a/commons/sesame-tools-facading/src/test/java/org/apache/marmotta/commons/sesame/facading/foaf/model/OnlineAccount.java
+++ b/commons/sesame-tools-facading/src/test/java/org/apache/marmotta/commons/sesame/facading/foaf/model/OnlineAccount.java
@@ -14,7 +14,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
package org.apache.marmotta.commons.sesame.facading.foaf.model;
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/4aa87dbe/commons/sesame-tools-facading/src/test/java/org/apache/marmotta/commons/sesame/facading/foaf/model/Person.java
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-facading/src/test/java/org/apache/marmotta/commons/sesame/facading/foaf/model/Person.java b/commons/sesame-tools-facading/src/test/java/org/apache/marmotta/commons/sesame/facading/foaf/model/Person.java
index 9328f75..c6298c1 100644
--- a/commons/sesame-tools-facading/src/test/java/org/apache/marmotta/commons/sesame/facading/foaf/model/Person.java
+++ b/commons/sesame-tools-facading/src/test/java/org/apache/marmotta/commons/sesame/facading/foaf/model/Person.java
@@ -14,7 +14,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
package org.apache.marmotta.commons.sesame.facading.foaf.model;
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/4aa87dbe/commons/sesame-tools-facading/src/test/java/org/apache/marmotta/commons/sesame/facading/locale/LocaleFacadingTest.java
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-facading/src/test/java/org/apache/marmotta/commons/sesame/facading/locale/LocaleFacadingTest.java b/commons/sesame-tools-facading/src/test/java/org/apache/marmotta/commons/sesame/facading/locale/LocaleFacadingTest.java
index 6dc860e..5932471 100644
--- a/commons/sesame-tools-facading/src/test/java/org/apache/marmotta/commons/sesame/facading/locale/LocaleFacadingTest.java
+++ b/commons/sesame-tools-facading/src/test/java/org/apache/marmotta/commons/sesame/facading/locale/LocaleFacadingTest.java
@@ -14,10 +14,8 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
package org.apache.marmotta.commons.sesame.facading.locale;
-import java.util.Locale;
import static org.hamcrest.CoreMatchers.anyOf;
import static org.hamcrest.CoreMatchers.is;
@@ -25,6 +23,7 @@ import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertThat;
+
import org.apache.marmotta.commons.sesame.facading.AbstractFacadingTest;
import org.apache.marmotta.commons.sesame.facading.FacadingFactory;
import org.apache.marmotta.commons.sesame.facading.api.Facading;
@@ -34,11 +33,13 @@ import org.openrdf.model.URI;
import org.openrdf.repository.RepositoryConnection;
import org.openrdf.repository.RepositoryException;
+import java.util.Locale;
+
public class LocaleFacadingTest extends AbstractFacadingTest {
@Test
public void testWithLocale() throws RepositoryException {
- final Locale de = Locale.GERMAN, en = Locale.ENGLISH, fr = Locale.FRENCH, none = new Locale("xx", "none");
+ final Locale de = Locale.GERMAN, en = Locale.ENGLISH, fr = Locale.FRENCH, none = new Locale("none");
final String lbl = "Label",
lbl_de = lbl + ": " + de.toString(),
@@ -48,7 +49,6 @@ public class LocaleFacadingTest extends AbstractFacadingTest {
final RepositoryConnection connection = repositoryRDF.getConnection();
try {
- connection.begin();
final Facading facading = FacadingFactory.createFacading(connection);
final URI uri = connection.getValueFactory().createURI("http://www.example.com/rdf/test/locale");
@@ -101,7 +101,6 @@ public class LocaleFacadingTest extends AbstractFacadingTest {
assertNull(f.getLabel(fr));
assertNull(f.getLabel(none));
- connection.commit();
} finally {
connection.close();
}
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/4aa87dbe/commons/sesame-tools-facading/src/test/java/org/apache/marmotta/commons/sesame/facading/locale/model/LocaleFacade.java
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-facading/src/test/java/org/apache/marmotta/commons/sesame/facading/locale/model/LocaleFacade.java b/commons/sesame-tools-facading/src/test/java/org/apache/marmotta/commons/sesame/facading/locale/model/LocaleFacade.java
index 953fb02..1db7621 100644
--- a/commons/sesame-tools-facading/src/test/java/org/apache/marmotta/commons/sesame/facading/locale/model/LocaleFacade.java
+++ b/commons/sesame-tools-facading/src/test/java/org/apache/marmotta/commons/sesame/facading/locale/model/LocaleFacade.java
@@ -14,7 +14,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
package org.apache.marmotta.commons.sesame.facading.locale.model;
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/4aa87dbe/commons/sesame-tools-facading/src/test/java/org/apache/marmotta/commons/sesame/facading/primitive/BoxedFacadingTest.java
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-facading/src/test/java/org/apache/marmotta/commons/sesame/facading/primitive/BoxedFacadingTest.java b/commons/sesame-tools-facading/src/test/java/org/apache/marmotta/commons/sesame/facading/primitive/BoxedFacadingTest.java
deleted file mode 100644
index 5efc18a..0000000
--- a/commons/sesame-tools-facading/src/test/java/org/apache/marmotta/commons/sesame/facading/primitive/BoxedFacadingTest.java
+++ /dev/null
@@ -1,157 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.marmotta.commons.sesame.facading.primitive;
-
-import java.util.Date;
-import java.util.Locale;
-import java.util.Random;
-import java.util.UUID;
-
-import org.apache.marmotta.commons.sesame.facading.AbstractFacadingTest;
-import org.apache.marmotta.commons.sesame.facading.FacadingFactory;
-import org.apache.marmotta.commons.sesame.facading.api.Facading;
-import org.apache.marmotta.commons.sesame.facading.primitive.model.Boxed;
-import org.junit.After;
-import org.junit.Assert;
-import org.junit.Before;
-import org.junit.Test;
-import org.openrdf.model.URI;
-import org.openrdf.repository.RepositoryConnection;
-import org.openrdf.repository.RepositoryException;
-
-public class BoxedFacadingTest extends AbstractFacadingTest {
-
- private URI subject;
- private Random random;
- private RepositoryConnection facadingConnection;
- private Boxed boxed;
-
- @Before
- public void before() throws Exception {
- subject = repositoryRDF.getValueFactory().createURI("urn:", UUID.randomUUID().toString());
- random = new Random();
-
- facadingConnection = repositoryRDF.getConnection();
- facadingConnection.begin();
- final Facading factory = FacadingFactory.createFacading(facadingConnection);
- boxed = factory.createFacade(subject, Boxed.class);
- }
-
- @After
- public void after() throws Exception {
- if (facadingConnection != null) {
- if (facadingConnection.isActive()) facadingConnection.rollback();
- facadingConnection.close();
- }
- }
-
- @Test
- public void testString() throws RepositoryException {
- final String string = UUID.randomUUID().toString();
-
- Assert.assertNull(boxed.getString());
- boxed.setString(string);
- Assert.assertEquals(string, boxed.getString());
- }
-
- @Test
- public void testInteger() {
- final Integer i = new Integer(random.nextInt());
-
- Assert.assertEquals(new Integer(0), boxed.getInteger());
- boxed.setInteger(i);
- Assert.assertEquals(i, boxed.getInteger());
- }
-
- @Test
- public void testLong() {
- final Long l = new Long(random.nextLong());
-
- Assert.assertEquals(new Long(0), boxed.getLong());
- boxed.setLong(l);
- Assert.assertEquals(l, boxed.getLong());
- }
-
- @Test
- public void testFloat() {
- final Float f = new Float(random.nextFloat());
-
- Assert.assertEquals(0f, boxed.getFloat().floatValue(), 10e-9);
- boxed.setFloat(f);
- Assert.assertEquals(f, boxed.getFloat().floatValue(), 10e-9);
- }
-
- @Test
- public void testDouble() {
- final Double d = new Double(random.nextDouble());
-
- Assert.assertEquals(0d, boxed.getDouble().doubleValue(), 10e-12);
- boxed.setDouble(d);
- Assert.assertEquals(d, boxed.getDouble().doubleValue(), 10e-12);
- }
-
- @Test
- public void testCharacter() {
- final Character c = new Character((char) random.nextInt(255));
-
- Assert.assertNull(boxed.getCharacter());
- boxed.setCharacter(c);
- Assert.assertEquals(c, boxed.getCharacter());
- }
-
- @Test
- public void testByte() {
- final Byte b = new Byte((byte) random.nextInt(Byte.MAX_VALUE));
-
- Assert.assertEquals(new Byte((byte)0), boxed.getByte());
- boxed.setByte(b);
- Assert.assertEquals(b, boxed.getByte());
- }
-
- @Test
- public void testBoolean() {
- Assert.assertFalse(boxed.getBoolean());
- boxed.setBoolean(Boolean.FALSE);
- Assert.assertFalse(boxed.getBoolean());
- boxed.setBoolean(Boolean.TRUE);
- Assert.assertTrue(boxed.getBoolean());
- }
-
- @Test
- public void testLocale() {
- Assert.assertNull(boxed.getLocale());
-
- for (Locale l: Locale.getAvailableLocales()) {
- boxed.setLocale(l);
- //Assert.assertEquals(l, boxed.getLocale());
- Assert.assertEquals(l.getDisplayLanguage(), boxed.getLocale().getDisplayLanguage());
- }
- }
-
- @Test
- public void testGetDate() {
- /* Dates are stored with seconds-precision */
- final Date d = new Date(1000*((random.nextLong()%System.currentTimeMillis())/1000));
-
- Assert.assertNull(boxed.getDate());
- boxed.setDate(d);
- Assert.assertEquals(d, boxed.getDate());
- }
-
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/4aa87dbe/commons/sesame-tools-facading/src/test/java/org/apache/marmotta/commons/sesame/facading/primitive/PrimitiveFacadingTest.java
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-facading/src/test/java/org/apache/marmotta/commons/sesame/facading/primitive/PrimitiveFacadingTest.java b/commons/sesame-tools-facading/src/test/java/org/apache/marmotta/commons/sesame/facading/primitive/PrimitiveFacadingTest.java
deleted file mode 100644
index 1d1d060..0000000
--- a/commons/sesame-tools-facading/src/test/java/org/apache/marmotta/commons/sesame/facading/primitive/PrimitiveFacadingTest.java
+++ /dev/null
@@ -1,130 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.marmotta.commons.sesame.facading.primitive;
-
-import java.util.Random;
-import java.util.UUID;
-
-import org.apache.marmotta.commons.sesame.facading.AbstractFacadingTest;
-import org.apache.marmotta.commons.sesame.facading.FacadingFactory;
-import org.apache.marmotta.commons.sesame.facading.api.Facading;
-import org.apache.marmotta.commons.sesame.facading.primitive.model.Primitive;
-import org.junit.After;
-import org.junit.Assert;
-import org.junit.Before;
-import org.junit.Test;
-import org.openrdf.model.URI;
-import org.openrdf.repository.RepositoryConnection;
-import org.openrdf.repository.RepositoryException;
-
-public class PrimitiveFacadingTest extends AbstractFacadingTest {
-
- private static final int ITERATIONS = 2500;
-
- private URI subject;
- private Random random;
- private RepositoryConnection facadingConnection;
- private Primitive primitive;
-
- @Before
- public void before() throws Exception {
- subject = repositoryRDF.getValueFactory().createURI("urn:", UUID.randomUUID().toString());
- random = new Random();
-
- facadingConnection = repositoryRDF.getConnection();
- facadingConnection.begin();
- final Facading factory = FacadingFactory.createFacading(facadingConnection);
- primitive = factory.createFacade(subject, Primitive.class);
-
- }
-
- @After
- public void after() throws RepositoryException {
- if (facadingConnection != null) {
- if (facadingConnection.isActive()) facadingConnection.rollback();
- facadingConnection.close();
- }
- }
-
- @Test
- public void testInt() {
-
- for (int j =0; j < ITERATIONS; j++) {
- Assert.assertEquals(0, primitive.getInt());
- }
- final int i = random.nextInt();
- primitive.setInt(i);
- Assert.assertEquals(i, primitive.getInt());
- }
-
- @Test
- public void testByte() {
- final byte b = (byte) random.nextInt(Byte.MAX_VALUE);
-
- Assert.assertEquals(0, primitive.getByte());
- primitive.setByte(b);
- Assert.assertEquals(b, primitive.getByte());
- }
-
- @Test
- public void testFloat() {
- final float f = random.nextFloat();
-
- Assert.assertEquals(0f, primitive.getFloat(), 10e-9);
- primitive.setFloat(f);
- Assert.assertEquals(f, primitive.getFloat(), 10e-9);
- }
-
- @Test
- public void testDouble() {
- final double d = random.nextDouble();
-
- Assert.assertEquals(0d, primitive.getDouble(), 10e-12);
- primitive.setDouble(d);
- Assert.assertEquals(d, primitive.getDouble(), 10e-12);
- }
-
- @Test
- public void testLong() {
- final long l = random.nextLong();
-
- Assert.assertEquals(0l, primitive.getLong());
- primitive.setLong(l);
- Assert.assertEquals(l, primitive.getLong());
- }
-
-
- @Test
- public void testGetBoolean() {
- Assert.assertFalse(primitive.getBoolean());
- primitive.setBoolean(false);
- Assert.assertFalse(primitive.getBoolean());
- primitive.setBoolean(true);
- Assert.assertTrue(primitive.getBoolean());
- }
-
- @Test
- public void testGetChar() {
- final char c = (char) random.nextInt(255);
-
- Assert.assertEquals(0, primitive.getChar());
- primitive.setChar(c);
- Assert.assertEquals(c, primitive.getChar());
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/4aa87dbe/commons/sesame-tools-facading/src/test/java/org/apache/marmotta/commons/sesame/facading/primitive/model/Boxed.java
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-facading/src/test/java/org/apache/marmotta/commons/sesame/facading/primitive/model/Boxed.java b/commons/sesame-tools-facading/src/test/java/org/apache/marmotta/commons/sesame/facading/primitive/model/Boxed.java
deleted file mode 100644
index f540689..0000000
--- a/commons/sesame-tools-facading/src/test/java/org/apache/marmotta/commons/sesame/facading/primitive/model/Boxed.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.marmotta.commons.sesame.facading.primitive.model;
-
-import java.util.Date;
-import java.util.Locale;
-
-import org.apache.marmotta.commons.sesame.facading.annotations.RDFPropertyBuilder;
-import org.apache.marmotta.commons.sesame.facading.model.Facade;
-
-@RDFPropertyBuilder(PropBuilder.class)
-public interface Boxed extends Facade {
-
- public Integer getInteger();
- public void setInteger(Integer integer);
- public Long getLong();
- public void setLong(Long l);
- public Float getFloat();
- public void setFloat(Float f);
- public Double getDouble();
- public void setDouble(Double d);
- public Character getCharacter();
- public void setCharacter(Character character);
- public Byte getByte();
- public void setByte(Byte b);
- public Boolean getBoolean();
- public void setBoolean(Boolean b);
- public Locale getLocale();
- public void setLocale(Locale locale);
- public String getString();
- public void setString(String string);
- public Date getDate();
- public void setDate(Date date);
-
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/4aa87dbe/commons/sesame-tools-facading/src/test/java/org/apache/marmotta/commons/sesame/facading/primitive/model/Primitive.java
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-facading/src/test/java/org/apache/marmotta/commons/sesame/facading/primitive/model/Primitive.java b/commons/sesame-tools-facading/src/test/java/org/apache/marmotta/commons/sesame/facading/primitive/model/Primitive.java
deleted file mode 100644
index 05647c9..0000000
--- a/commons/sesame-tools-facading/src/test/java/org/apache/marmotta/commons/sesame/facading/primitive/model/Primitive.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.marmotta.commons.sesame.facading.primitive.model;
-
-import org.apache.marmotta.commons.sesame.facading.annotations.RDFPropertyBuilder;
-import org.apache.marmotta.commons.sesame.facading.model.Facade;
-
-@RDFPropertyBuilder(PropBuilder.class)
-public interface Primitive extends Facade {
-
- public int getInt();
- public void setInt(int i);
-
- public float getFloat();
- public void setFloat(float f);
-
- public double getDouble();
- public void setDouble(double d);
-
- public long getLong();
- public void setLong(long l);
-
- public boolean getBoolean();
- public void setBoolean(boolean b);
-
- public char getChar();
- public void setChar(char c);
-
- public byte getByte();
- public void setByte(byte b);
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/4aa87dbe/commons/sesame-tools-facading/src/test/java/org/apache/marmotta/commons/sesame/facading/primitive/model/PropBuilder.java
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-facading/src/test/java/org/apache/marmotta/commons/sesame/facading/primitive/model/PropBuilder.java b/commons/sesame-tools-facading/src/test/java/org/apache/marmotta/commons/sesame/facading/primitive/model/PropBuilder.java
deleted file mode 100644
index 98bfc3e..0000000
--- a/commons/sesame-tools-facading/src/test/java/org/apache/marmotta/commons/sesame/facading/primitive/model/PropBuilder.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.marmotta.commons.sesame.facading.primitive.model;
-
-import org.apache.marmotta.commons.sesame.facading.model.AbstractNamespacePropBuilder;
-
-public class PropBuilder extends AbstractNamespacePropBuilder {
-
- @Override
- protected String getNamespace() {
- return "http://persistence.text/prop#";
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/4aa87dbe/commons/sesame-tools-facading/src/test/resources/logback.xml
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-facading/src/test/resources/logback.xml b/commons/sesame-tools-facading/src/test/resources/logback.xml
index 864df3a..1bfecff 100644
--- a/commons/sesame-tools-facading/src/test/resources/logback.xml
+++ b/commons/sesame-tools-facading/src/test/resources/logback.xml
@@ -21,7 +21,6 @@
<pattern>%d{HH:mm:ss.SSS} %highlight(%level) %cyan(%logger{15}) - %m%n</pattern>
</encoder>
</appender>
- <logger name="org.apache.marmotta.commons.sesame.facading.concurrent.model" level="TRACE" />
<root level="${root-level:-INFO}">
<appender-ref ref="CONSOLE"/>
</root>
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/4aa87dbe/commons/sesame-tools-rio-api/pom.xml
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-api/pom.xml b/commons/sesame-tools-rio-api/pom.xml
index ccde248..18c3eee 100644
--- a/commons/sesame-tools-rio-api/pom.xml
+++ b/commons/sesame-tools-rio-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>
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/4aa87dbe/commons/sesame-tools-rio-ical/pom.xml
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-ical/pom.xml b/commons/sesame-tools-rio-ical/pom.xml
index 9115052..3414eed 100644
--- a/commons/sesame-tools-rio-ical/pom.xml
+++ b/commons/sesame-tools-rio-ical/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/commons/sesame-tools-rio-jsonld/pom.xml
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/pom.xml b/commons/sesame-tools-rio-jsonld/pom.xml
new file mode 100644
index 0000000..028556c
--- /dev/null
+++ b/commons/sesame-tools-rio-jsonld/pom.xml
@@ -0,0 +1,164 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.apache.marmotta</groupId>
+ <artifactId>marmotta-parent</artifactId>
+ <version>3.1.0-incubating-SNAPSHOT</version>
+ <relativePath>../../parent</relativePath>
+ </parent>
+
+ <name>Sesame I/O: JSON/LD</name>
+ <artifactId>sesame-tools-rio-jsonld</artifactId>
+ <packaging>jar</packaging>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>build-helper-maven-plugin</artifactId>
+ <version>1.7</version>
+ <executions>
+ <execution>
+ <id>add-ext</id>
+ <phase>generate-sources</phase>
+ <goals>
+ <goal>add-source</goal>
+ </goals>
+ <configuration>
+ <sources>
+ <source>src/ext/java</source>
+ </sources>
+ </configuration>
+ </execution>
+ <execution>
+ <id>add-ext-test</id>
+ <phase>generate-test-sources</phase>
+ <goals>
+ <goal>add-test-source</goal>
+ </goals>
+ <inherited>false</inherited>
+ <configuration>
+ <sources>
+ <source>src/ext-test/java</source>
+ </sources>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ <resources>
+ <resource>
+ <directory>src/main/resources</directory>
+ </resource>
+ <resource>
+ <directory>src/ext/resources</directory>
+ </resource>
+ </resources>
+ </build>
+
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.marmotta</groupId>
+ <artifactId>sesame-tools-rio-api</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-api</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.codehaus.jackson</groupId>
+ <artifactId>jackson-core-asl</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.codehaus.jackson</groupId>
+ <artifactId>jackson-mapper-asl</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>com.google.guava</groupId>
+ <artifactId>guava</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.openrdf.sesame</groupId>
+ <artifactId>sesame-model</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.openrdf.sesame</groupId>
+ <artifactId>sesame-rio-api</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.openrdf.sesame</groupId>
+ <artifactId>sesame-query</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.openrdf.sesame</groupId>
+ <artifactId>sesame-queryparser-api</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.openrdf.sesame</groupId>
+ <artifactId>sesame-queryparser-sparql</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.openrdf.sesame</groupId>
+ <artifactId>sesame-queryalgebra-model</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.openrdf.sesame</groupId>
+ <artifactId>sesame-queryalgebra-evaluation</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.openrdf.sesame</groupId>
+ <artifactId>sesame-sail-memory</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.openrdf.sesame</groupId>
+ <artifactId>sesame-repository-sail</artifactId>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>commons-io</groupId>
+ <artifactId>commons-io</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>ch.qos.logback</groupId>
+ <artifactId>logback-classic</artifactId>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+</project>